-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth_getLogs is not returning logs after PR pull/695 #761
Comments
@niklabh the issue cannot be reproduced on local development nodes, logs will be visible just fine. |
@tgmichel could it be due to this PR: #626? This issue started happening for us after we upgraded from |
@Dinonard how can we test it on your network (step to compile, step to sync)... so we can troubleshoot it. |
You have some options to further debug this and confirm is a schema cache related issue by exploring its contents in the offchain db:
On my side I did some checks over your RPC. If I run this command, I get some logs:
Block number If I query the ethereum storage schema at that height:
Meaning that the curl above was using (cached) schema version 3, which is the same schema version as the Astar's tip and thus your original curl command that's returning empty result. If the schema is not available in your offchain db cache - because there is a bug in the background task and it didn't map it correctly - theoretically would not be possible to retrieve any log on this schema. |
@crystalin does this help? The commands that Nikhil put into issue description can be used to test. EDIT: @tgmichel I will check your reply now (or tomorrow :) ). Thank you! |
Indeed, PR#626 has a major flaw. Using For the moment I'm proposing to just remove this cache and in the future come back to it if needed: |
@tgmichel I have logs:
PR with modifications: https://github.com/AstarNetwork/frontier/pull/23/files Thank you for investigating and your help! 🙏 |
Just to confirm that with your fix, the aforementioned calls work as expected. 👍 |
Awesome, glad it solved it for you. To be honest with the current design there is not much room for optimizing A few weeks ago I opened #721 so we can explore alternatives but by now nobody chimed in. Please if you have some time / thoughts regarding this that'd be great. |
I haven't really worked with that code so I'm not sure how beneficial my comments would be :) However, I wonder why not just add a concrete storage item to Of course, this isn't future-proof since it's not scalable but I guess we don't expect a new schema to come every few weeks. |
Description
eth_getLogs has stopped working after PR #695. It is returning empty array for new queries.
Steps to Reproduce
For Astar network parachain
Request for eth_getLogs
curl -X POST --data '{"id": 1, "jsonrpc":"2.0","method": "eth_getLogs","params": [{"address":"0x841ce48f9446c8e281d3f1444cb859b4a6d0738c", "topics":[], "fromBlock": "0x14D7F5", "toBlock": "0x14D7F7"}]}' https://astar-rpc.dwellir.com -H "Content-Type: application/json"
Check empty results are coming
{"jsonrpc":"2.0","result":[],"id":1}
Nodes which have rolledback before PR upgrade polkadot to v0.9.22 and integrate jsonrsee #695 is returning correct result.
curl -X POST --data '{"id": 1, "jsonrpc":"2.0","method": "eth_getLogs","params": [{"address":"0x841ce48f9446c8e281d3f1444cb859b4a6d0738c", "topics":[], "fromBlock": "0x14D7F5", "toBlock": "0x14D7F7"}]}' https://astar.api.onfinality.io/public-ws -H "Content-Type: application/json"
{"jsonrpc":"2.0","result":[{"address":"0x841ce48f9446c8e281d3f1444cb859b4a6d0738c","blockHash":"0x7afa51ec6ef05e41cd4cbe8879f4ecc6a765f7892e547f6341b4b1392381ea96","blockNumber":"0x14d7f6","data":"0x5cd11dbc09c77658576c5c498fb2f4c69d23fdba95df1c42bc494a9f3afc0bab00000000000000000000000027ee985d1e446ec71c277c89cd877ec4eeaa236c00000000000000000000000027ee985d1e446ec71c277c89cd877ec4eeaa236c0000000000000000000000006a2d262d56735dba19dd70682b39f6be9a931d980000000000000000000000000000000000000000000000000000000005ebb0b60000000000000000000000000000000000000000000000000000000000000038e446e1edeb0820082749ec71be560d667c964744fa39cf179ee1f6b8b6826cb8","logIndex":"0x10","removed":false,"topics":["0x79fa08de5149d912dce8e5e8da7a7c17ccdf23dd5d3bfe196802e6eb86347c7c"],"transactionHash":"0xb92e1c21bbeb31f6854456a1529faa3dcea79de446ecfdc92118aca3aed9b40f","transactionIndex":"0x6","transactionLogIndex":"0x1"}],"id":1}
Logs were created for the transactions https://blockscout.com/astar/tx/0xb92e1c21bbeb31f6854456a1529faa3dcea79de446ecfdc92118aca3aed9b40f/logs
Expected vs. Actual Behavior
Expected : Logs are being returned.
Actual Behavior: No logs are being returned
Logs, Errors or Screenshots
The text was updated successfully, but these errors were encountered: