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

Handle Ethereum Firehose decoding issues without crashing #3483

Merged
merged 3 commits into from Apr 25, 2022

Conversation

Jannis
Copy link
Contributor

@Jannis Jannis commented Apr 20, 2022

This fixes #3460 by using TryFrom when decoding Ethereum Firehose blocks and then handling the error by retrying the same block over and over again (with exponential back-off). Before, graph-node would crash completely.

Before, graph-node would crash completely whenever it would encounter a
Firehose block that didn't meet the expectations. In the specific
example where we ran into this, there were invalid Firehose blocks
delivered to graph-node with `null` addresses that were expected to
be non-null.

This change makes it so that decoding errors are handled more
gracefully: they simply make the subgraph in question enter a retry loop
that recovers as soon as the Firehose issue is fixed. We could also fail
the subgraph but that's less robust.

Fixes #3460.
Before, we'd only back off when failing to establish connections.
@Jannis Jannis requested review from maoueh and leoyvens April 20, 2022 12:44
@Jannis Jannis assigned Jannis and leoyvens and unassigned Jannis Apr 20, 2022
graph/src/blockchain/firehose_block_stream.rs Outdated Show resolved Hide resolved
Co-authored-by: Leonardo Yvens <leoyvens@gmail.com>
@Jannis Jannis merged commit 16d9768 into master Apr 25, 2022
@Jannis Jannis deleted the jannis/fallible-eth-proto-decoding branch April 25, 2022 18:55
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

Successfully merging this pull request may close these issues.

ETH Firehose: Avoid crash when Firehose block stream data is invalid
2 participants