Skip to content

Retry failed finalized rescans against the backfill client#1

Open
3alpha wants to merge 1 commit intomasterfrom
live/finalized-rescan-backfill-fallback
Open

Retry failed finalized rescans against the backfill client#1
3alpha wants to merge 1 commit intomasterfrom
live/finalized-rescan-backfill-fallback

Conversation

@3alpha
Copy link
Copy Markdown
Member

@3alpha 3alpha commented Apr 28, 2026

Summary

  • When a separate backfill_beacon_url is 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.
  • The fallback is skipped entirely when no separate backfill URL is configured — the backfill Arc<BeaconClient> is then just a clone of the live one, and retrying against the same node is wasted effort. The decision is threaded as Option<&BeaconClient> from main.rs (None = "no distinct backfill client").
  • Deterministic errors (DB, malformed data, JSON, invalid id, inconsistent beacon data) propagate immediately as before — only transport / beacon-API failures trigger the retry.

Test plan

  • cargo check passes
  • cargo test --bins — 64 unit tests pass
  • Manual: run with a non-archive beacon_url + an archive backfill_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 designed
  • Manual: run without a backfill_beacon_url, confirm a beacon-request failure on rescan aborts as today (no retry attempted)

🤖 Generated with Claude Code

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

1 participant