fix(host-rpc): ingest [from, tip] when backfill_from is above ceiling#148
Open
prestwich wants to merge 2 commits into
Open
fix(host-rpc): ingest [from, tip] when backfill_from is above ceiling#148prestwich wants to merge 2 commits into
prestwich wants to merge 2 commits into
Conversation
When the sidecar restarted with its persisted host height within `buffer_capacity/2` blocks of tip, `drain_backfill` declared backfill complete without fetching any blocks. The first subsequent `handle_new_head` then walked from an empty `chain_view`, returning a single-block segment whose RU parent was not in the DB — crashing the processor with "parent ru block not present in DB" until the chain advanced past the ceiling (5–10 minutes). The `/2` ceiling exists to leave hash-walk headroom on new tips, but it must not drop blocks the node has already committed to ingesting. When `from > backfill_ceiling` but `from <= tip`, ingest up to `tip` in this batch instead of skipping. Fixes ENG-2280. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fraser999
reviewed
May 21, 2026
Provider tip regression (reorg, lagging replica) would silently switch to frontfill from an inconsistent cursor, re-introducing the parent-not-in-DB crash this branch addresses. Only `from == tip + 1` is a legitimate completion; `from > tip + 1` now returns `BackfillContinuityBreak`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
|
[Claude Code] @Fraser999 addressed in 537a98a — |
Evalir
approved these changes
May 22, 2026
Fraser999
approved these changes
May 22, 2026
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
Fixes the sidecar crash-loop on restart described in ENG-2280.
When the sidecar restarted with its persisted host height within
buffer_capacity/2blocks of tip,drain_backfilldeclared backfill complete without fetching any blocks. The first subsequenthandle_new_headthen walked from an emptychain_view, returning a single-block segment whose RU parent was not in the DB — crashing the processor withparent ru block not present in DBatblock-processor/src/v1/processor.rs:161. The loop self-healed after 5–10 minutes once the chain advanced past the ceiling.The
/2ceiling exists to leave hash-walk headroom on new tips, but it must not drop blocks the node has already committed to ingesting. Whenfrom > backfill_ceilingbutfrom <= tip, ingest up totipin this batch instead of skipping.Test plan
cargo clippy -p signet-host-rpc --all-features --all-targets -- -D warnings✅cargo t -p signet-host-rpc✅RUSTDOCFLAGS="-D warnings" cargo doc -p signet-host-rpc --no-deps --all-features✅drain_backfill→handle_new_head.🤖 Generated with Claude Code