Validator chain invariants#1774
Open
sergerad wants to merge 11 commits intosergerad-validator-bootstrapfrom
Open
Validator chain invariants#1774sergerad wants to merge 11 commits intosergerad-validator-bootstrapfrom
sergerad wants to merge 11 commits intosergerad-validator-bootstrapfrom
Conversation
Mirko-von-Leipzig
requested changes
Mar 11, 2026
Collaborator
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
Minor nits, but I think we need to allow for a single block fork.
| /// block commitment). | ||
| /// | ||
| /// On success, returns the signature and the new block header (which becomes the new chain tip). | ||
| #[instrument(target = COMPONENT, skip_all, err, fields(chain_tip = chain_tip.block_num().as_u32()))] |
Collaborator
There was a problem hiding this comment.
We should also log block.number and block.commitment
Collaborator
Author
There was a problem hiding this comment.
those aren't available from ProposedBlock, if thats what you mean. I could add an event in the fn? After
let (proposed_header, _) = proposed_block…en-node into sergerad-validator-chain
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.
Context
Closes #1773.
In #1764 we are adding a validator subcommand to construct and sign the genesis block. In this PR, we are building on top of that and storing the genesis block as the initial chain tip in the validator DB.
The validator is updated to maintain a chain tip as it continues to sign blocks. It uses this state to validate chain continuity (block number sequence, commitment references, etc).
Changes
chain_tiptable to the validator database to persist the last signed block header.--data-directoryargument).validate_blocknow enforces chain continuity: sequential block numbers and matching previous block commitments.validate_blockhandles retries by detecting when a proposed block matches the current chain tip and re-signing without advancing state (idempotence).Mutex) and persisted to the database after each new block is signed.dbmodule public so the bootstrap command can callsave_chain_tipandloaddirectly.