-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constrain genesis block's state trie. #1228
Constrain genesis block's state trie. #1228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
// Connect genesis state root values. | ||
for (&limb0, &limb1) in pvs.genesis_state_root.iter().zip(&rhs.genesis_state_root) { | ||
builder.connect(limb0, limb1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to also connect lhs.genesis_state_root
and pvs.genesis_state_root
?
evm/src/fixed_recursive_verifier.rs
Outdated
let zero = builder.zero(); | ||
let has_not_parent_block = builder.sub(one, has_parent_block.target); | ||
|
||
// Chack that the genesis block number is 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Chack that the genesis block number is 0. | |
// Check that the genesis block number is 0. |
evm/src/proof.rs
Outdated
@@ -118,6 +118,8 @@ pub struct BlockMetadata { | |||
/// unlike `BlockMetadata`. | |||
#[derive(Debug, Clone, Default, Deserialize, Serialize)] | |||
pub struct ExtraBlockData { | |||
/// The state trie digest of the gensis block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// The state trie digest of the gensis block. | |
/// The state trie digest of the genesis block. |
As per the TODO in
create_block_proof
, this PR checks that the genesis block has a state trie of a predetermined form. The genesis state trie is provided as an input and stored among the public values.@wborgeaud Please let me know if this is what you had in mind for the genesis state trie!