Skip to content
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

Merged
merged 5 commits into from
Sep 26, 2023

Conversation

LindaGuiga
Copy link
Contributor

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!

Copy link
Contributor

@wborgeaud wborgeaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Comment on lines +658 to +661
// Connect genesis state root values.
for (&limb0, &limb1) in pvs.genesis_state_root.iter().zip(&rhs.genesis_state_root) {
builder.connect(limb0, limb1);
}
Copy link
Contributor

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?

let zero = builder.zero();
let has_not_parent_block = builder.sub(one, has_parent_block.target);

// Chack that the genesis block number is 0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The state trie digest of the gensis block.
/// The state trie digest of the genesis block.

@LindaGuiga LindaGuiga merged commit 916ce0d into 0xPolygonZero:main Sep 26, 2023
2 checks passed
@Nashtare Nashtare deleted the constrain-genesis-state branch October 9, 2023 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants