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

eth_getLogs and eth_getBlockByNumber failing on pruned DB #2770

Closed
yorickdowne opened this issue Oct 4, 2021 · 4 comments
Closed

eth_getLogs and eth_getBlockByNumber failing on pruned DB #2770

yorickdowne opened this issue Oct 4, 2021 · 4 comments

Comments

@yorickdowne
Copy link

System information

Erigon version: v2021.10.01

OS & Version: Ubuntu 20.04

Commit hash : ef80fd5

Prune: prune="--prune=htc --prune.r.before=11184524"

Behaviour

eth_getLogs call returns on error on block 11185311; eth_getBlockByNumber returns "null" for it and its parent and child block.

curl http://localhost:8547 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"address": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "fromBlock": "0xAAA98C", "toBlock": "0xAAACA0"}],"id":1}'

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"block not found 11185311"}}
curl http://localhost:8547 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0xAAAC9E", false],"id":1}'

{"jsonrpc":"2.0","id":1,"result":null}
curl http://localhost:8547 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0xAAAC9F", false],"id":1}'

{"jsonrpc":"2.0","id":1,"result":null}
curl http://localhost:8547 -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0xAAACA0", false],"id":1}'

{"jsonrpc":"2.0","id":1,"result":null}

This pattern of not returning data for eth_getBlockByNumber is broader, I have not determined the edges. "latest" works and "0x1" works, both return data.

@AskAlexSharov
Copy link
Collaborator

I understand what is reason:

  • we recently added pruning of Senders - it's inside h
  • and if no senders we do return "no block", but I think it's fine that no senders - senders can be recovered on the fly - just you will pay CPU
  • so, if you will see high CPU usage at this block numbers - then also increase "pruning distance" of character h

Please try branch: no_senders_is_fine

@yorickdowne
Copy link
Author

yorickdowne commented Oct 4, 2021

Perfect, no_senders_is_fine does exactly what I need. Thank you! I am looking forward to seeing that feature in a future release. Closing issue.

@AskAlexSharov
Copy link
Collaborator

AskAlexSharov commented Oct 5, 2021

I said wrong, senders belong to “t”, not “h”.

@yorickdowne
Copy link
Author

Thank you for clarifying. The No Senders branch worked, and since the consensus client (“beacon”) gets the data only once, when it is syncing deposits, the additional CPU load doesn’t hurt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants