feat(op-challenger): support ZKDisputeGame #260
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Modify op-challenger to support the ZKDisputeGame type. The op-challenger will monitor the ZKDisputeGame created by the on-chain factory contract and verify its legitimacy. If the claim made by the game is illegal, it will initiate a challenge. At the same time, it will also respond to malicious challenges.
Rationale
The op-challenger will interact with the zk proof generation program coded in Rust and use the zk proof to perform some actions. (The part interacting with the Rust program is not yet completed and is currently mocked.)
Example
Based on the existing startup flags, this PR adds the following flags:
--zk-dispute-game: Indicates that the zk-dispute-game type is enabled on the current chain for op-challenger
--zk-challenge-by-proof: Indicates that op-challenger should initiate challenges using zk proof
--zk-response-challenge-by-proof: Indicates that op-challenger should respond to malicious challenges
--zk-response-challenge-claimants: If this flag is set, op-challenger will only respond to malicious challenges for the address specified by the flag.
When enabling
--zk-dispute-game
, you should also set--trace-type=zk
to ensure the program runs correctly.Changes
Notable changes: