You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
txs_results not returned properly on dYdX nodes #3002
Fetching older block_results doesn't return txs_results as it should. This block/block_results was saved in November and properly has 4 txs and 4 txs_results (this JSON combines both block and block_results)
I'm not affiliated with dYdX, I just happen to try running my cosmos indexer (Constellations) on dYdX and noticed it failed because the amount of txs_results is expected to be the same as txs.
{"jsonrpc":"2.0","id":-1,"result":{"check_tx":{"code":0,"data":null,"log":"","info":"","gas_wanted":"1","gas_used":"0","events":[],"codespace":"","sender":"","priority":"0","mempoolError":""},"deliver_tx":{"code":0,"data":null,"log":"","info":"","gas_wanted":"0","gas_used":"0","events":[{"type":"app","attributes":[{"key":"creator","value":"Cosmoshi Netowoko","index":true},{"key":"key","value":"cometbft","index":true},{"key":"index_key","value":"index is working","index":true},{"key":"noindex_key","value":"index is working","index":false}]},{"type":"app","attributes":[{"key":"creator","value":"Cosmoshi","index":true},{"key":"key","value":"rocks","index":true},{"key":"index_key","value":"index is working","index":true},{"key":"noindex_key","value":"index is working","index":false}]}],"codespace":""},"hash":"1B3C5A1093DB952C331B1749A21DCCBB0F6C7F4E0055CD04D16346472FC60EC6","height":"60"}}%
Make note of the height in the end of the JSON returned. So in this case it was height 60. Query the block_results for that height:
Note that in the txs_results there's a value returned with events
Stop the running cometbft with ctrl+c
Now let's run an instance of cometbft v0.38. Please note that this time we are just replacing cometbft binary and starting it again, still keeping the same config and data folder (cometbft home) as before:
git checkout v0.38.x
make install
cometbft start --proxy_app=kvstore --home=/tmp/cometbft-kvstore
Note that the tx submitted and queried with v0.38 returns properly (with events).
So this confirms the problem exists between releases from cometbft. Another test I've performed was to revert cometbft to v0.37 and query that block_result that was not returned properly in v0.38 and in v0.37 it returned properly. So this is not an issue with storage.
I've done additional troubleshooting and the problem is related on how the ABCI response is retrieved from the store to be used in the RPC block_results endpoint. The logic has to handle legacy ABCI responses and currently is not doing it properly.
I'm already testing a fix and will follow up later with that.
Activity
penso commentedon May 6, 2024
Someone on a channel said there is the same issue on sei devnet
andynog commentedon May 6, 2024
we are currently investigating the problem and we will add more context here
andynog commentedon May 6, 2024
I could reproduce the problem only on CometBFT side. There is a way to reproduce it using only the kvstore example app.
Here are the steps:
First you need to run a cometbft
v0.37. On a terminal in a cometbft repo folder, run:Then submit a tx:
Which will output a JSON
Make note of the height in the end of the JSON returned. So in this case it was height
60. Query theblock_resultsfor that height:Which will return
Note that in the
txs_resultsthere's a value returned with eventsStop the running cometbft with
ctrl+cNow let's run an instance of cometbft
v0.38. Please note that this time we are just replacing cometbft binary and starting it again, still keeping the same config and data folder (cometbft home) as before:Now let's query the same height as before (
60):and its return
Note the
txs_resultsdoesn't return properly, event though there's one result, it's all empty (no events).Now, just for the sake of testing, let's submit another transaction in
v0.38You should get again a JSON response with a height. Use that height to query the
block_results. In my test I've got height395Note that the tx submitted and queried with
v0.38returns properly (with events).So this confirms the problem exists between releases from cometbft. Another test I've performed was to revert cometbft to
v0.37and query that block_result that was not returned properly inv0.38and inv0.37it returned properly. So this is not an issue with storage.I've done additional troubleshooting and the problem is related on how the ABCI response is retrieved from the store to be used in the RPC block_results endpoint. The logic has to handle legacy ABCI responses and currently is not doing it properly.
I'm already testing a fix and will follow up later with that.
fixing tests (#3002)
added changelog (#3002)
16 remaining items
adding test from v1beta3 to v1 (#3002)
couple more tests (#3002)
added more coverage to tests (#3002)
fix: invalid `txs_results` returned for legacy ABCI responses (#3031)
fix: invalid `txs_results` returned for legacy ABCI responses (#3031)
fix: invalid `txs_results` returned for legacy ABCI responses (backport
fix: invalid `txs_results` returned for legacy ABCI responses (cometb…
fix: invalid `txs_results` returned for legacy ABCI responses (backport
chore: cometbft bump to v0.38.10
chore: cometbft bump to v0.38.10 (#583)
chore: cometbft bump to v0.38.10 (#583) (#584)
chore: cometbft bump to v0.38.10 (#583)