Skip to content

[Bug] ChainStreamPoller doesn't handle reorgs #1005

Closed
@popzxc

Description

@popzxc

Component

provider, pubsub

What version of Alloy are you on?

No response

Operating System

None

Describe the bug

ChainStreamPoller doesn't seem to account for reorgs at all, e.g. here it always expects the chain to be continuous.
And to fix that we probably need to compare block tip against next_yield here, and if block_number < next_yield, we should do some kind of search for the last non-diverging block (so probably we need to poll not only for block number, but rather for block header to use root hashes for comparison).

See this comment for more context.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions