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

L2 genesis generation w/ predeploy #240

Merged
merged 17 commits into from
Nov 20, 2023
Merged

L2 genesis generation w/ predeploy #240

merged 17 commits into from
Nov 20, 2023

Conversation

LEAFERx
Copy link
Contributor

@LEAFERx LEAFERx commented Nov 16, 2023

Goals of PR

Core changes:

  • Updated magi to the latest develop branch
  • Introduce a new genesis generation tool that can set up predeploys and proxies at the genesis block
    • Adapted from Optimism's op-bindings and op-chain-ops packages
    • ops/bindings: Predeploy and proxy contract bindings generation with deployed bytecode and storage layout
    • ops/cmd/genesis: Introduce a new command which reads a GenesisConfig (see ops/genesis/config.go) and generate a geth genesis file by deploying predeploys on a simulated backend and transform deployment information into genesis file.
  • Minor contracts/code clean-up

TODOs:

  • Update scripts to use this new tool
  • Clean up READMEs, comments and make proper attributions to Optimism
  • Fix forge tests due to use of predeploy addresses in contracts

Copy link

changeset-bot bot commented Nov 16, 2023

⚠️ No Changeset found

Latest commit: 0523dd5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@MoonShiesty MoonShiesty 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. optimism creates the deployment artifacts for the L1 and L2 contracts with solidity, is this a follow-up we'd want to implement?

https://github.com/ethereum-optimism/optimism/blob/98ee7d5dbe82c0199b4e4201d49020a6a3ebf1f0/packages/contracts-bedrock/scripts/Deploy.s.sol

Copy link
Contributor

@chalkandpaste chalkandpaste left a comment

Choose a reason for hiding this comment

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

Lightly reviewed the OP code, but everything else LGTM. Let me know if you want me to look in more detail at the OPs code.

@LEAFERx
Copy link
Contributor Author

LEAFERx commented Nov 18, 2023

looks good. optimism creates the deployment artifacts for the L1 and L2 contracts with solidity, is this a follow-up we'd want to implement?

https://github.com/ethereum-optimism/optimism/blob/98ee7d5dbe82c0199b4e4201d49020a6a3ebf1f0/packages/contracts-bedrock/scripts/Deploy.s.sol

Yes ideally we want to shift most complex bash scripts to golang/python and consolidate all configurations/deployment in one program

sbin/read_genesis_hash.sh Outdated Show resolved Hide resolved
@@ -0,0 +1,20 @@
# Ops
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move ops into either services or lib (whichever is more appropriate) -- want to try keeping the root dir minimal

@@ -0,0 +1,3 @@
build
bindings/bindings/*.go
!bindings/bindings/registry.go
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: whats the ! and is this file not covered by the ignored path above

@ujvl ujvl merged commit afe93c7 into develop Nov 20, 2023
@ujvl ujvl deleted the zhe/magi_config branch November 20, 2023 08:18
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.

4 participants