Skip to content

Improve block_history robustness in provider failure and reorgs #7

@GCdePaula

Description

@GCdePaula

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions