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

Improve block_history robustness in provider failure and reorgs #7

Open
GCdePaula opened this issue Aug 2, 2023 · 0 comments
Open

Comments

@GCdePaula
Copy link
Collaborator

The block number caching is not robust to network failures. When a new block arrives, the block_archive corrects the block number cache in case of reorgs. However, since this correction makes queries, it may fail. In such cases, the cache will be in an inconsistent state.

The solution is making the update_latest_block routine never fail, and handle queries by block number in block_tree differently. We'll probably have to remove the cache and add a loop, walking back through the block_tree data structure until we find what we're looking for (or fall back to requesting it to the provider).

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

1 participant