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

feat/interop: create SystemConfigInterop #10586

Merged
merged 32 commits into from
May 24, 2024

Conversation

0xfuturistic
Copy link
Contributor

@0xfuturistic 0xfuturistic commented May 17, 2024

SystemConfigInterop is created per the specs and SystemConfig is updated such that SystemConfigInterop can successfully inherit from it. This PR implements the SystemConfigInterop, SystemConfig changes from #10452, which was closed in support of smaller PRs

@0xfuturistic 0xfuturistic requested a review from tynes May 17, 2024 17:37
@0xfuturistic 0xfuturistic requested a review from a team as a code owner May 17, 2024 17:37
Copy link
Contributor

coderabbitai bot commented May 17, 2024

Walkthrough

The updates primarily involve refactoring the version constant into a function across several contracts, adding virtual modifiers to specific functions, and introducing new interop contracts (OptimismPortalInterop and SystemConfigInterop) that extend existing contracts to enhance functionality for handling configurations and interoperability between Layer 1 and Layer 2 in the Optimism network.

Changes

File Path Change Summary
.../contracts-bedrock/src/L1/OptimismPortal.sol Converted version constant to a function; added virtual to setGasPayingToken.
.../contracts-bedrock/src/L1/OptimismPortalInterop.sol Introduced OptimismPortalInterop contract; added Unauthorized error, version override, and setConfig function.
.../contracts-bedrock/src/L1/SystemConfig.sol Changed version to a function; made _setGasPayingToken internal and virtual.
.../contracts-bedrock/src/L1/SystemConfigInterop.sol Added SystemConfigInterop contract; included new functions and errors for managing L1 configuration and interop.
.../contracts-bedrock/scripts/Deploy.s.sol Updated deployment logic to conditionally deploy SystemConfig or SystemConfigInterop based on configuration.
.../contracts-bedrock/test/kontrol/scripts/run-kontrol.sh Modified test list array: added one test case, removed two related to OptimismPortal2Kontrol.
.../contracts-bedrock/test/kontrol/proofs/utils/DeploymentSummary.sol Updated systemConfigAddress constant value.
.../contracts-bedrock/test/kontrol/proofs/utils/DeploymentSummaryFaultProofs.sol Updated systemConfigAddress constant value.
.../contracts-bedrock/test/vendor/Initializable.t.sol Modified assertion in Initializer_Test contract related to the number of initializable contracts.

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/schema.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.

@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from b27ee75 to ae7a476 Compare May 17, 2024 18:42
@0xfuturistic 0xfuturistic requested review from 0x00101010, zhwrd, mslipper and a team as code owners May 20, 2024 14:13
@0xfuturistic 0xfuturistic force-pushed the feat/interop-SystemConfigInterop branch from 60ad2a8 to 9daefe1 Compare May 20, 2024 14:40
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from ae7a476 to 4485698 Compare May 20, 2024 14:40
Copy link
Contributor

semgrep-app bot commented May 20, 2024

Semgrep found 2 sol-style-return-arg-fmt findings:

  • packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol
  • packages/contracts-bedrock/src/L1/OptimismPortal.sol

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

@0xfuturistic 0xfuturistic force-pushed the feat/interop-SystemConfigInterop branch from 9daefe1 to 75c4005 Compare May 20, 2024 16:19
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch 2 times, most recently from fc40f6b to d168510 Compare May 20, 2024 16:46
@0xfuturistic 0xfuturistic force-pushed the feat/interop-SystemConfigInterop branch from 75c4005 to 3763ead Compare May 20, 2024 16:46
Copy link
Contributor

semgrep-app bot commented May 20, 2024

Semgrep found 3 sol-style-return-arg-fmt findings:

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from d168510 to c8c2317 Compare May 20, 2024 17:43
@0xfuturistic 0xfuturistic force-pushed the feat/interop-SystemConfigInterop branch from b10043c to 0361ae6 Compare May 20, 2024 17:43
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch 2 times, most recently from 74d7a36 to dd9d149 Compare May 20, 2024 17:59
@tynes
Copy link
Contributor

tynes commented May 20, 2024

Generally looks good but needs tests

@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from dd9d149 to 19b2452 Compare May 20, 2024 18:17
@0xfuturistic 0xfuturistic force-pushed the feat/interop-SystemConfigInterop branch from 8a7280f to 6fe0a99 Compare May 24, 2024 18:11
Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.26%. Comparing base (4c3f63d) to head (ce73cb5).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #10586       +/-   ##
============================================
- Coverage    55.13%   39.26%   -15.88%     
============================================
  Files           37       27       -10     
  Lines         2900     1821     -1079     
  Branches       415      415               
============================================
- Hits          1599      715      -884     
+ Misses        1269     1106      -163     
+ Partials        32        0       -32     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests 27.14% <ø> (ø)
sdk-tests 40.27% <ø> (ø)

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

see 10 files with indirect coverage changes

@tynes tynes added this pull request to the merge queue May 24, 2024
@tynes tynes removed this pull request from the merge queue due to a manual request May 24, 2024
@tynes tynes enabled auto-merge May 24, 2024 20:03
@0xfuturistic 0xfuturistic disabled auto-merge May 24, 2024 20:45
@0xfuturistic 0xfuturistic enabled auto-merge May 24, 2024 20:45
@0xfuturistic 0xfuturistic force-pushed the feat/interop-SystemConfigInterop branch from 53b8899 to 3a93b1c Compare May 24, 2024 20:46
…c-L1Attributes-SystemConfigInterop-tests

feat/interop: add tests for `SystemConfigInterop`
@0xfuturistic 0xfuturistic force-pushed the feat/interop-SystemConfigInterop branch from 3a93b1c to ce73cb5 Compare May 24, 2024 21:11
@0xfuturistic 0xfuturistic added this pull request to the merge queue May 24, 2024
Merged via the queue into develop with commit abe39e9 May 24, 2024
69 checks passed
@0xfuturistic 0xfuturistic deleted the feat/interop-SystemConfigInterop branch May 24, 2024 21:51
tarunkhasnavis pushed a commit that referenced this pull request May 28, 2024
* contracts-bedrock: create OptimismPortalInterop

* contracts-bedrock: add conditional deployment of SystemConfigInterop

* contracts-bedrock: drop initializeOptimismPortalInterop in Deploy script

* contracts-bedrock: remove checkSystemConfigInterop from ChainAssertions

* contracts-bedrock: drop initializeSystemConfigInterop in Deploy script

* contracts-bedrock: drop deploySystemConfigInterop from Deploy script

* contracts-bedrock: drop SystemConfigInterop from Types

* contracts-bedrock: drop legacy import in ChainAssertions

* contracts-bedrock: drop legacy fields in Deploy script

* contracts-bedrock: drop unnecessary diffs

* contracts-bedrock: add conditional deployment of SystemConfigInterop

* contracts-bedrock: drop initializeOptimismPortalInterop in Deploy script

* contracts-bedrock: create tests for SystemConfigInterop

* contracts-bedrock: reorder dependencies in tests for SystemConfigInterop

* contracts-bedrock: add SystemConfigInterop to tests Setup

* contracts-bedrock: update tests for SystemConfigInterop

* contracts-bedrock: restore Deploy script

* contracts-bedrock: restore ChainAssertions

* contracts-bedrock: restore Types

* contracts-bedrock: drop SystemConfigInterop from Setup script

* contracts-bedrock: update SystemConfigInterop

* contracts-bedrock: add not vm check in SystemConfigInterop tests

* contracts-bedrock: update tests for SystemConfigInterop

* contracts-bedrock: define internal getter for systemConfigInterop in tests

* contracts-bedrock: restrict visibility of function in tests for SystemConfig

* contracts-bedrock: fix tests for SystemConfigInterop

* contracts-bedrock: fix tests for SystemConfigInterop

* contracts-bedrock: reinitialize for gas paying test for SystemConfigInterop

* contracts-bedrock: reorder functions in tests for SystemConfigInterop

* contracts-bedrock: use ConfigType.GAS_PAYING_TOKEN in tests for SystemConfigInterop

* contracts-bedrock: use assumeNotForgeAddress in tests for SystemConfigInterop

---------

Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
rdovgan pushed a commit to rdovgan/optimism that referenced this pull request Jun 24, 2024
* contracts-bedrock: create OptimismPortalInterop

* contracts-bedrock: add conditional deployment of SystemConfigInterop

* contracts-bedrock: drop initializeOptimismPortalInterop in Deploy script

* contracts-bedrock: remove checkSystemConfigInterop from ChainAssertions

* contracts-bedrock: drop initializeSystemConfigInterop in Deploy script

* contracts-bedrock: drop deploySystemConfigInterop from Deploy script

* contracts-bedrock: drop SystemConfigInterop from Types

* contracts-bedrock: drop legacy import in ChainAssertions

* contracts-bedrock: drop legacy fields in Deploy script

* contracts-bedrock: drop unnecessary diffs

* contracts-bedrock: add conditional deployment of SystemConfigInterop

* contracts-bedrock: drop initializeOptimismPortalInterop in Deploy script

* contracts-bedrock: create tests for SystemConfigInterop

* contracts-bedrock: reorder dependencies in tests for SystemConfigInterop

* contracts-bedrock: add SystemConfigInterop to tests Setup

* contracts-bedrock: update tests for SystemConfigInterop

* contracts-bedrock: restore Deploy script

* contracts-bedrock: restore ChainAssertions

* contracts-bedrock: restore Types

* contracts-bedrock: drop SystemConfigInterop from Setup script

* contracts-bedrock: update SystemConfigInterop

* contracts-bedrock: add not vm check in SystemConfigInterop tests

* contracts-bedrock: update tests for SystemConfigInterop

* contracts-bedrock: define internal getter for systemConfigInterop in tests

* contracts-bedrock: restrict visibility of function in tests for SystemConfig

* contracts-bedrock: fix tests for SystemConfigInterop

* contracts-bedrock: fix tests for SystemConfigInterop

* contracts-bedrock: reinitialize for gas paying test for SystemConfigInterop

* contracts-bedrock: reorder functions in tests for SystemConfigInterop

* contracts-bedrock: use ConfigType.GAS_PAYING_TOKEN in tests for SystemConfigInterop

* contracts-bedrock: use assumeNotForgeAddress in tests for SystemConfigInterop

---------

Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
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.

2 participants