Skip to content
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

getLogs broken in 4.0.7 "Bincode error" #2795

Closed
kuegi opened this issue Jan 24, 2024 · 5 comments · Fixed by #2796
Closed

getLogs broken in 4.0.7 "Bincode error" #2795

kuegi opened this issue Jan 24, 2024 · 5 comments · Fixed by #2796
Labels

Comments

@kuegi
Copy link
Contributor

kuegi commented Jan 24, 2024

Summary

eth_getLogs fails with Custom error: error calling EVM : "EVM: Bincode error" on some events. It worked all good on 4.0.3 and 4.0.5 but in in 4.0.7, as soon as the range is big enough (or if you request logs from some SmartContracts like stakeX or the Bonds) you receive the error instead.

Steps to Reproduce

call
curl http://127.0.0.1:8551 -X POST -H "Content-Type: application/json" --data '{"method":"eth_getLogs","params":[{"fromBlock":"0x30700","toBlock":"0x30770"}],"id":1,"jsonrpc":"2.0"}'
on current mainnet with node >= 4.0.7
the range is "random", I just went back long enough to until the error occurs. didn't happen with only the few latest blocks. added the toBlock so you do not run into a limit error when you investigate (btw. that limit is super annoying on local nodes)

@kuegi kuegi added the bug label Jan 24, 2024
@kuegi
Copy link
Contributor Author

kuegi commented Jan 24, 2024

correction: looks like its only 4.0.7 but loading 4.0.7 messed up my evm state. afterwards both 4.0.5 and 4.0.3 (where it clearly worked before) show the same error now.

will load a snapshot and try to pin it down.

@kuegi
Copy link
Contributor Author

kuegi commented Jan 24, 2024

confirmed: 4.0.3 and 4.0.5 works, 4.0.7 gives the error.
going back to 4.05 after 4.0.7 is fine now too. might have been some weird glitch. But error clearly there in 4.0.7

@kuegi kuegi changed the title getLogs broken since 4.0.5 "Bincode error" getLogs broken in 4.0.7 "Bincode error" Jan 24, 2024
@sieniven
Copy link
Member

sieniven commented Jan 25, 2024

Hi Kuegi, thanks for reporting this. I cannot seem to recreate your issue (yet) but everything seems to be working fine on my end. The bincode error is coming from the rocksdb query (the EVM db) serialize/de-serialization error. This could potentially be a result of a corrupted db on your end, and I wouldnt be surprise if there were some undetected corruption in the evm db state because these were not safeguarded in the versions prior to v4.0.7. This would be a state issue on your end and perhaps re-indexing or reloading the chain from snapshot will resolve your issue.

I will spend abit of time today validating and trying to recreate your error, but would appreciate if you could get back if you were able to recreate the error on a snapshot.

@sieniven
Copy link
Member

sieniven commented Jan 25, 2024

(btw. that limit is super annoying on local nodes) - Unfortunately the old pipeline was incorrect and this was actually fixed in v4.0.6 onwards. The reference PR is: #2736.

The reason as to why a block range limit was included in the PR fixes is for maximum reliability of queries, with an additional a layer of security to the node against DoS. The RPC now fully aligns with geth, and that PR fixes are actually extremely crucial for the stability of the node which is enhanced in v4.0.6 onwards.

@sieniven
Copy link
Member

sieniven commented Jan 25, 2024

Update - managed to recreate the issue on my end and this seems to be a bug on PR #2736. Nothing wrong on your end and we will be resolving this, very much appreciated for spotting this. 🙏🏻

@sieniven sieniven linked a pull request Jan 25, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants