Retry failed finalized rescans against the backfill client#1
Open
Retry failed finalized rescans against the backfill client#1
Conversation
The live client may not retain enough history for a finalized rescan when configured against a non-archive node. When a separate `backfill_beacon_url` is configured, fall back to that client (typically an archive node) on beacon-request failures during the rescan loop. Skip the retry path entirely when no separate backfill URL is configured — in that case the backfill `Arc<BeaconClient>` is just a clone of the live one and retrying against the same node is wasted effort. The decision is threaded through as `Option<&BeaconClient>` from `main.rs`, with `None` meaning "no distinct backfill client available". Only `Error::Http` and `Error::BeaconApi` trigger the retry; deterministic errors (DB, malformed data, etc.) propagate immediately as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
backfill_beacon_urlis configured, finalized rescans in the live loop now fall back to the backfill client on beacon-request failures (Error::Http/Error::BeaconApi). Useful when the live client is a non-archive node that has pruned the state needed to rescan an older finalized epoch.Arc<BeaconClient>is then just a clone of the live one, and retrying against the same node is wasted effort. The decision is threaded asOption<&BeaconClient>frommain.rs(None= "no distinct backfill client").Test plan
cargo checkpassescargo test --bins— 64 unit tests passbeacon_url+ an archivebackfill_beacon_url, force the live client to fail a finalized rescan, confirm the retry against the archive succeeds and the warn/error logs appear as designedbackfill_beacon_url, confirm a beacon-request failure on rescan aborts as today (no retry attempted)🤖 Generated with Claude Code