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

test: Add TestGenesisHash (protocol parameter verification) #72

Merged
merged 4 commits into from
Feb 5, 2024

Conversation

geoknee
Copy link
Contributor

@geoknee geoknee commented Jan 31, 2024

Description

  • Adds a new test to validate the genesis block hash against the provided genesis config
  • This test generates a new genesis block from (the provided chainconfig + some hardcoded values) and checks it matches the declared genesis hash. Thus (trusting the declared hash is correct) if the check passes we know the config is "correct" according to
    • the function which builds the block.
    • the config read from superchain (e.g. genesis block nonce and many other fields)
    • the config baked into the function above (e.g. OptimismConfig)

Additional context

  • Inspired by Josh's op-genesis tool.

  • I think there is an opportunity to move a lot or all of the code looped in from op-geth into superchain. If we want to do that, will require some coordination between the two repos. Dependency relationships:

    • validation => op-geth (remove)
    • validation => superchain (keep)
    • op-geth => superchain (keep)

Metadata

@geoknee geoknee changed the title Gk/protocol parameter verification test: Add some protocol parameter verification Jan 31, 2024
@geoknee geoknee marked this pull request as ready for review January 31, 2024 16:51
@geoknee geoknee requested review from protolambda and a team as code owners January 31, 2024 16:51
Copy link
Contributor

@zchn zchn left a comment

Choose a reason for hiding this comment

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

Created #75 so you don't need my review afterwards

@geoknee geoknee changed the title test: Add some protocol parameter verification test: Add TestGenesisHash (protocol parameter verification) Feb 2, 2024
Copy link
Contributor

@mslipper mslipper left a comment

Choose a reason for hiding this comment

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

As we discussed during our 1:1, we should ideally move the genesis generation loading code + hardcoded genesis hashes into the Registry.

validation/superchain-genesis_test.go Show resolved Hide resolved
@geoknee
Copy link
Contributor Author

geoknee commented Feb 4, 2024

As we discussed during our 1:1, we should ideally move the genesis generation loading code + hardcoded genesis hashes into the Registry.

Agreed. I'll queue that up for future work #78.

@mslipper mslipper merged commit 44d58c3 into main Feb 5, 2024
9 checks passed
@mslipper mslipper deleted the gk/protocol-parameter-verification branch February 5, 2024 16:59
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