On-chain Dispute Resolution
If you've successfully performed fast-track migration, you do not need to follow the steps on this page.
Kailua's on-chain dispute mechanism is powered by its own custom contracts that define a novel ZK dispute game. Each rollup has to deploy its own set of dispute resolution contracts, and this section will guide you through that process.
The commands below will be using Foundry's forge and cast utilities, which you should have installed as part of the
foundry prerequisite.
The below foundry commands expect both a parameter that determines the wallet to use and the rpc endpoint of the parent
chain.
You will have to add these two parameters manually to every command below.
For more information, refer to forge create --help, cast call --help, and cast send --help
First, change your working directory to crates/contracts/foundry for forge to work:
cd crates/contracts/foundry
The parameters used to deploy the contracts below are immutable. Any changes will require redeployment and reconfiguration.
KailuaVerifier
This contract can safely be deployed behind a proxy contract in order to allow for easy updates to the verification configuration.
Deployment
Deployment of this contract is via the command below:
forge create KailuaVerifier --constructor-args \
[YOUR_RISC_ZERO_VERIFIER] \
[YOUR_FPVM_IMAGE_ID] \
[YOUR_ROLLUP_CONFIG_HASH] \
[YOUR_LOCK_EXPIRY_TIME] \
[YOUR_LOCK_ACTIVATION_DELAY_TIME]
Deploying the contract successfully should yield similar output to the following:
Deployer: [YOUR_DEPLOYER_WALLET_ADDRESS]
Deployed to: [YOUR_DEPLOYED_KAILUA_VERIFIER_CONTRACT]
Transaction hash: [YOUR_DEPLOYMENT_TRANSACTION_HASH]
Take note of the contract address since we'll need it later.
KailuaTreasury
constructor(
KailuaVerifier _kailuaVerifier,
uint64 _proposalOutputCount,
uint64 _outputBlockSpan,
GameType _gameType,
OptimismPortal2 _optimismPortal,
Claim _rootClaim,
uint64 _l2BlockNumber
)
This contract stores the collateral bonds required for proposers to publish their proposal, and also stores the first sequencing proposal for Kailua as a fault dispute game in your rollup.
Each published proposal on the L1 will cover proposalOutputCount × outputBlockSpan L2 blocks, and require
publication of proposalOutputCount 32-byte commitments on the DA layer.
Anchor Point
First, you will need to choose the rollup block number from which Kailua sequencing should start.
Then, you need to query your op-node for the outputRoot at that block number as follows:
cast rpc --rpc-url [YOUR_OP_NODE_ADDRESS] \
"optimism_outputAtBlock" \
$(cast 2h [YOUR_STARTING_L2_BLOCK_NUMBER])
Deployment
Deployment of this contract is via the command below:
forge create KailuaTreasury --constructor-args \
[YOUR_DEPLOYED_KAILUA_VERIFIER_CONTRACT] \
[YOUR_PROPOSAL_OUTPUT_COUNT] \
[YOUR_OUTPUT_BLOCK_SPAN] \
[YOUR_KAILUA_GAME_TYPE] \
[YOUR_OPTIMISM_PORTAL] \
[YOUR_OUTPUT_ROOT_CLAIM] \
[YOUR_L2_BLOCK_NUMBER]
Deploying the contract successfully should yield similar output to the following:
Deployer: [YOUR_DEPLOYER_WALLET_ADDRESS]
Deployed to: [YOUR_DEPLOYED_TREASURY_CONTRACT]
Transaction hash: [YOUR_DEPLOYMENT_TRANSACTION_HASH]
Take note of the contract address since we'll need it later.
If your rollup owner account is controlled by a Safe contract, or some other multi-sig contract, you can use
cast calldata to get the necessary input that your wallet contract should forward.
KailuaGame
constructor(
IKailuaTreasury _kailuaTreasury,
uint256 _genesisTimeStamp,
uint256 _l2BlockTime,
Duration _maxClockDuration
)
This contract is used by the optimism DisputeGameFactory to instantiate every Kailua sequencing proposal after the
initial one in the KailuaTreasury.
Deployment is fairly similar to the treasury via the command below:
forge create KailuaGame --evm-version cancun --constructor-args \
[YOUR_DEPLOYED_TREASURY_CONTRACT] \
[YOUR_GENESIS_TIMESTAMP] \
[YOUR_BLOCK_TIME] \
[YOUR_MAX_CLOCK_DURATION]
Deploying the contract successfully should yield similar output to the following:
Deployer: [YOUR_DEPLOYER_WALLET_ADDRESS]
Deployed to: [YOUR_DEPLOYED_GAME_CONTRACT]
Transaction hash: [YOUR_DEPLOYMENT_TRANSACTION_HASH]
Note down this contract's address, we'll use it later.