feat(op-proposer): support creating ZKDisputeGame #255
+5,146
−39
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
When we use ZK fault proof, we need the op-proposer component to adapt to the new process, submit ZKDisputeGame to the disputeGameFactory, and thereby submit the outputRoot to the L1 chain.
Rationale
When the relevant flag is configured, the process of submitting a new
ZKDisputeGame
will begin. This process will first find the appropriate parent game through thedisputeGameFactory
contract, then obtain a sufficient number of outputRoots, construct the corresponding data, and call thecreateZkFaultDisputeGame
method of thedisputeGameFactory
contract to create a new ZKDisputeGame.Example
To start a new process for submitting ZKDisputeGame, the following configuration is required:
We have some optional configurations:
--zk-proposal-batch-size: controls the number of blocks covered by a game, default value is 3,600
--zk-proposal-step-size: controls the block height interval between obtaining two outputRoots, the default value is 3
--zk-proposal-parent-game-address: we can specify the address of the parent game, forcing the op-proposer to use it to continue creating sub-games after startup.
--zk-proposal-last-game-cache-path: we can specify the address of a cache file, so that when the op-proposer restarts, it can read the cache file to continue creating sub-games from the last submitted game before the restart.
Changes
Notable changes: