Keep database and forkchoice genesis consistent with the chain spec - #50
Open
vmarkushin wants to merge 3 commits into
Open
Keep database and forkchoice genesis consistent with the chain spec#50vmarkushin wants to merge 3 commits into
vmarkushin wants to merge 3 commits into
Conversation
vmarkushin
marked this pull request as ready for review
September 7, 2026 17:17
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.
The rollup database could retain the migration’s block-zero row beside the configured chain’s genesis, making safe-head lookup ambiguous. Custom-chain forkchoice initialization also recomputed the genesis header hash instead of using the chain spec’s sealed hash, which differs for Chikyu.
This change uses the sealed genesis hash and reconciles the database’s block-zero rows in one transaction during startup. Fresh databases replace the migration seed; populated databases can remove a duplicate seed only when the configured genesis is already recorded. Startup refuses an unexpected genesis, a populated database missing block zero, or populated history identified only by the shared seed. All refusals preserve the genesis rows and retained history.
Upgrade impact: legitimate older dev databases with only the shared seed also refuse startup because chain ownership cannot be established from that marker. Operators must verify the chain and database path, then restore a chain-identified backup or re-derive into a new rollup database. Existing data is not deleted on refusal. Operator documentation covers the behavior.
Extracted from #45 and based directly on main after #47. Independent of the sequencer-confirmation and credential-redaction PRs.
Validation: