Skip to content

op-chain-ops: delete dead code#10266

Merged
tynes merged 5 commits intodevelopfrom
cleanup/chain-ops-dead-code
Apr 23, 2024
Merged

op-chain-ops: delete dead code#10266
tynes merged 5 commits intodevelopfrom
cleanup/chain-ops-dead-code

Conversation

@tynes
Copy link
Contributor

@tynes tynes commented Apr 23, 2024

Description

This commit includes the deletion of a bunch of dead code
after #10106
has been merged. There is no need to maintain a bunch of custom
go code to generate the L2 genesis anymore, all of that is handled
directly in solidity.

This commit includes the deletion of a bunch of dead code
after #10106
has been merged. There is no need to maintain a bunch of custom
go code to generate the L2 genesis anymore, all of that is handled
directly in solidity.
@tynes tynes requested a review from a team as a code owner April 23, 2024 05:09
@tynes tynes requested a review from ajsutton April 23, 2024 05:09
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 23, 2024

Walkthrough

Walkthrough

The recent updates focus on refining the configuration and operational aspects of the Ethereum-based system. Key changes include the removal of certain configurations and imports, enhancements in genesis block setup for precompile addresses, and adjustments in end-to-end testing utilities. These modifications streamline operations, enhance testing frameworks, and adjust the handling of precompile balances and cryptographic operations.

Changes

Files Changes
op-chain-ops/genesis/config.go
op-chain-ops/genesis/layer_one.go
- Streamlined genesis configuration by removing unused imports and functions.
- Enhanced genesis block setup by adding functions to manage accounts and precompile balances.
op-e2e/e2eutils/disputegame/helper.go
op-e2e/e2eutils/disputegame/output_cannon_helper.go
- Simplified import statements.
- Introduced new cryptographic operations and modified key initialization.
op-e2e/faultproofs/output_alphabet_test.go - Updated address references in test scenarios to reflect new testing structure.

Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between c956771 and 8586433.
Files selected for processing (5)
  • op-chain-ops/genesis/config.go (2 hunks)
  • op-chain-ops/genesis/layer_one.go (2 hunks)
  • op-e2e/e2eutils/disputegame/helper.go (3 hunks)
  • op-e2e/e2eutils/disputegame/output_cannon_helper.go (2 hunks)
  • op-e2e/faultproofs/output_alphabet_test.go (2 hunks)
Additional comments not posted (8)
op-chain-ops/genesis/layer_one.go (4)

20-23: The constant PrecompileCount is well-defined and clearly documented.


101-106: The function CreateAccountNotExists correctly checks if an account exists before creating it. This prevents unnecessary account creation, which is a good practice.


108-114: The function FundDevAccounts efficiently uses CreateAccountNotExists to ensure accounts are created before being funded. This modular approach enhances code reusability and maintainability.


116-124: The function SetPrecompileBalances sets a balance of one wei for precompile addresses, which is an optimization for cheaper calls. The use of CreateAccountNotExists here is appropriate to ensure accounts are initialized properly.

op-e2e/faultproofs/output_alphabet_test.go (1)

121-121: The update to use disputegame.TestAddress for credit calculation in TestOutputAlphabetGame_ReclaimBond aligns with the changes described in the summary. Ensure that disputegame.TestAddress is correctly initialized and accessible in this context.

op-e2e/e2eutils/disputegame/helper.go (1)

121-121: The update to initialize opts with TestKey in NewFactoryHelper is consistent with the removal of the old import and the addition of new cryptographic operations. Ensure that TestKey is correctly handled and secure in this context.

op-e2e/e2eutils/disputegame/output_cannon_helper.go (1)

227-227: The update to use TestKey in createCannonTraceProvider is consistent with the changes described in the summary. Ensure that TestKey is securely handled and that its usage here does not introduce any security vulnerabilities.

op-chain-ops/genesis/config.go (1)

Line range hint 1-1: File config.go reviewed. The removal of imports and deletion of functions NewL2ImmutableConfig and NewL2StorageConfig align with the PR's objectives to remove dead code. Ensure that no other parts of the codebase are adversely affected by these removals.


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.

@tynes
Copy link
Contributor Author

tynes commented Apr 23, 2024

After this PR is merged, we will be able to delete all of the _more.go files and reduce half of the diff when opening a PR that includes a contracts source change, the abigen bindings still will cause a diff, op-e2e and potentially other small packages still depend on op-bindings/bindings but all of the major services no longer depend on op-bindings

@codecov
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.29%. Comparing base (c956771) to head (8586433).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #10266       +/-   ##
============================================
+ Coverage    42.40%   82.29%   +39.89%     
============================================
  Files           73       10       -63     
  Lines         4830     1073     -3757     
  Branches       766        0      -766     
============================================
- Hits          2048      883     -1165     
+ Misses        2676      159     -2517     
+ Partials       106       31       -75     
Flag Coverage Δ
cannon-go-tests 82.29% <ø> (ø)
chain-mon-tests ?
common-ts-tests ?
contracts-ts-tests ?
core-utils-tests ?
sdk-tests ?

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

see 63 files with indirect coverage changes

Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

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

Small nit but not a blocker

Co-authored-by: refcell <abigger87@gmail.com>
@tynes tynes enabled auto-merge April 23, 2024 15:47
@tynes tynes added this pull request to the merge queue Apr 23, 2024
Merged via the queue into develop with commit 613e5dc Apr 23, 2024
@tynes tynes deleted the cleanup/chain-ops-dead-code branch April 23, 2024 16:46
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