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

op-challenger: Asterisc Support with Refactoring #10094

Conversation

pcw109550
Copy link
Contributor

@pcw109550 pcw109550 commented Apr 10, 2024

TL; DR: Implemented op-challenger for asterisc with refactoring. Only unit test is passing. E2E tests will be implemented at asterisc repo.

Description

op-challenger provides a wrapper with FPVM binary, and it only supported cannon to play dispute game, providing traces. This PR adds a wrapper with yet another FPVM, asterisc.

Initial implementation(#10030) of op-challenger for asterisc had some duplicated codes, and even cyclic dependency from the nature that asterisc is maintained at separate repository.

This PR removes asterisc dependencies (removing code duplicates) by asking asterisc binary to already include the witness and stateHash in the state json. Related asterisc fixes: ethereum-optimism/asterisc#37, ethereum-optimism/asterisc#36. These FPVM fixes may be also added to cannon, to decouple FPVM and the challenger. It is FPVM's job to provide correct witness and stateHash.

I tried to avoid duplicate codes by exporting cannon tracer methods as much as possible. These shared logics can be refactored out. op-challenger for cannon is currently running on testnet, and I wanted to avoid code changes for cannon in this PR.

Refactoring Suggestion

FPVM abstraction

FPVM maintains its state, and witness and stateHash. In the FPVM state, step, PC, Exited will be always be included, whatever FPVM we choose. Therefore, we may use below struct to parse state json from any FPVM.

type VMState struct {
	PC        uint64   `json:"pc"`
	Exited    bool     `json:"exited"`
	Step      uint64   `json:"step"`
	Witness   []byte   `json:"witness"`
	StateHash [32]byte `json:"stateHash"`
}

Upper fields are the only required data to perform op-challenger logic. I was able to implement asterisc tracer based on upper fields.

op-challenger can perform basic validation of this data. It can check the witness length since this may be differ by the VM type. Also, we may validate exitCode which is included at StateHash.

Metricer

Current Metricer interface requires RecordCannonExecutionTime() and RecordAsteriscExecutionTime() to be implemented. I first thought to refactor these methods to RecordFPVMExecutionTime(), but it may break compatibility for prometheus.

Flags

Most of the flags for asterisc binary is duplicated from cannon: (See ethereum-optimism/asterisc#8), and we may think all the duplicated flag codes(op-challenger/flags/flags.go) are unnecessary. However, I thought these flags are not included in the specs, so they are subject to change.

Tests

Unit tests for asterisc tracer is added. Basic flag sanity checking unit test is added.

There are no e2e tests added! These will be added to asterisc. Will refer to output_cannon_test.go.

To add more details about why e2e is implemented at asterisc, asterisc is expected to be maintained at separate repository. Asterisc pulls the monorepo(here!)

Summary by CodeRabbit

  • New Features

    • Added support for Asterisc trace type configurations and flags.
    • Introduced a new game type, Asterisc, in the system.
    • Implemented functionality to parse and validate Asterisc VM states.
    • Added creation and access capabilities for traces related to the Asterisc fault type.
    • Introduced new metrics to record execution times for Asterisc operations.
  • Refactor

    • Renamed several functions and data structures for consistency and clarity in the Cannon trace type modules.
  • Bug Fixes

    • Updated test functions to properly handle new configurations and fault types.
  • Documentation

    • Updated method and variable declarations to include new configurations and functionalities for Asterisc.

Copy link
Contributor

coderabbitai bot commented Apr 10, 2024

Walkthrough

Walkthrough

The recent updates focus on integrating and enhancing support for the Asterisc trace type within the Optimism protocol's testing and configuration frameworks. These changes include adding new configurations, flags, and metrics specific to Asterisc, updating existing utilities, and introducing new testing and execution files for both Asterisc and Cannon trace types. The goal is to enhance the flexibility and capability of handling different trace types and network configurations efficiently.

Changes

Files Changes
op-challenger/cmd/main_test.go, op-challenger/config/config.go, op-challenger/config/config_test.go, op-challenger/flags/flags.go, op-challenger/game/fault/register.go, op-challenger/metrics/metrics.go, op-challenger/metrics/noop.go, op-dispute-mon/mon/extract/caller.go, op-dispute-mon/mon/extract/caller_test.go Added and updated configurations, flags, and metrics for Asterisc trace type. Included new game type registration and updated test cases for fault extraction.
op-challenger/game/fault/trace/asterisc/executor.go, op-challenger/game/fault/trace/asterisc/provider.go, op-challenger/game/fault/trace/outputs/output_asterisc.go, op-challenger/game/fault/trace/asterisc/executor_test.go, op-challenger/game/fault/trace/asterisc/provider_test.go Introduced new files and functionalities for Asterisc trace handling, including data retrieval, proof generation, and testing.
op-challenger/game/fault/trace/cannon/executor.go, op-challenger/game/fault/trace/cannon/provider.go, op-challenger/game/fault/trace/cannon/executor_test.go Updated naming conventions and function calls for consistency in Cannon trace handling.
op-challenger/game/fault/types/types.go, op-service/ioutil/gzip.go Added a new game type constant for Asterisc and a function for gzip compression.
op-challenger/game/fault/trace/utils/..., op-e2e/faultproofs/..., op-e2e/e2eutils/... Renamed packages and updated utilities for proof handling across different trace types, reflecting the broader use of shared utilities.
docs/fault-proof-alpha/run-challenger.md, op-challenger/README.md, op-e2e/e2eutils/challenger/helper.go Updated documentation and helper configurations to reflect changes in command-line arguments and internal configurations.

This summary highlights the significant changes, emphasizing the integration and enhancement of the Asterisc trace type, along with updates to existing functionalities and documentation to support the evolving requirements of the Optimism protocol.


Recent Review Details

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between d2263b1 and a6d8361.
Files ignored due to path filters (5)
  • op-challenger/game/fault/trace/asterisc/test_data/invalid.json is excluded by !**/*.json
  • op-challenger/game/fault/trace/asterisc/test_data/proofs/0.json is excluded by !**/*.json
  • op-challenger/game/fault/trace/asterisc/test_data/proofs/1.json is excluded by !**/*.json
  • op-challenger/game/fault/trace/asterisc/test_data/proofs/2.json is excluded by !**/*.json
  • op-challenger/game/fault/trace/asterisc/test_data/state.json is excluded by !**/*.json
Files selected for processing (38)
  • docs/fault-proof-alpha/run-challenger.md (1 hunks)
  • op-challenger/README.md (1 hunks)
  • op-challenger/cmd/main_test.go (8 hunks)
  • op-challenger/config/config.go (8 hunks)
  • op-challenger/config/config_test.go (3 hunks)
  • op-challenger/flags/flags.go (11 hunks)
  • op-challenger/game/fault/register.go (5 hunks)
  • op-challenger/game/fault/trace/asterisc/executor.go (1 hunks)
  • op-challenger/game/fault/trace/asterisc/executor_test.go (1 hunks)
  • op-challenger/game/fault/trace/asterisc/prestate.go (1 hunks)
  • op-challenger/game/fault/trace/asterisc/prestate_test.go (1 hunks)
  • op-challenger/game/fault/trace/asterisc/provider.go (1 hunks)
  • op-challenger/game/fault/trace/asterisc/provider_test.go (1 hunks)
  • op-challenger/game/fault/trace/asterisc/state.go (1 hunks)
  • op-challenger/game/fault/trace/asterisc/state_test.go (1 hunks)
  • op-challenger/game/fault/trace/cannon/executor.go (5 hunks)
  • op-challenger/game/fault/trace/cannon/executor_test.go (6 hunks)
  • op-challenger/game/fault/trace/cannon/prestate_test.go (1 hunks)
  • op-challenger/game/fault/trace/cannon/provider.go (7 hunks)
  • op-challenger/game/fault/trace/cannon/provider_test.go (7 hunks)
  • op-challenger/game/fault/trace/outputs/output_asterisc.go (1 hunks)
  • op-challenger/game/fault/trace/outputs/output_cannon.go (3 hunks)
  • op-challenger/game/fault/trace/utils/executor.go (1 hunks)
  • op-challenger/game/fault/trace/utils/local.go (1 hunks)
  • op-challenger/game/fault/trace/utils/local_test.go (1 hunks)
  • op-challenger/game/fault/trace/utils/preimage.go (4 hunks)
  • op-challenger/game/fault/trace/utils/preimage_test.go (8 hunks)
  • op-challenger/game/fault/trace/utils/provider.go (1 hunks)
  • op-challenger/game/fault/types/types.go (1 hunks)
  • op-challenger/metrics/metrics.go (4 hunks)
  • op-challenger/metrics/noop.go (1 hunks)
  • op-dispute-mon/mon/extract/caller.go (1 hunks)
  • op-dispute-mon/mon/extract/caller_test.go (1 hunks)
  • op-e2e/e2eutils/challenger/helper.go (1 hunks)
  • op-e2e/e2eutils/disputegame/output_cannon_helper.go (4 hunks)
  • op-e2e/faultproofs/output_cannon_test.go (4 hunks)
  • op-e2e/faultproofs/precompile_test.go (3 hunks)
  • op-service/ioutil/gzip.go (1 hunks)
Files skipped from review as they are similar to previous changes (34)
  • op-challenger/cmd/main_test.go
  • op-challenger/config/config_test.go
  • op-challenger/flags/flags.go
  • op-challenger/game/fault/register.go
  • op-challenger/game/fault/trace/asterisc/executor.go
  • op-challenger/game/fault/trace/asterisc/executor_test.go
  • op-challenger/game/fault/trace/asterisc/prestate.go
  • op-challenger/game/fault/trace/asterisc/prestate_test.go
  • op-challenger/game/fault/trace/asterisc/provider.go
  • op-challenger/game/fault/trace/asterisc/provider_test.go
  • op-challenger/game/fault/trace/asterisc/state.go
  • op-challenger/game/fault/trace/asterisc/state_test.go
  • op-challenger/game/fault/trace/cannon/executor.go
  • op-challenger/game/fault/trace/cannon/executor_test.go
  • op-challenger/game/fault/trace/cannon/prestate_test.go
  • op-challenger/game/fault/trace/cannon/provider.go
  • op-challenger/game/fault/trace/cannon/provider_test.go
  • op-challenger/game/fault/trace/outputs/output_asterisc.go
  • op-challenger/game/fault/trace/outputs/output_cannon.go
  • op-challenger/game/fault/trace/utils/executor.go
  • op-challenger/game/fault/trace/utils/local.go
  • op-challenger/game/fault/trace/utils/local_test.go
  • op-challenger/game/fault/trace/utils/preimage.go
  • op-challenger/game/fault/trace/utils/preimage_test.go
  • op-challenger/game/fault/trace/utils/provider.go
  • op-challenger/metrics/metrics.go
  • op-challenger/metrics/noop.go
  • op-dispute-mon/mon/extract/caller.go
  • op-dispute-mon/mon/extract/caller_test.go
  • op-e2e/e2eutils/challenger/helper.go
  • op-e2e/e2eutils/disputegame/output_cannon_helper.go
  • op-e2e/faultproofs/output_cannon_test.go
  • op-e2e/faultproofs/precompile_test.go
  • op-service/ioutil/gzip.go
Additional Context Used
LanguageTool (62)
docs/fault-proof-alpha/run-challenger.md (25)

Near line 3: This sentence does not start with an uppercase letter.
Context: ... Running op-challenger op-challenger is a program that implements the honest ac...


Near line 7: Possible spelling mistake found.
Context: ...- The cannon pre-state downloaded from Goerli deployment. -...


Near line 7: Possible spelling mistake found.
Context: ...state downloaded from Goerli deployment. - An account on the Goerli testnet wi...


Near line 8: Possible spelling mistake found.
Context: ...oyments.md#goerli). - An account on the Goerli testnet with funds available. The amoun...


Near line 8: Possible spelling mistake found.
Context: ....md#goerli). - An account on the Goerli testnet with funds available. The amount of GöE...


Near line 8: Possible spelling mistake found.
Context: ...net with funds available. The amount of GöETH required depends on the number of claim...


Near line 10: Possible spelling mistake found.
Context: ...0.01 ETH should be plenty to start. - A Goerli L1 node. - An archive node is not r...


Near line 14: Possible spelling mistake found.
Context: ... rate limits for free plans. - An OP-Goerli L2 archive node with debug APIs enabl...


Near line 16: Possible missing comma found.
Context: ... Public RPC providers are generally not usable as they don’t support the debug_dbGet...


Near line 16: Possible spelling mistake found.
Context: ...ly not usable as they don’t support the debug_dbGet RPC method. - Approximately 3.5Gb of d...


Near line 23: This sentence does not start with an uppercase letter.
Context: ...e set to concrete values: - <L1_URL> the Goerli L1 JSON RPC endpoint - `<DISPUTE...


Near line 23: Possible spelling mistake found.
Context: ...t to concrete values: - <L1_URL> the Goerli L1 JSON RPC endpoint - `<DISPUTE_GAME_F...


Near line 25: Possible spelling mistake found.
Context: ...spute game factory contract (see the [Goerli deployment details](./deployments.md#go...


Near line 25: Possible spelling mistake found.
Context: ...ct (see the Goerli deployment details) - <PRESTATE> the prestate.json down...


Near line 26: Possible spelling mistake found.
Context: ...md#goerli)) - <PRESTATE> the prestate.json downloaded above. Note that this needs ...


Near line 26: The verb ‘prestate’ does not usually follow articles like ‘the’. Check that ‘prestate’ is spelled correctly; using ‘prestate’ as a noun may be non-standard.
Context: ...Note that this needs to precisely match the prestate used on-chain so must be the download...


Near line 27: Possible spelling mistake found.
Context: ...d not a version built locally (see the [Goerli deployment details](./deployments.md#go...


Near line 27: Possible spelling mistake found.
Context: ...ally (see the Goerli deployment details) - <L2_URL> the OP-Goerli L2 archive...


Near line 28: Possible spelling mistake found.
Context: ...eployments.md#goerli)) - <L2_URL> the OP-Goerli L2 archive node JSON RPC endpoint - `<P...


Near line 29: Possible spelling mistake found.
Context: ...VATE_KEY>` the private key for a funded Goerli account. For other ways to specify the ...


Near line 54: Did you mean: “By default,”?
Context: ...Y> ``` ### Restricting Games to Play By default op-challenger will generate traces an...


Near line 56: Possible spelling mistake found.
Context: ...pute game factory contract. On a public testnet like Goerli, that could be a large numb...


Near line 56: Possible spelling mistake found.
Context: ...tory contract. On a public testnet like Goerli, that could be a large number of games,...


Near line 56: Specify a number, remove phrase, or simply use “many” or “numerous”
Context: ...blic testnet like Goerli, that could be a large number of games, requiring significant CPU and di...


Near line 57: Possible spelling mistake found.
Context: ... of games for it to respond to with the --game-allowlist option. ```bash ./op-challenger/bin/o...

op-challenger/README.md (37)

Near line 3: Possible spelling mistake found.
Context: ...op-stack challenge agent written in golang for dispute games including, but not li...


Near line 4: Put a space after the comma.
Context: ...pute games including, but not limited to,attestation games, fault games, and validity games....


Near line 10: Possible spelling mistake found.
Context: ...experimental/fault-proof/index.html ## Quickstart To build the op-challenger, run `mak...


Near line 18: This sentence does not start with an uppercase letter.
Context: ...ger --help. ## Usage op-challenger` is configurable via command line flags and...


Near line 22: Possible spelling mistake found.
Context: ...elp. ### Running with Cannon on Local Devnet To run op-challenger` against the loc...


Near line 24: Possible spelling mistake found.
Context: ...o run op-challenger against the local devnet, first clean and run the devnet from th...


Near line 25: Possible spelling mistake found.
Context: ...e local devnet, first clean and run the devnet from the root of the repository. ```she...


Near line 53: Possible spelling mistake found.
Context: ...m-confirmations 1 ``` The mnemonic and hd-path above is a prefunded address on the dev...


Near line 53: Possible spelling mistake found.
Context: ...ath above is a prefunded address on the devnet. The challenger will monitor dispute ga...


Near line 58: Possible spelling mistake found.
Context: ... to create and interact with games. ## Subcommands The op-challenger has a few subcomma...


Near line 60: Possible spelling mistake found.
Context: ...commands The op-challenger has a few subcommands to interact with on-chain fault dispute...


Near line 61: Possible spelling mistake found.
Context: ... with on-chain fault dispute games. The subcommands support game creation, performing game ...


Near line 65: This sentence does not start with an uppercase letter.
Context: ...provide convenient manual testing. ### create-game ```shell ./bin/op-challenger create-ga...


Near line 81: This sentence does not start with an uppercase letter.
Context: ...factory contract on L1. * OUTPUT_ROOT a hex encoded 32 byte hash that is used a...


Near line 82: This sentence does not start with an uppercase letter.
Context: ... proposed output root. * L2_BLOCK_NUM the L2 block number the proposed output roo...


Near line 83: This sentence does not start with an uppercase letter.
Context: ...ed output root is from. * SIGNER_ARGS the remaining args are past as arguments to...


Near line 83: Possible spelling mistake found.
Context: ... is from. * SIGNER_ARGS the remaining args are past as arguments to cast when se...


Near line 83: Please check whether ‘passed’ (paste tense of ‘to pass’) might be the correct word here instead of ‘past’ (past times).
Context: ... * SIGNER_ARGS the remaining args are past as arguments to cast when sending t...


Near line 84: Possible typo: you repeated a whitespace
Context: ...ay for cast to sign the transactions. See cast send --help for supported opt...


Near line 90: This sentence does not start with an uppercase letter.
Context: ... the cannon trace type by default. ### move The move subcommand can be run with ...


Near line 92: Possible spelling mistake found.
Context: ... type by default. ### move The move subcommand can be run with either the --attack o...


Near line 110: This sentence does not start with an uppercase letter.
Context: ... the type of move to make. * attack indicates that the state hash in your local canno...


Near line 112: This sentence does not start with an uppercase letter.
Context: ...luded in the latest claim. * defend indicates that the state hash in your local canno...


Near line 114: Possible typo: you repeated a whitespace
Context: ...at will be countered by this new claim. The special value of latest will count...


Near line 117: This sentence does not start with an uppercase letter.
Context: ...-claim you are posting. * SIGNER_ARGS the remaining args are past as arguments to...


Near line 117: Possible spelling mistake found.
Context: ... posting. * SIGNER_ARGS the remaining args are past as arguments to cast when se...


Near line 117: Please check whether ‘passed’ (paste tense of ‘to pass’) might be the correct word here instead of ‘past’ (past times).
Context: ... * SIGNER_ARGS the remaining args are past as arguments to cast when sending tra...


Near line 117: Possible typo: you repeated a whitespace
Context: ...ts to cast when sending transactions. These arguments must specify a way for `...


Near line 118: Possible typo: you repeated a whitespace
Context: ...ay for cast to sign the transactions. See cast send --help for supported opt...


Near line 121: This sentence does not start with an uppercase letter.
Context: ...end --help` for supported options. ### resolve ```shell ./bin/op-challenger resolve ...


Near line 136: This sentence does not start with an uppercase letter.
Context: ...ispute game to resolve. * SIGNER_ARGS the remaining args are past as arguments to...


Near line 136: Possible spelling mistake found.
Context: ... resolve. * SIGNER_ARGS the remaining args are past as arguments to cast when se...


Near line 136: Please check whether ‘passed’ (paste tense of ‘to pass’) might be the correct word here instead of ‘past’ (past times).
Context: ... * SIGNER_ARGS the remaining args are past as arguments to cast when sending tra...


Near line 136: Possible typo: you repeated a whitespace
Context: ...ts to cast when sending transactions. These arguments must specify a way for `...


Near line 137: Possible typo: you repeated a whitespace
Context: ...ay for cast to sign the transactions. See cast send --help for supported opt...


Near line 140: This sentence does not start with an uppercase letter.
Context: ...end --help` for supported options. ### list-games ```shell ./bin/op-challenger list-game...


Near line 153: This sentence does not start with an uppercase letter.
Context: ...spute game factory contract on L1. ### list-claims ```shell ./bin/op-challenger list-game...

Additional comments not posted (7)
docs/fault-proof-alpha/run-challenger.md (1)

48-48: Update the command-line argument to --l2-rpc to align with the new configuration.

op-challenger/README.md (1)

47-47: Update the command-line argument to --l2-rpc to align with the new configuration.

op-challenger/game/fault/types/types.go (1)

21-21: Add the new constant AsteriscGameType to support the integration of the Asterisc FPVM.

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

38-47: Ensure all new error variables related to Asterisc configuration are correctly defined and grouped together for better readability.


55-55: Add TraceTypeAsterisc to the list of trace types to support the new Asterisc configuration.


59-59: Include TraceTypeAsterisc in the TraceTypes array to ensure it is recognized as a valid trace type.


246-289: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [136-285]

Add Asterisc-specific configuration fields and ensure they are validated correctly in the Check method to prevent runtime errors due to misconfiguration.


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.

@pcw109550
Copy link
Contributor Author

@coderabbitai review

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

op-challenger/cmd/main_test.go Outdated Show resolved Hide resolved
@pcw109550 pcw109550 marked this pull request as ready for review April 10, 2024 07:18
@pcw109550 pcw109550 requested a review from a team as a code owner April 10, 2024 07:18
@pcw109550 pcw109550 force-pushed the tip/pcw109550/op-challenger-asterisc-refactor branch from 68b3a2a to c24ac9b Compare April 15, 2024 21:58
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.

Looking very good. Mostly nits, a few minor fixes.

@pcw109550 pcw109550 force-pushed the tip/pcw109550/op-challenger-asterisc-refactor branch from 583736a to ceb1b24 Compare April 17, 2024 19:34
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.

Changes look great! Last conversations to resolve then we should be good to merge

@pcw109550 pcw109550 force-pushed the tip/pcw109550/op-challenger-asterisc-refactor branch from f8d9d5b to 838d7d6 Compare April 17, 2024 20:29
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

@pcw109550 pcw109550 requested a review from refcell April 17, 2024 21:54
@pcw109550
Copy link
Contributor Author

@refcell I removed asterisc's trace provider dependency of cannon by creating new utils module. Also fixed nits(commits, style issues) and added suggested tests.

@pcw109550 pcw109550 force-pushed the tip/pcw109550/op-challenger-asterisc-refactor branch from 291454f to a6d8361 Compare April 19, 2024 18:22
@pcw109550 pcw109550 requested a review from ajsutton April 19, 2024 21:46
@pcw109550
Copy link
Contributor Author

pcw109550 commented Apr 19, 2024

@ajsutton No problem. I have gone back to having separate options again. Added tests. Also manually checked that the binary works like below.
If we provide both flags: --l2-rpc and --cannon-l2.

./bin/op-challenger  --l2-rpc 2 --cannon-l2 3 ...
CRIT [04-19|15:48:34.828] Application failed                       err="failed to setup: flag cannon-l2 and l2-rpc must not be both set"

If both are not provided,

CRIT [04-19|15:52:17.435] Application failed                       err="failed to setup: flag l2-rpc is required"

If at least one between --l2-rpc and --cannon-l2 is provided, it works fine.

@ajsutton ajsutton added this pull request to the merge queue Apr 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 21, 2024
@ajsutton ajsutton added this pull request to the merge queue Apr 22, 2024
Merged via the queue into ethereum-optimism:develop with commit c38ce09 Apr 22, 2024
68 checks passed
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