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: move immutables to storage for OptimismMintableERC20Factory #8700

Merged
merged 35 commits into from
Jan 11, 2024

Conversation

@0xfuturistic 0xfuturistic requested review from maurelian and removed request for a team December 20, 2023 12:46
Copy link
Contributor

coderabbitai bot commented Dec 20, 2023

Walkthrough

Walkthrough

The updates indicate a significant overhaul in the initialization and upgrade procedures for the OptimismMintableERC20Factory. New checks for initialization status have been introduced, and the deployment process has been streamlined. The OptimismMintableERC20Factory contract has been enhanced to use an initialize function instead of a constructor, and its version has been updated. Conditional logic has been added to the ChainAssertions.sol script, and testing utilities have been expanded to cover the new initialization and upgrade logic.

Changes

Files Change Summary
op-chain-ops/cmd/check-l2/main.go Introduces checks for initialization status and adds error handling for OptimismMintableERC20Factory.
op-chain-ops/genesis/config.go
op-chain-ops/immutables/immutables.go
Alters initialization of OptimismMintableERC20Factory and ProxyAdmin. Removes and modifies imports and structure declarations.
op-chain-ops/upgrades/l1.go Replaces upgrade function with upgradeAndCall and adds logic for OptimismMintableERC20Factory ABI and initialization.
packages/contracts-bedrock/scripts/ChainAssertions.sol
packages/contracts-bedrock/scripts/Deploy.s.sol
Adds new parameter _isProxy to checkOptimismMintableERC20Factory function and updates deployment and initialization processes.
packages/contracts-bedrock/src/universal/OptimismMintableERC20Factory.sol
packages/contracts-bedrock/test/universal/OptimismMintableERC20Factory.t.sol
Updates contract to include Initializable functionality, adds initialize function, updates version, and expands testing utilities and test functions.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (954bcf2) 25.69% compared to head (9eda162) 25.73%.
Report is 126 commits behind head on feat/mcp-l1.

Additional details and impacted files
@@               Coverage Diff               @@
##           feat/mcp-l1    #8700      +/-   ##
===============================================
+ Coverage        25.69%   25.73%   +0.04%     
===============================================
  Files              119      117       -2     
  Lines             4889     4842      -47     
  Branches          1063     1057       -6     
===============================================
- Hits              1256     1246      -10     
+ Misses            3527     3492      -35     
+ Partials           106      104       -2     
Flag Coverage Δ
chain-mon-tests 27.14% <ø> (ø)
contracts-bedrock-tests 20.25% <ø> (+0.01%) ⬆️
contracts-ts-tests 12.25% <ø> (ø)
sdk-next-tests 42.08% <ø> (-0.11%) ⬇️
sdk-tests 42.08% <ø> (-0.11%) ⬇️

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

Files Coverage Δ
...ontracts-bedrock/src/L1/L1CrossDomainMessenger.sol 0.00% <ø> (ø)
...ckages/contracts-bedrock/src/L1/OptimismPortal.sol 0.00% <ø> (ø)
...ckages/contracts-bedrock/src/L2/GasPriceOracle.sol 0.00% <ø> (ø)
packages/contracts-bedrock/src/L2/L1Block.sol 80.00% <ø> (-8.89%) ⬇️
...ontracts-bedrock/src/L2/L2CrossDomainMessenger.sol 0.00% <ø> (ø)
...ntracts-bedrock/src/dispute/DisputeGameFactory.sol 0.00% <ø> (ø)
...contracts-bedrock/src/dispute/FaultDisputeGame.sol 0.00% <ø> (ø)
.../contracts-bedrock/src/dispute/lib/LibPosition.sol 0.00% <ø> (ø)
...kages/contracts-bedrock/src/dispute/lib/LibUDT.sol 0.00% <ø> (ø)
...kages/contracts-bedrock/src/libraries/Encoding.sol 34.48% <ø> (-2.56%) ⬇️

... and 6 files with indirect coverage changes

op-node/flags/flags.go Outdated Show resolved Hide resolved
op-node/flags/flags.go Outdated Show resolved Hide resolved
op-node/flags/flags_test.go Outdated Show resolved Hide resolved
op-node/service.go Outdated Show resolved Hide resolved
@0xfuturistic 0xfuturistic force-pushed the ctb/OptimismMintableERC20Factory-immutable branch from f8a369a to ccd6cee Compare December 20, 2023 13:04
@0xfuturistic 0xfuturistic force-pushed the ctb/OptimismMintableERC20Factory-immutable branch from 3de8d04 to 9b513d7 Compare December 20, 2023 17:04
@ajsutton ajsutton removed their request for review December 22, 2023 01:15
Copy link
Contributor

semgrep-app bot commented Dec 24, 2023

Semgrep found 1 writable-filesystem-service finding:

  • indexer/docker-compose.yml: L120

Service 'backend-goerli' is running with a writable root filesystem. This may allow malicious applications to download and run additional payloads, or modify container files. If an application inside a container has to save something temporarily consider using a tmpfs. Add 'read_only: true' to this service to prevent this.

Ignore this finding from writable-filesystem-service.

Semgrep found 1 no-new-privileges finding:

  • indexer/docker-compose.yml: L120

Service 'backend-goerli' allows for privilege escalation via setuid or setgid binaries. Add 'no-new-privileges:true' in 'security_opt' to prevent this.

Ignore this finding from no-new-privileges.

Semgrep found 1 deprecated-ioutil-readfile finding:

  • op-exporter/main.go: L146

ioutil.ReadFile is deprecated

Ignore this finding from deprecated-ioutil-readfile.

op-chain-ops/upgrades/l1.go Outdated Show resolved Hide resolved
op-chain-ops/upgrades/l1.go Outdated Show resolved Hide resolved
packages/contracts-bedrock/scripts/ChainAssertions.sol Outdated Show resolved Hide resolved
@0xfuturistic 0xfuturistic force-pushed the ctb/OptimismMintableERC20Factory-immutable branch from e68f8d1 to a15a0cd Compare December 24, 2023 13:42
@0xfuturistic 0xfuturistic self-assigned this Dec 24, 2023
@0xfuturistic 0xfuturistic force-pushed the ctb/OptimismMintableERC20Factory-immutable branch from 84614db to 35dd277 Compare January 1, 2024 18:16
@0xfuturistic 0xfuturistic force-pushed the ctb/OptimismMintableERC20Factory-immutable branch from 3995e7f to 8159854 Compare January 2, 2024 11:09
@0xfuturistic 0xfuturistic force-pushed the ctb/OptimismMintableERC20Factory-immutable branch from 95434e0 to 9eda162 Compare January 10, 2024 19:40
@tynes
Copy link
Contributor

tynes commented Jan 10, 2024

This PR looks good to me

@tynes tynes merged commit 5841705 into feat/mcp-l1 Jan 11, 2024
64 checks passed
@tynes tynes deleted the ctb/OptimismMintableERC20Factory-immutable branch January 11, 2024 00:42
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