Skip to content

fix(host-rpc): track delivery high-water mark for backfill recovery#133

Open
prestwich wants to merge 1 commit intomainfrom
prestwich/fix-backfill-highwater-mark
Open

fix(host-rpc): track delivery high-water mark for backfill recovery#133
prestwich wants to merge 1 commit intomainfrom
prestwich/fix-backfill-highwater-mark

Conversation

@prestwich
Copy link
Copy Markdown
Member

Summary

  • Replaces finalized with a last_emitted: Option<(u64, B256)> high-water mark as the resume point after buffer exhaustion, fixing a contiguity violation where the notifier could backtrack behind already-delivered blocks
  • Changes backfill ceiling from tip - buffer_capacity to tip - buffer_capacity / 2, leaving half the buffer depth for frontfill hash-walk overlap
  • Adds parent-hash continuity check in drain_backfill to detect reorgs that occur during the gap between exhaustion and backfill resume

Competing fix for #131 — see review comment for the diagnosis of why comparing to finalized is wrong.

Test plan

  • Verify clippy + fmt pass (done locally)
  • Integration test: buffer exhaustion resumes from last_emitted + 1, not finalized
  • Integration test: parent-hash mismatch returns BackfillContinuityBreak
  • Confirm no downstream breakage from NoFinalizedBlock removal

🤖 Generated with Claude Code

The notifier previously used `finalized` as the resume point after
buffer exhaustion, which can be behind the last delivered block and
violates the contiguity guarantee. Replace with a `last_emitted`
high-water mark that tracks the actual last emitted (number, hash).

Also changes backfill ceiling from `tip - buffer_capacity` to
`tip - buffer_capacity / 2`, leaving half the buffer for frontfill
overlap. Adds parent-hash continuity check on backfill resume.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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