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

contracts-bedrock: fix deploy config for mainnet MCP upgrade #9865

Merged
merged 20 commits into from
Apr 4, 2024

Conversation

tynes
Copy link
Contributor

@tynes tynes commented Mar 14, 2024

Description

The config param for the scalar was not updated in the
deploy config when it was changed on chain. If we can enforce
that the deploy config is always used as the source of truth
for when doing on chain config changes, it can help to scale
the team as other teams can use the same config file and know
that the values in there represent the truth. This is a fundamental
problem with the initialize pattern, we need to move away from
it eventually.

The deploy config is updated with the value that is used on
mainnet and the parsing is updated to handle the new ecotone
style config, which tightly packs the values into a single
bytes32. The overhead is set to 0 because it is no longer used post ecotone.

@tynes tynes requested review from a team as code owners March 14, 2024 17:13
@tynes tynes requested a review from Inphi March 14, 2024 17:13
Copy link
Contributor

coderabbitai bot commented Mar 14, 2024

Walkthrough

Walkthrough

The changes across various components streamline operations for the Ecotone upgrade, focusing on fee scalar adjustments, gas price oracle configurations, and superchain integration. These enhancements optimize encoding processes, ensure protocol compatibility, and improve system efficiency.

Changes

Files Summary
op-chain-ops/genesis/config.go, op-chain-ops/genesis/layer_two_test.go, op-e2e/e2eutils/setup.go Introduced/deprecated gas price oracle scalars, updated fee scalar serialization, and added L1Block predeploy tests.
op-chain-ops/upgrades/l1.go Updated to pass superchainConfig as a parameter, removing the global variable for superchain configuration.
op-chain-ops/cmd/ecotone-scalar/main.go, op-chain-ops/cmd/op-upgrade-mcp/main.go Simplified scalar value encoding with eth.EncodeScalar and enhanced handling of superchain configurations in the upgrade tool.
op-service/eth/types.go, op-service/eth/types_test.go Added DecodeScalar and EncodeScalar functions for scalar values, including tests for encoding and decoding.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.22%. Comparing base (35c0ad8) to head (4de5c33).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #9865       +/-   ##
============================================
- Coverage    42.40%   29.22%   -13.18%     
============================================
  Files           73       31       -42     
  Lines         4830     2898     -1932     
  Branches       766      614      -152     
============================================
- Hits          2048      847     -1201     
+ Misses        2676     1976      -700     
+ Partials       106       75       -31     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests ?
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests ?
sdk-tests 40.27% <ø> (ø)

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

see 42 files with indirect coverage changes

@mds1 mds1 marked this pull request as draft March 14, 2024 17:20
tynes added a commit to ethereum-optimism/superchain-ops that referenced this pull request Mar 16, 2024
@tynes tynes marked this pull request as ready for review March 17, 2024 23:20
@tynes
Copy link
Contributor Author

tynes commented Mar 17, 2024

I pushed additional commits so this needs another round of review before merge

tynes added a commit to ethereum-optimism/superchain-ops that referenced this pull request Mar 18, 2024
Copy link
Contributor

github-actions bot commented Apr 1, 2024

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Apr 1, 2024
@tynes tynes removed the Stale label Apr 1, 2024
@tynes tynes marked this pull request as draft April 1, 2024 16:21
@tynes
Copy link
Contributor Author

tynes commented Apr 1, 2024

This should add some test coverage to L2 genesis generation

@tynes tynes marked this pull request as ready for review April 2, 2024 03:36
op-chain-ops/genesis/config.go Outdated Show resolved Hide resolved
op-chain-ops/genesis/config.go Show resolved Hide resolved
op-service/eth/types.go Outdated Show resolved Hide resolved
packages/contracts-bedrock/deploy-config/hardhat.json Outdated Show resolved Hide resolved
packages/contracts-bedrock/deploy-config/mainnet.json Outdated Show resolved Hide resolved
op-service/eth/types.go Outdated Show resolved Hide resolved
op-chain-ops/cmd/op-upgrade-mcp/main.go Show resolved Hide resolved
op-chain-ops/upgrades/l1.go Show resolved Hide resolved
op-chain-ops/cmd/op-upgrade/main.go Show resolved Hide resolved
op-chain-ops/genesis/config.go Show resolved Hide resolved
op-chain-ops/upgrades/l1.go Outdated Show resolved Hide resolved
op-chain-ops/upgrades/l1.go Outdated Show resolved Hide resolved
op-chain-ops/upgrades/l1.go Outdated Show resolved Hide resolved
op-chain-ops/upgrades/l1.go Outdated Show resolved Hide resolved
op-service/eth/types.go Outdated Show resolved Hide resolved
@protolambda
Copy link
Contributor

This depends on #9935 now, since the op-geth update introduces breaking simulated-backend changes, which this needed to adapt to.

tynes and others added 20 commits April 4, 2024 13:21
The config param for the scalar was not updated in the
deploy config when it was changed on chain. If we can enforce
that the deploy config is always used as the source of truth
for when doing on chain config changes, it can help to scale
the team as other teams can use the same config file and know
that the values in there represent the truth. This is a fundamental
problem with the `initialize` pattern, we need to move away from
it eventually.

The deploy config is updated with the value that is used on
mainnet and the parsing is updated to handle the new ecotone
style config, which tightly packs the values into a single
bytes32.
Ensures that the same consensus code is used
to encode and decode the scalar in various places.
Make backwards compatible
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
@protolambda
Copy link
Contributor

Rebased on develop, PR no longer depends on op-geth, the op-geth changes have landed.

@protolambda protolambda added this pull request to the merge queue Apr 4, 2024
Merged via the queue into develop with commit 8167f36 Apr 4, 2024
73 checks passed
@protolambda protolambda deleted the fix/mcp-config branch April 4, 2024 20:05
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

5 participants