Skip to content

op-challenger: Make l2-eth-rpc and rollup-rpc required#10445

Merged
refcell merged 2 commits intodevelopfrom
aj/dispute-block-num
May 8, 2024
Merged

op-challenger: Make l2-eth-rpc and rollup-rpc required#10445
refcell merged 2 commits intodevelopfrom
aj/dispute-block-num

Conversation

@ajsutton
Copy link
Contributor

@ajsutton ajsutton commented May 8, 2024

Description

All trace types will require both rollup-rpc and l2-eth-rpc options going forward. rollup-rpc was already required, but not added to the NewConfig signature.

e2e tests are updated so they don't require specifying these endpoints in the WithCannon and WithAlphabet options since they're already specified by the default config.

Tests

Updated unit tests.

Metadata

ajsutton added 2 commits May 8, 2024 14:07
Add rollupEndpoint to NewConfig signature since it was already always required.
@ajsutton ajsutton requested a review from a team as a code owner May 8, 2024 04:14
@ajsutton ajsutton requested a review from trianglesphere May 8, 2024 04:14
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 8, 2024

Walkthrough

Walkthrough

The updates primarily involve modifications to configuration handling and function calls across several test and utility files. The changes introduce additional RPC parameters and streamline endpoint management by removing specific endpoint dependencies in function calls. This refactoring likely aims to enhance flexibility and maintainability of the codebase, particularly in handling different network layers and configurations within testing environments.

Changes

Files Change Summary
op-challenger/cmd/main_test.go, op-challenger/config/config.go, op-challenger/config/config_test.go, op-challenger/game/fault/trace/asterisc/executor_test.go, op-challenger/game/fault/trace/cannon/executor_test.go, op-e2e/faultproofs/precompile_test.go Updated configuration settings to include additional RPC parameters.
op-challenger/flags/flags.go Removed checks for specific flags related to L2 configurations.
op-e2e/e2eutils/challenger/helper.go, op-e2e/e2eutils/disputegame/..., op-e2e/faultproofs/... Simplified endpoint handling by removing specific endpoint parameters in function calls. Adjusted related logic in helper and test functions.
op-e2e/system_tob_test.go Modified endpoint argument handling in test function calls to streamline the configuration.

The table groups files by similar types of changes and uses ellipsis to shorten paths where detailed file paths are not crucial for understanding the scope of changes.


Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 1cfd38b and a492867.
Files selected for processing (17)
  • op-challenger/cmd/main_test.go (10 hunks)
  • op-challenger/config/config.go (4 hunks)
  • op-challenger/config/config_test.go (1 hunks)
  • op-challenger/flags/flags.go (3 hunks)
  • op-challenger/game/fault/trace/asterisc/executor_test.go (1 hunks)
  • op-challenger/game/fault/trace/cannon/executor_test.go (1 hunks)
  • op-e2e/e2eutils/challenger/helper.go (4 hunks)
  • op-e2e/e2eutils/disputegame/alphabet_helper.go (1 hunks)
  • op-e2e/e2eutils/disputegame/game_helper.go (1 hunks)
  • op-e2e/e2eutils/disputegame/output_alphabet_helper.go (1 hunks)
  • op-e2e/e2eutils/disputegame/output_cannon_helper.go (4 hunks)
  • op-e2e/faultproofs/challenge_preimage_test.go (3 hunks)
  • op-e2e/faultproofs/multi_test.go (1 hunks)
  • op-e2e/faultproofs/output_alphabet_test.go (1 hunks)
  • op-e2e/faultproofs/output_cannon_test.go (15 hunks)
  • op-e2e/faultproofs/precompile_test.go (1 hunks)
  • op-e2e/system_tob_test.go (1 hunks)
Files skipped from review due to trivial changes (3)
  • op-challenger/flags/flags.go
  • op-e2e/e2eutils/disputegame/game_helper.go
  • op-e2e/faultproofs/multi_test.go
Additional comments not posted (39)
op-e2e/e2eutils/disputegame/alphabet_helper.go (1)

20-20: LGTM! The inclusion of challenger.WithAlphabet() aligns with the PR's objectives to enforce specific configurations.

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

27-27: LGTM! The inclusion of challenger.WithAlphabet() aligns with the PR's objectives to enforce specific configurations.

op-e2e/faultproofs/challenge_preimage_test.go (3)

23-23: LGTM! The inclusion of challenger.WithAlphabet() in the test setup aligns with the PR's objectives.


41-41: LGTM! The inclusion of challenger.WithAlphabet() in the test setup aligns with the PR's objectives.


59-59: LGTM! The inclusion of challenger.WithAlphabet() in the test setup aligns with the PR's objectives.

op-challenger/game/fault/trace/asterisc/executor_test.go (1)

23-23: LGTM! The inclusion of new RPC endpoints in the configuration setup aligns with the PR's objectives and ensures the functionality of the system.

op-e2e/e2eutils/challenger/helper.go (5)

32-32: LGTM! The addition of RollupEndpoint to the EndpointProvider interface aligns with the PR's objectives to centralize endpoint management.


99-99: LGTM! The applyCannonConfig function correctly applies the cannon configuration, aligning with the PR's objectives to enforce specific configurations.


120-123: LGTM! The WithCannon function correctly applies the cannon configuration, aligning with the PR's objectives to enforce specific configurations.


127-127: LGTM! The WithAlphabet function correctly applies the alphabet configuration, aligning with the PR's objectives to enforce specific configurations.


150-154: LGTM! The NewChallengerConfig function correctly initializes the challenger configuration with default and specific settings, aligning with the PR's objectives to simplify the setup process.

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

141-143: LGTM! The inclusion of new RPC endpoints in the configuration setup aligns with the PR's objectives and ensures the functionality of the system.

op-challenger/game/fault/trace/cannon/executor_test.go (1)

28-28: LGTM! The inclusion of new RPC endpoints in the configuration setup aligns with the PR's objectives and ensures the functionality of the system.

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

188-188: LGTM! The inclusion of challenger.WithAlphabet() in the test setup aligns with the PR's objectives.

op-challenger/config/config.go (3)

162-171: Addition of RollupRpc and L2Rpc fields to the Config struct aligns with the PR objectives and is correctly implemented.


162-171: The updated NewConfig function correctly includes l2RollupRpc and l2EthRpc parameters, ensuring these are initialized as part of the configuration.


208-210: The updated Check function correctly includes validation for RollupRpc and L2Rpc, ensuring these fields are not left unconfigured.

op-challenger/config/config_test.go (1)

53-53: The updated validConfig function correctly includes validRollupRpc and validL2Rpc parameters in the NewConfig call, aligning with the new configuration requirements.

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

37-39: The updated StartChallenger function correctly includes the challenger.WithCannon option, ensuring the cannon configuration is applied.


52-54: The updated CreateHonestActor function correctly initializes the challenger configuration with the l2Node parameter, simplifying the configuration process.

op-e2e/faultproofs/output_cannon_test.go (15)

31-31: The addition of challenger.WithPrivKey(sys.Cfg.Secrets.Alice) enhances the security or specificity of the challenger configuration in tests.


88-88: Consistent enhancement in challenger configuration across test functions.


126-126: Continued improvement in challenger configuration, enhancing test robustness.


161-161: Consistent application of enhanced challenger configuration across tests.


196-196: Consistent enhancement in challenger configuration across test functions.


243-243: Continued improvement in challenger configuration, enhancing test robustness.


275-275: Consistent application of enhanced challenger configuration across tests.


328-328: Consistent enhancement in challenger configuration across test functions.


416-416: Continued improvement in challenger configuration, enhancing test robustness.


465-465: Consistent application of enhanced challenger configuration across tests.


515-515: Consistent enhancement in challenger configuration across test functions.


566-566: Continued improvement in challenger configuration, enhancing test robustness.


617-617: Consistent application of enhanced challenger configuration across tests.


707-707: Consistent enhancement in challenger configuration across test functions.


769-769: Continued improvement in challenger configuration, enhancing test robustness.

op-e2e/system_tob_test.go (1)

661-661: LGTM! The test function TestMixedWithdrawalValidity is well-structured and covers multiple scenarios effectively.

op-challenger/cmd/main_test.go (3)

55-55: Ensure that the new parameters rollupRpc and l2EthRpc are correctly utilized in the NewConfig function.


60-60: Validate the configuration to ensure that the new fields RollupRpc and L2Rpc are properly checked.


427-443: Confirm that the l2-eth-rpc flag is correctly enforced as required for the TraceTypeAlphabet.


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.

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

@codecov
Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.59%. Comparing base (1cfd38b) to head (a492867).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #10445       +/-   ##
============================================
+ Coverage    42.31%   81.59%   +39.28%     
============================================
  Files           73       10       -63     
  Lines         4838     1081     -3757     
  Branches       766        0      -766     
============================================
- Hits          2047      882     -1165     
+ Misses        2682      165     -2517     
+ Partials       109       34       -75     
Flag Coverage Δ
cannon-go-tests 81.59% <ø> (ø)
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

@ajsutton ajsutton requested review from Inphi and removed request for trianglesphere May 8, 2024 05:02
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.

Reduces so much duplication 💯

@refcell refcell added this pull request to the merge queue May 8, 2024
Merged via the queue into develop with commit 97cc1f1 May 8, 2024
@refcell refcell deleted the aj/dispute-block-num branch May 8, 2024 07:39
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