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 OptimismPortalInterop #10585

Merged
merged 4 commits into from
May 24, 2024

Conversation

0xfuturistic
Copy link
Member

@0xfuturistic 0xfuturistic commented May 17, 2024

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

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

coderabbitai bot commented May 17, 2024

Walkthrough

The changes involve updates to contracts in the OptimismPortal and OptimismPortalInterop files. The OptimismPortal contract now includes a transformation of the version constant into a pure virtual function returning "2.8.0" and the addition of the virtual modifier to the setGasPayingToken function. Additionally, a new contract OptimismPortalInterop has been introduced to facilitate communication between Layer 1 and Layer 2 in the Optimism network, with added methods for setting configuration options and error handling.

Changes

File Path Change Summary
packages/contracts-bedrock/src/L1/OptimismPortal.sol Converted version constant to a pure virtual function returning "2.8.0" and added virtual modifier to setGasPayingToken.
packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol Introduced OptimismPortalInterop contract with added functionality for L1-L2 message passing, including imports, error handling, overridden version function, and setConfig method.

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.

@ajsutton
Copy link
Contributor

Shouldn't we be building new functionality on OptimismPortal2 or are we deliberately doing this without fault proofs (and will have to reimplement in the future)?

@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from ae7a476 to 4485698 Compare May 20, 2024 14:40
@tynes
Copy link
Contributor

tynes commented May 20, 2024

Shouldn't we be building new functionality on OptimismPortal2 or are we deliberately doing this without fault proofs (and will have to reimplement in the future)?

We will merge portal2 and portal functionality at some point in the future, interop devnet doesn't support fault proofs

@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from 4485698 to fc40f6b Compare May 20, 2024 16:20
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from fc40f6b to d168510 Compare May 20, 2024 16:46
Copy link

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-L1BlockInterop branch 2 times, most recently from 2de9cce to e46a001 Compare May 20, 2024 17:50
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from c8c2317 to 74d7a36 Compare May 20, 2024 17:51
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from 74d7a36 to dd9d149 Compare May 20, 2024 17:59
@tynes
Copy link
Contributor

tynes commented May 20, 2024

Needs tests

@tynes
Copy link
Contributor

tynes commented May 20, 2024

Build is failing in CI

@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from dd9d149 to 19b2452 Compare May 20, 2024 18:17
@0xfuturistic 0xfuturistic self-assigned this May 22, 2024
@0xfuturistic 0xfuturistic force-pushed the feat/separate-dynamic-L1Attributes-L1Block-tests branch from 23a0917 to 85a16b9 Compare May 22, 2024 15:59
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from 3c1f376 to 358c29e Compare May 22, 2024 15:59
@0xfuturistic 0xfuturistic force-pushed the feat/separate-dynamic-L1Attributes-L1Block-tests branch from 85a16b9 to 1e61b68 Compare May 23, 2024 10:31
Base automatically changed from feat/separate-dynamic-L1Attributes-L1Block-tests to feat/interop-L1BlockInterop May 23, 2024 10:31
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from 358c29e to 24bb340 Compare May 23, 2024 10:51
@0xfuturistic 0xfuturistic force-pushed the feat/interop-L1BlockInterop branch 2 times, most recently from 6fcf17b to 6860c6f Compare May 23, 2024 10:56
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch 2 times, most recently from 840ca0e to cfc981b Compare May 23, 2024 10:58
@0xfuturistic 0xfuturistic force-pushed the feat/interop-L1BlockInterop branch 2 times, most recently from 1f3fc0a to 479bc50 Compare May 24, 2024 14:28
Base automatically changed from feat/interop-L1BlockInterop to develop May 24, 2024 15:25
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from cfc981b to f866700 Compare May 24, 2024 15:26
@0xfuturistic 0xfuturistic force-pushed the feat/interop-OptimismPortalInterop branch from b15a2b8 to dbe9a23 Compare May 24, 2024 15:30
@0xfuturistic 0xfuturistic added this pull request to the merge queue May 24, 2024
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 (60faf8b) to head (532be0d).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #10585       +/-   ##
============================================
- 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

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 24, 2024
@0xfuturistic 0xfuturistic added this pull request to the merge queue May 24, 2024
Merged via the queue into develop with commit 388bd0b May 24, 2024
69 checks passed
@0xfuturistic 0xfuturistic deleted the feat/interop-OptimismPortalInterop branch May 24, 2024 17:07
tarunkhasnavis pushed a commit that referenced this pull request May 28, 2024
* contracts-bedrock: create OptimismPortalInterop

* contracts-bedrock: update to use ConfigType.GAS_PAYING_TOKEN

* contracts-bedrock: update snapshots

* contracts-bedrock: update semver-lock
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