ChainSafe / ChainSafe/forest

Flaky `Filecoin.MarketAddBalance` tests

Open
#4,849 2 comments 0 reactions 0 assignees View on GitHub
Type: Bug
Dominant language
Rust
Stars
697
Forks
200
Avg merge
1d 5h
Merged PRs (30d)
65

Description

## Describe the bug

Wallet tests fail repeatedly, causing merges to get evicted from the merge queue. There is either a bug in the implementation, or assumptions in the tests are incorrect.

## To reproduce

The following test is failing: https://github.com/ChainSafe/forest/blob/6b4f26d2b94b4a33a35764cc3dfa565ae178ac4d/scripts/tests/calibnet_wallet_check.sh#L28-L78

## Log output
[job-logs.txt](https://github.com/user-attachments/files/17280479/job-logs.txt)
```
+ : Begin Filecoin.MarketAddBalance test
+ FOREST_URL=http://127.0.0.1:2345/rpc/v1
+ MARKET_FIL_AMT=23
++ tail -1
++ forest-wallet --remote-wallet list
++ cut -d ' ' -f1
+ REMOTE_ADDR=t1ac6ndwj6nghqbmtbovvnwcqo577p6ox2pt52q2y
+++ jq -n --arg addr t1ac6ndwj6nghqbmtbovvnwcqo577p6ox2pt52q2y --arg amt 23 '{jsonrpc: "2.0", id: 1, method: "Filecoin.MarketAddBalance", params: [$addr, $addr, $amt]}'
++ curl -s -X POST http://127.0.0.1:2345/rpc/v1 --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'Authorization: ***' --data '{
"jsonrpc": "2.0",
"id": 1,
"method": "Filecoin.MarketAddBalance",
"params": [
"t1ac6ndwj6nghqbmtbovvnwcqo577p6ox2pt52q2y",
"t1ac6ndwj6nghqbmtbovvnwcqo577p6ox2pt52q2y",
"23"
]
}'
+ JSON='{"jsonrpc":"2.0","id":1,"result":{"/":"bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m"}}'
{"jsonrpc":"2.0","id":1,"result":{"/":"bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m"}}
+ echo '{"jsonrpc":"2.0","id":1,"result":{"/":"bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m"}}'
++ echo '{"jsonrpc":"2.0","id":1,"result":{"/":"bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m"}}'
++ jq -e .result
+ [[ {
"/": "bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m"
} == \n\u\l\l ]]
++ echo '{"jsonrpc":"2.0","id":1,"result":{"/":"bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m"}}'
++ jq -r '.result["/"]'
+ MSG_CID=bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m
Message cid: bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m
+ echo 'Message cid: bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m'
+ for i in {1..30}
+ sleep 5s
+ echo 'Attempt 1:'
Attempt 1:
+++ jq -n --arg cid bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m '{jsonrpc: "2.0", id: 1, method: "Filecoin.StateSearchMsg", params: [[], {"/": $cid}, 800, true]}'
++ curl -s -X POST http://127.0.0.1:2345/rpc/v1 --header 'Content-Type: application/json' --data '{
"jsonrpc": "2.0",
"id": 1,
"method": "Filecoin.StateSearchMsg",
"params": [
[],
{
"/": "bafy2bzacedv4os6xyuqyqjlzhbnlweqssratjd2a4ggd4as5kvastygesdt5m"
},
800,
true
]
}'
+ JSON='{"jsonrpc":"2.0","id":1,"error":{"code":-32603,"message":"Can'\''t create a valid state tree from the given root. This error may indicate unsupported version. state_root_cid=bafy2bzacebor42fwgwclotlolh6okmye5ikys4plkhjdpwzvwi6ytsnhx75r2, state_root_version=unknown"}}'
+ echo '{"jsonrpc":"2.0","id":1,"error":{"code":-32603,"message":"Can'\''t create a valid state tree from the given root. This error may indicate unsupported version. state_root_cid=bafy2bzacebor42fwgwclotlolh6okmye5ikys4plkhjdpwzvwi6ytsnhx75r2, state_root_version=unknown"}}'
+ jq -e .result
+ echo '{"jsonrpc":"2.0","id":1,"error":{"code":-32603,"message":"Can'\''t create a valid state tree from the given root. This error may indicate unsupported version. state_root_cid=bafy2bzacebor42fwgwclotlolh6okmye5ikys4plkhjdpwzvwi6ytsnhx75r2, state_root_version=unknown"}}'
{"jsonrpc":"2.0","id":1,"error":{"code":-32603,"message":"Can't create a valid state tree from the given root. This error may indicate unsupported version. state_root_cid=bafy2bzacebor42fwgwclotlolh6okmye5ikys4plkhjdpwzvwi6ytsnhx75r2, state_root_version=unknown"}}
```

## Expected behaviour

The test doesn't fail but the implementation is still tested.

## Screenshots

## Environment (please complete the following information):

- OS: GH runner's ubuntu-latest
- Branch/commit `main` 6b4f26d2b94b4a33a35764cc3dfa565ae178ac4d
- Hardware GH runner

## Other information and links

Test disabled in https://github.com/ChainSafe/forest/issues/4849

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.