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: update L1BlockInterop #10584

Merged
merged 11 commits into from
May 24, 2024
Merged

Conversation

0xfuturistic
Copy link
Member

@0xfuturistic 0xfuturistic commented May 17, 2024

L1BlockInterop is updated according to the updates to the specs. This PR implements the L1BlockInterop, L1Block changes from #10452, which was closed in support of smaller PRs

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

coderabbitai bot commented May 17, 2024

Walkthrough

The recent updates bring significant enhancements to the contracts-bedrock package, focusing on improving interop dependency management, error handling, and configuration settings. Key changes include the integration of EnumerableSet, new error and event definitions, and refined functions for handling gas-paying tokens and dependencies. Additionally, new encoding functions and tests have been added to ensure robust functionality and interoperability within the L2 system.

Changes

File Path Change Summary
L1BlockInterop.sol Added EnumerableSet, ConfigType enum, new error types and events, refactored functions for dependency management and configuration updates.
differential-testing.go, utils.go Added cases and functions for encoding gas-paying tokens and dependencies with parsing and encoding logic.
L1Block.sol Imported L1BlockErrors.sol and removed NotDepositor() error declaration.
L1BlockErrors.sol Introduced error definitions for depositor accounts, chain IDs, and interop dependency sets.
StaticConfig.sol Updated functions for encoding and decoding static configuration data, reflecting a shift to setting gas-paying tokens.
StaticConfig.t.sol Added testing utilities for encoding/decoding gas-paying tokens and dependencies using the StaticConfig contract.
FFIInterface.sol Added functions for encoding token and dependency data.
L2Genesis.s.sol Added conditional logic in setL1Block for handling different scenarios based on cfg.useInterop().

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 requested review from tynes and removed request for mds1 May 17, 2024 17:36
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Out of diff range and nitpick comments (1)
packages/contracts-bedrock/src/L2/L1BlockInterop.sol (1)

5-6: Consider documenting the purpose of the new imports.

Adding comments to explain why EnumerableSetLib and GasPayingToken are imported could improve code readability and maintainability.

packages/contracts-bedrock/src/L2/L1BlockInterop.sol Outdated Show resolved Hide resolved
@0xfuturistic 0xfuturistic force-pushed the feat/interop-L1BlockInterop branch 2 times, most recently from 704c556 to ffe58a6 Compare May 20, 2024 16:20
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

packages/contracts-bedrock/src/L2/L1BlockInterop.sol Outdated Show resolved Hide resolved
@0xfuturistic 0xfuturistic changed the base branch from develop to feat/interop-StaticConfigLib May 20, 2024 17:07
@0xfuturistic 0xfuturistic force-pushed the feat/interop-L1BlockInterop branch 5 times, most recently from ff7bc14 to a293c9e Compare May 20, 2024 18:16
@tynes
Copy link
Contributor

tynes commented May 20, 2024

Needs tests but code structure is good

@0xfuturistic
Copy link
Member Author

Needs tests but code structure is good

@tynes tests are in this PR: #10571

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

@0xfuturistic 0xfuturistic force-pushed the feat/interop-create-StaticConfigLib.sol branch from ad2107f to 4b1c1a8 Compare May 23, 2024 10:17
@0xfuturistic 0xfuturistic force-pushed the feat/interop-L1BlockInterop branch 4 times, most recently from 6fcf17b to 6860c6f Compare May 23, 2024 10:56
@0xfuturistic 0xfuturistic force-pushed the feat/interop-create-StaticConfigLib.sol branch from 4b1c1a8 to 227998d Compare May 24, 2024 13:35
Base automatically changed from feat/interop-create-StaticConfigLib.sol to develop May 24, 2024 14:17
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 (7c0661e) to head (f82a2f0).
Report is 1 commits behind head on develop.

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

@0xfuturistic 0xfuturistic added this pull request to the merge queue May 24, 2024
Merged via the queue into develop with commit 60faf8b May 24, 2024
69 checks passed
@0xfuturistic 0xfuturistic deleted the feat/interop-L1BlockInterop branch May 24, 2024 15:25
tarunkhasnavis pushed a commit that referenced this pull request May 28, 2024
* contracts-bedrock: create diff tests for StaticConfig

* contracts-bedrock: refactor encodeGasPayingToken

* contracts-bedrock: define uint256Type for differential testing

* contracts-bedrock: fix missing line in differential-testing

* contracts-bedrock: return packed in utils

* contracts-bedrock: define args as global vars in differential-testing

* contracts-bedrock: improve args for encodeGasPayingToken in diff testing

* contracts-bedrock: update L1BlockInterop

* contracts-bedrock: remove duplicates in differential-testing

* contracts-bedrock: use SET_GAS_PAYING_TOKEN in L1BlockInterop

* 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

2 participants