Merged
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.
8586d1d to
e2dee35
Compare
Mirko-von-Leipzig
requested changes
Mar 17, 2026
| CREATE INDEX idx_validated_transactions_block_num ON validated_transactions(block_num); | ||
|
|
||
| CREATE TABLE block_headers ( | ||
| block_num INTEGER PRIMARY KEY, |
Collaborator
There was a problem hiding this comment.
If we also store block_commitment can we avoid pulling in the entire header each check?
Collaborator
Author
There was a problem hiding this comment.
That depends on whether we want to do any additional checks on top of the block number + commitment ones I have now.
@bobbinth may have had some ideas on that point - whether there is more to compare with a new / proposed chain tip (not signed) against the previous signed chain tip beyond just block number and commitment continuity.
mmagician
reviewed
Mar 18, 2026
mmagician
approved these changes
Mar 19, 2026
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
block_headerstable to the validator database.--data-directoryargument).validate_blocknow enforces chain continuity: sequential block numbers and matching previous block commitments.validate_blockallows for the current chain tip inblock_headerstable to be overwritten to allow for idempotence.dbmodule public so the bootstrap command can callsave_chain_tipandloaddirectly.