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

op-node: safer genesis script #6456

Merged
merged 4 commits into from
Jul 26, 2023
Merged

op-node: safer genesis script #6456

merged 4 commits into from
Jul 26, 2023

Conversation

tynes
Copy link
Contributor

@tynes tynes commented Jul 26, 2023

Description

Updates the op-node genesis gen script to prevent nil pointer access accidentally. Run the command like so:

go run op-node/cmd/main.go genesis l2 \
  --deploy-config $PWD/packages/contracts-bedrock/deploy-config/mainnet.json \
  --outfile.l2 l2.json \
  --outfile.rollup rollup.json \
  --l1-rpc $ETH_RPC_URL \
  --deployment-dir $PWD/packages/contracts-bedrock/deployments/mainnet

When generating the genesis file, it is ok to leave the l1StartingBlockTag value as undefined, this script will select an appropriate value and then the value will end up inside of the rollup config under .genesis.l1.hash which can then be backported to the deploy config to make the script deterministic.

A clear and concise description of the features you're adding in this pull request.

Updates the `op-node` genesis gen script to prevent `nil` pointer
access accidentally. Run the command like so:

```go
go run op-node/cmd/main.go genesis l2 \
  --deploy-config $PWD/packages/contracts-bedrock/deploy-config/mainnet.json \
  --outfile.l2 l2.json \
  --outfile.rollup rollup.json \
  --l1-rpc $ETH_RPC_URL \
  --deployment-dir $PWD/packages/contracts-bedrock/deployments/mainnet
```

When generating the genesis file, it is ok to leave the
`l1StartingBlockTag` value as undefined, this script will select an
appropriate value and then the value will end up inside of the rollup
config under `.genesis.l1.hash` which can then be backported to
the deploy config to make the script deterministic.
@tynes tynes requested a review from a team as a code owner July 26, 2023 15:48
@tynes tynes requested a review from Inphi July 26, 2023 15:48
@changeset-bot
Copy link

changeset-bot bot commented Jul 26, 2023

⚠️ No Changeset found

Latest commit: a8a4b22

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
Member

@clabby clabby left a comment

Choose a reason for hiding this comment

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

nice!

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #6456 (74305be) into develop (d6698a4) will increase coverage by 3.17%.
Report is 1 commits behind head on develop.
The diff coverage is 0.00%.

❗ Current head 74305be differs from pull request most recent head 4f4afaa. Consider uploading reports for the commit 4f4afaa to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6456      +/-   ##
===========================================
+ Coverage    40.74%   43.92%   +3.17%     
===========================================
  Files          465      313     -152     
  Lines        33461    24951    -8510     
  Branches      1949        0    -1949     
===========================================
- Hits         13634    10959    -2675     
+ Misses       18350    12982    -5368     
+ Partials      1477     1010     -467     
Flag Coverage Δ
bedrock-go-tests 43.92% <0.00%> (-0.02%) ⬇️
cannon-go-tests ?
chain-mon-tests ?
common-ts-tests ?
contracts-bedrock-tests ?
contracts-ts-tests ?
core-utils-tests ?
sdk-next-tests ?
sdk-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
op-node/cmd/genesis/cmd.go 0.00% <0.00%> (ø)

... and 154 files with indirect coverage changes

@mergify
Copy link
Contributor

mergify bot commented Jul 26, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented Jul 26, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Jul 26, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@tynes tynes merged commit a3416a2 into develop Jul 26, 2023
7 of 50 checks passed
@tynes tynes deleted the fix/genesis-script branch July 26, 2023 16:28
@mergify mergify bot removed the on-merge-train label Jul 26, 2023
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.

None yet

3 participants