fix(proofs): harden proof history across reorgs#223
Draft
davidtaikocha wants to merge 27 commits into
Draft
Conversation
added 22 commits
July 16, 2026 20:35
Disable reth's five-minute read-transaction timeout on every main-database transaction consumed by the initial state copy and the window backfill; both outlive it and the abort crash-looped the node mid-initialization. Treat a stored anchor or proof latest above the persisted best as a wait state instead of demanding a wipe: after an unclean shutdown the driver re-derives that gap on its own. A reorged stored latest at a persisted height is left to startup reconciliation's suffix unwind for the same reason. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The commit path pinned its decisions to a persisted-only canonical snapshot and the flushed proof head. That combination panicked the node when a queued stale commit met an already-persisted reorg, and in steady state it dropped nearly every live notification's precomputed trie data because the tip is rarely persisted at processing time, degrading the sidecar to poll-driven full re-execution. The upstream engine already deduplicates against its own buffered tip, turns gaps into an internal sync target, and reports a same-height branch conflict as ParentHashMismatch. Forward every exact notification block, treat that conflict as a routine reorg-ordering race that defers to canonical sync, and keep all other engine failures fatal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two holes remained around never-delivered reorg notifications. Startup subscribed after reth's consensus tasks were already live and then opened readiness from persisted-state reconciliation alone, so a same-height reorg published before the subscription could bless a displaced branch. And a commit conflicting with the engine's branch fell back to a number-only sync target, which cannot repair a same-height hash divergence: readiness stayed off with no path back. Gate startup readiness behind the live canonical target captured right after subscribing, exactly like lag recovery. Surface an engine branch conflict as its own routing outcome and recover it by replacing the receiver and the generation, rebasing readiness onto a fresh post-subscribe live target. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Proof and witness requests resolved their block and opened a historical state provider before queueing for Reth's shared proof permit, so a saturated pool left every queued request pinning an MDBX read transaction. Take the permit first, then resolve, then hand the permit to the detached blocking task, restoring the permit-first ordering the base implementation and upstream reth use. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Compatibility and design notes
Reorg correctness
Validation
Upstream reference: https://github.com/paradigmxyz/reth/releases/tag/v2.4.0