Repository navigation
Conversation
After a reset the pipeline replays from before the safe head's L1 origin and can produce the next block from an L1 block below the one its parent was recorded at. The in-memory SafeHeadHistory skipped such a block; the safe head database recorded it there, out of ascending L1 order, so it answered that block for L1 heights where its parent was not yet safe. The history now raises such a block to its parent's L1 block and returns that block, which the database records too, so the two records agree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
Contributor
Author
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.
Stacked on #23634; review that first. This PR targets its branch, and GitHub retargets it to
developwhen #23634 merges.kona-node's safe head database and #23634's in-memory safe-head history now record each safe head at the same L1 block. That fixes database answers that were too low after a reset.
The bug. After a reset, derivation replays L1 from a channel timeout before the safe head's L1 origin. The replay can produce the next block while reading an L1 block below the one its parent was recorded at. Pre-Holocene, for example, that happens when the next block's batch was included before its parent's and buffered. A block cannot become safe before its parent. Yet the database recorded it at the lower block, out of the ascending order
safe_head_updatedrequires. Sosafe_head_at_l1for that lower block returned a safe head whose parent was not yet safe there (invariant I6 indocs/ai/safedb-review.md). This predates #23634, since every reset replays. #23634's history guarded against it with a floor.The fix. Both records now take one L1 block: the derivation source, raised to the L1 block the parent was recorded at.
SafeHeadHistory::recordworks it out and returns it, and the database writes what it returns. The history used to skip such a block; now it records it at the raised block too.How exact the raised block is.
Effect on operators. With the safe head database enabled, its entries stay in ascending L1 order across resets, and a block is never answered for an L1 height where its parent was not yet safe. kona's database is not served over RPC yet, so no query consumer sees the change today.
Not changed
Review. A review following
safedb-reviewer(docs/ai/safedb-review.md) found the seeding issue above. That led to dropping the seeding and to the Holocene wording. It found no issue with I1 to I3, nor with I4 once the seeding was gone. The tests fail if the database writes the raw source again, or if the history goes back to skipping.🤖 Generated with Claude Code