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: cleanup predeploys solidity test #8933

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

tynes
Copy link
Contributor

@tynes tynes commented Jan 10, 2024

Description

Contributors to the smart contracts have way too many steps
to get their PR over the line. This migrates some of the check-l2
script to solidity. I believe that we can fully delete check-l2
but want to follow up in an additional PR to ensure that we have the
same functionality. Completely deleting check-l2 was unblocked by
#8911.

The functionality that is added to the solidity here was removed from
the check-l2 script.

@tynes tynes requested review from a team as code owners January 10, 2024 21:07
Copy link
Contributor

coderabbitai bot commented Jan 10, 2024

Walkthrough

Walkthrough

The recent update involves simplifying the logic for checking predeploy proxy configurations in a Go command, removing parallel checks for a more straightforward approach. In Solidity testing, new internal functions have been introduced to handle the computation of predeploy addresses, verification of predeploy status, and proxy determination. Additionally, a test function has been enhanced to verify predeploy settings and admin configurations.

Changes

File Path Change Summary
op-chain-ops/cmd/check-l2/main.go Removed parallel checking of predeploy proxy configurations; simplified proxy configuration and implementation logic.
packages/contracts-bedrock/test/Predeploys.t.sol Added internal functions for address computation and predeploy checks; updated a test function to include checks for predeploys and their admin settings.

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 Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4fc3881) 34.70% compared to head (06cc8a6) 25.80%.
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8933      +/-   ##
===========================================
- Coverage    34.70%   25.80%   -8.91%     
===========================================
  Files          165      117      -48     
  Lines         7123     4841    -2282     
  Branches      1208     1057     -151     
===========================================
- Hits          2472     1249    -1223     
+ Misses        4499     3486    -1013     
+ Partials       152      106      -46     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests ?
contracts-bedrock-tests 20.40% <ø> (ø)
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests ?
sdk-next-tests 42.08% <ø> (ø)
sdk-tests 42.08% <ø> (ø)

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

see 48 files with indirect coverage changes

Copy link
Contributor

@0xfuturistic 0xfuturistic left a comment

Choose a reason for hiding this comment

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

lgtm!

tynes added a commit that referenced this pull request Jan 10, 2024
As of #8933 and #8911
all of `check-l2` tests exist in solidity and are better. There is no
real reason to keep `check-l2` around because it just adds additional
headache.
@tynes tynes added this pull request to the merge queue Jan 10, 2024
tynes added a commit that referenced this pull request Jan 11, 2024
This is a prereq of #8942.
This will help to remove the concept of `check-l2` to help reduce the
amount of diff a developer needs to do when making changes to the
solidity code. Ideally, a solidity dev needs to touch 0 code in any
other language (besides bash ffi lolz).

After this PR as well as:
- #8933
- #8911

the functionality of `check-l2` is now completely in solidity.

Note that we are now calling the non system contracts "preinstalls"
instead of "predeploys" to denote that they do not live in the predeploy
namespace and are not critical to the functionality of the system.
They are set at deterministic addresses.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 11, 2024
@tynes tynes added this pull request to the merge queue Jan 11, 2024
tynes added 3 commits January 10, 2024 19:53
Contributors to the smart contracts have way too many steps
to get their PR over the line. This migrates some of the `check-l2`
script to solidity. I believe that we can fully delete `check-l2`
but want to follow up in an additional PR to ensure that we have the
same functionality. Completely deleting `check-l2` was unblocked by
#8911.

The functionality that is added to the solidity here was removed from
the `check-l2` script.
@tynes tynes removed this pull request from the merge queue due to a manual request Jan 11, 2024
@tynes tynes force-pushed the ctb/cleanup-l2-check branch from 9ef59df to 06cc8a6 Compare January 11, 2024 01:12
@tynes tynes enabled auto-merge January 11, 2024 01:13
@tynes tynes added this pull request to the merge queue Jan 11, 2024
Merged via the queue into develop with commit a1e846d Jan 11, 2024
67 of 68 checks passed
@tynes tynes deleted the ctb/cleanup-l2-check branch January 11, 2024 02:08
tynes added a commit that referenced this pull request Jan 11, 2024
This is a prereq of #8942.
This will help to remove the concept of `check-l2` to help reduce the
amount of diff a developer needs to do when making changes to the
solidity code. Ideally, a solidity dev needs to touch 0 code in any
other language (besides bash ffi lolz).

After this PR as well as:
- #8933
- #8911

the functionality of `check-l2` is now completely in solidity.

Note that we are now calling the non system contracts "preinstalls"
instead of "predeploys" to denote that they do not live in the predeploy
namespace and are not critical to the functionality of the system.
They are set at deterministic addresses.
0xfuturistic pushed a commit that referenced this pull request Jan 11, 2024
* contracts-bedrock: cleanup predeploys solidity test

Contributors to the smart contracts have way too many steps
to get their PR over the line. This migrates some of the `check-l2`
script to solidity. I believe that we can fully delete `check-l2`
but want to follow up in an additional PR to ensure that we have the
same functionality. Completely deleting `check-l2` was unblocked by
#8911.

The functionality that is added to the solidity here was removed from
the `check-l2` script.

* op-chain-ops: remove dead code

* op-chain-ops: fix build issue
github-merge-queue bot pushed a commit that referenced this pull request Jan 11, 2024
* contracts-bedrock: add tests for preinstalls

This is a prereq of #8942.
This will help to remove the concept of `check-l2` to help reduce the
amount of diff a developer needs to do when making changes to the
solidity code. Ideally, a solidity dev needs to touch 0 code in any
other language (besides bash ffi lolz).

After this PR as well as:
- #8933
- #8911

the functionality of `check-l2` is now completely in solidity.

Note that we are now calling the non system contracts "preinstalls"
instead of "predeploys" to denote that they do not live in the predeploy
namespace and are not critical to the functionality of the system.
They are set at deterministic addresses.

* contracts-bedrock: lint

* contracts-bedrock: lint
tynes added a commit that referenced this pull request Jan 11, 2024
As of #8933 and #8911
all of `check-l2` tests exist in solidity and are better. There is no
real reason to keep `check-l2` around because it just adds additional
headache.
github-merge-queue bot pushed a commit that referenced this pull request Jan 11, 2024
As of #8933 and #8911
all of `check-l2` tests exist in solidity and are better. There is no
real reason to keep `check-l2` around because it just adds additional
headache.
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