Commit 657333de authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #8337 from ethereum-optimism/cl/ctb/output-bisection-draft

feat(ctb): `OutputBisectionGame` draft
parents 3b29035a 20b7a7d8
This diff is collapsed.
This diff is collapsed.
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"src/dispute/BlockOracle.sol": "0x7e724b1ee0116dfd744f556e6237af449c2f40c6426d6f1462ae2a47589283bb", "src/dispute/BlockOracle.sol": "0x7e724b1ee0116dfd744f556e6237af449c2f40c6426d6f1462ae2a47589283bb",
"src/dispute/DisputeGameFactory.sol": "0xfdfa141408d7f8de7e230ff4bef088e30d0e4d569ca743d60d292abdd21ff270", "src/dispute/DisputeGameFactory.sol": "0xfdfa141408d7f8de7e230ff4bef088e30d0e4d569ca743d60d292abdd21ff270",
"src/dispute/FaultDisputeGame.sol": "0x7ac7553a47d96a4481a6b95363458bed5f160112b647829c4defc134fa178d9a", "src/dispute/FaultDisputeGame.sol": "0x7ac7553a47d96a4481a6b95363458bed5f160112b647829c4defc134fa178d9a",
"src/dispute/OutputBisectionGame.sol": "0x2415f3d3601ffce7ac92710f61180457b13c63df740ad7963a3f07b67f2b919d",
"src/legacy/DeployerWhitelist.sol": "0x0a6840074734c9d167321d3299be18ef911a415e4c471fa92af7d6cfaa8336d4", "src/legacy/DeployerWhitelist.sol": "0x0a6840074734c9d167321d3299be18ef911a415e4c471fa92af7d6cfaa8336d4",
"src/legacy/L1BlockNumber.sol": "0x20d83a636c5e2067fca8c0ed505b295174e6eddb25960d8705e6b6fea8e77fa6", "src/legacy/L1BlockNumber.sol": "0x20d83a636c5e2067fca8c0ed505b295174e6eddb25960d8705e6b6fea8e77fa6",
"src/legacy/LegacyMessagePasser.sol": "0x80f355c9710af586f58cf6a86d1925e0073d1e504d0b3d814284af1bafe4dece", "src/legacy/LegacyMessagePasser.sol": "0x80f355c9710af586f58cf6a86d1925e0073d1e504d0b3d814284af1bafe4dece",
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
"label": "mapping(uint256 => struct BlockOracle.BlockInfo)", "label": "mapping(uint256 => struct BlockOracle.BlockInfo)",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "t_mapping(t_uint256,t_struct(BlockInfo)82480_storage)" "type": "t_mapping(t_uint256,t_struct(BlockInfo)83011_storage)"
} }
] ]
\ No newline at end of file
...@@ -39,20 +39,20 @@ ...@@ -39,20 +39,20 @@
"label": "mapping(GameType => contract IDisputeGame)", "label": "mapping(GameType => contract IDisputeGame)",
"offset": 0, "offset": 0,
"slot": "101", "slot": "101",
"type": "t_mapping(t_userDefinedValueType(GameType)86527,t_contract(IDisputeGame)84201)" "type": "t_mapping(t_userDefinedValueType(GameType)88533,t_contract(IDisputeGame)86109)"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "mapping(Hash => GameId)", "label": "mapping(Hash => GameId)",
"offset": 0, "offset": 0,
"slot": "102", "slot": "102",
"type": "t_mapping(t_userDefinedValueType(Hash)86509,t_userDefinedValueType(GameId)86521)" "type": "t_mapping(t_userDefinedValueType(Hash)88515,t_userDefinedValueType(GameId)88527)"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "GameId[]", "label": "GameId[]",
"offset": 0, "offset": 0,
"slot": "103", "slot": "103",
"type": "t_array(t_userDefinedValueType(GameId)86521)dyn_storage" "type": "t_array(t_userDefinedValueType(GameId)88527)dyn_storage"
} }
] ]
\ No newline at end of file
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
"label": "mapping(string => struct Drippie.DripState)", "label": "mapping(string => struct Drippie.DripState)",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_mapping(t_string_memory_ptr,t_struct(DripState)89568_storage)" "type": "t_mapping(t_string_memory_ptr,t_struct(DripState)91574_storage)"
} }
] ]
\ No newline at end of file
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
"label": "mapping(contract IFaucetAuthModule => struct Faucet.ModuleConfig)", "label": "mapping(contract IFaucetAuthModule => struct Faucet.ModuleConfig)",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "t_mapping(t_contract(IFaucetAuthModule)90489,t_struct(ModuleConfig)90166_storage)" "type": "t_mapping(t_contract(IFaucetAuthModule)92495,t_struct(ModuleConfig)92172_storage)"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "mapping(contract IFaucetAuthModule => mapping(bytes32 => uint256))", "label": "mapping(contract IFaucetAuthModule => mapping(bytes32 => uint256))",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_mapping(t_contract(IFaucetAuthModule)90489,t_mapping(t_bytes32,t_uint256))" "type": "t_mapping(t_contract(IFaucetAuthModule)92495,t_mapping(t_bytes32,t_uint256))"
}, },
{ {
"bytes": "32", "bytes": "32",
......
...@@ -4,49 +4,49 @@ ...@@ -4,49 +4,49 @@
"label": "Timestamp", "label": "Timestamp",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "t_userDefinedValueType(Timestamp)86517" "type": "t_userDefinedValueType(Timestamp)88523"
}, },
{ {
"bytes": "1", "bytes": "1",
"label": "enum GameStatus", "label": "enum GameStatus",
"offset": 8, "offset": 8,
"slot": "0", "slot": "0",
"type": "t_enum(GameStatus)86533" "type": "t_enum(GameStatus)88539"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "contract IBondManager", "label": "contract IBondManager",
"offset": 9, "offset": 9,
"slot": "0", "slot": "0",
"type": "t_contract(IBondManager)84124" "type": "t_contract(IBondManager)86032"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "Hash", "label": "Hash",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_userDefinedValueType(Hash)86509" "type": "t_userDefinedValueType(Hash)88515"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "struct IFaultDisputeGame.ClaimData[]", "label": "struct IFaultDisputeGame.ClaimData[]",
"offset": 0, "offset": 0,
"slot": "2", "slot": "2",
"type": "t_array(t_struct(ClaimData)84338_storage)dyn_storage" "type": "t_array(t_struct(ClaimData)86246_storage)dyn_storage"
}, },
{ {
"bytes": "128", "bytes": "128",
"label": "struct IFaultDisputeGame.OutputProposals", "label": "struct IFaultDisputeGame.OutputProposals",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "t_struct(OutputProposals)84353_storage" "type": "t_struct(OutputProposals)86261_storage"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "mapping(ClaimHash => bool)", "label": "mapping(ClaimHash => bool)",
"offset": 0, "offset": 0,
"slot": "7", "slot": "7",
"type": "t_mapping(t_userDefinedValueType(ClaimHash)86513,t_bool)" "type": "t_mapping(t_userDefinedValueType(ClaimHash)88519,t_bool)"
}, },
{ {
"bytes": "32", "bytes": "32",
......
...@@ -32,6 +32,6 @@ ...@@ -32,6 +32,6 @@
"label": "struct Types.OutputProposal[]", "label": "struct Types.OutputProposal[]",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "t_array(t_struct(OutputProposal)87382_storage)dyn_storage" "type": "t_array(t_struct(OutputProposal)89388_storage)dyn_storage"
} }
] ]
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"label": "struct ResourceMetering.ResourceParams", "label": "struct ResourceMetering.ResourceParams",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_struct(ResourceParams)76287_storage" "type": "t_struct(ResourceParams)76818_storage"
}, },
{ {
"bytes": "1536", "bytes": "1536",
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
"label": "mapping(bytes32 => struct OptimismPortal.ProvenWithdrawal)", "label": "mapping(bytes32 => struct OptimismPortal.ProvenWithdrawal)",
"offset": 0, "offset": 0,
"slot": "52", "slot": "52",
"type": "t_mapping(t_bytes32,t_struct(ProvenWithdrawal)75366_storage)" "type": "t_mapping(t_bytes32,t_struct(ProvenWithdrawal)75897_storage)"
}, },
{ {
"bytes": "1", "bytes": "1",
...@@ -60,6 +60,6 @@ ...@@ -60,6 +60,6 @@
"label": "contract SuperchainConfig", "label": "contract SuperchainConfig",
"offset": 1, "offset": 1,
"slot": "53", "slot": "53",
"type": "t_contract(SuperchainConfig)76810" "type": "t_contract(SuperchainConfig)77341"
} }
] ]
\ No newline at end of file
[
{
"bytes": "8",
"label": "Timestamp",
"offset": 0,
"slot": "0",
"type": "t_userDefinedValueType(Timestamp)88523"
},
{
"bytes": "8",
"label": "Timestamp",
"offset": 8,
"slot": "0",
"type": "t_userDefinedValueType(Timestamp)88523"
},
{
"bytes": "1",
"label": "enum GameStatus",
"offset": 16,
"slot": "0",
"type": "t_enum(GameStatus)88539"
},
{
"bytes": "20",
"label": "contract IBondManager",
"offset": 0,
"slot": "1",
"type": "t_contract(IBondManager)86032"
},
{
"bytes": "32",
"label": "Hash",
"offset": 0,
"slot": "2",
"type": "t_userDefinedValueType(Hash)88515"
},
{
"bytes": "32",
"label": "struct IOutputBisectionGame.ClaimData[]",
"offset": 0,
"slot": "3",
"type": "t_array(t_struct(ClaimData)86367_storage)dyn_storage"
},
{
"bytes": "32",
"label": "mapping(ClaimHash => bool)",
"offset": 0,
"slot": "4",
"type": "t_mapping(t_userDefinedValueType(ClaimHash)88519,t_bool)"
},
{
"bytes": "32",
"label": "mapping(uint256 => uint256[])",
"offset": 0,
"slot": "5",
"type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)"
},
{
"bytes": "1",
"label": "bool",
"offset": 0,
"slot": "6",
"type": "t_bool"
}
]
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"label": "mapping(address => enum ProxyAdmin.ProxyType)", "label": "mapping(address => enum ProxyAdmin.ProxyType)",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_mapping(t_address,t_enum(ProxyType)93478)" "type": "t_mapping(t_address,t_enum(ProxyType)95484)"
}, },
{ {
"bytes": "32", "bytes": "32",
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"label": "contract AddressManager", "label": "contract AddressManager",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "t_contract(AddressManager)85016" "type": "t_contract(AddressManager)87016"
}, },
{ {
"bytes": "1", "bytes": "1",
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
"label": "mapping(address => contract AddressManager)", "label": "mapping(address => contract AddressManager)",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_mapping(t_address,t_contract(AddressManager)85016)" "type": "t_mapping(t_address,t_contract(AddressManager)87016)"
} }
] ]
\ No newline at end of file
...@@ -67,6 +67,6 @@ ...@@ -67,6 +67,6 @@
"label": "struct ResourceMetering.ResourceConfig", "label": "struct ResourceMetering.ResourceConfig",
"offset": 0, "offset": 0,
"slot": "105", "slot": "105",
"type": "t_struct(ResourceConfig)76300_storage" "type": "t_struct(ResourceConfig)76831_storage"
} }
] ]
\ No newline at end of file
This diff is collapsed.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import { IDisputeGame } from "./IDisputeGame.sol";
import "src/libraries/DisputeTypes.sol";
/// @title IOutputBisectionGame
/// @notice The interface for a fault proof backed dispute game.
interface IOutputBisectionGame is IDisputeGame {
/// @notice The `ClaimData` struct represents the data associated with a Claim.
/// @dev TODO(clabby): Add bond ID information.
struct ClaimData {
uint32 parentIndex;
bool countered;
Claim claim;
Position position;
Clock clock;
}
/// @notice Emitted when a new claim is added to the DAG by `claimant`
/// @param parentIndex The index within the `claimData` array of the parent claim
/// @param claim The claim being added
/// @param claimant The address of the claimant
event Move(uint256 indexed parentIndex, Claim indexed claim, address indexed claimant);
/// @notice Attack a disagreed upon `Claim`.
/// @param _parentIndex Index of the `Claim` to attack in the `claimData` array.
/// @param _claim The `Claim` at the relative attack position.
function attack(uint256 _parentIndex, Claim _claim) external payable;
/// @notice Defend an agreed upon `Claim`.
/// @param _parentIndex Index of the claim to defend in the `claimData` array.
/// @param _claim The `Claim` at the relative defense position.
function defend(uint256 _parentIndex, Claim _claim) external payable;
/// @notice Perform an instruction step via an on-chain fault proof processor.
/// @dev This function should point to a fault proof processor in order to execute
/// a step in the fault proof program on-chain. The interface of the fault proof
/// processor contract should adhere to the `IBigStepper` interface.
/// @param _claimIndex The index of the challenged claim within `claimData`.
/// @param _isAttack Whether or not the step is an attack or a defense.
/// @param _stateData The stateData of the step is the preimage of the claim at the given
/// prestate, which is at `_stateIndex` if the move is an attack and `_claimIndex` if
/// the move is a defense. If the step is an attack on the first instruction, it is
/// the absolute prestate of the fault proof VM.
/// @param _proof Proof to access memory nodes in the VM's merkle state tree.
function step(uint256 _claimIndex, bool _isAttack, bytes calldata _stateData, bytes calldata _proof) external;
/// @notice Posts the requested local data to the VM's `PreimageOralce`.
/// @param _ident The local identifier of the data to post.
/// @param _execLeafIdx The index of the leaf claim in an execution subgame that requires the local data for a step.
/// @param _partOffset The offset of the data to post.
function addLocalData(uint256 _ident, uint256 _execLeafIdx, uint256 _partOffset) external;
/// @notice Resolves the subgame rooted at the given claim index.
/// @dev This function must be called bottom-up in the DAG
/// A subgame is a tree of claims that has a maximum depth of 1.
/// A subgame root claims is valid if, and only if, all of its child claims are invalid.
/// At the deepest level in the DAG, a claim is invalid if there's a successful step against it.
/// @param _claimIndex The index of the subgame root claim to resolve.
function resolveClaim(uint256 _claimIndex) external payable;
/// @notice An L1 block hash that contains the disputed output root, fetched from the
/// `BlockOracle` and verified by referencing the timestamp associated with the
/// first L2 Output Proposal in the `L2OutputOracle` that contains the disputed
/// L2 block number.
function l1Head() external view returns (Hash l1Head_);
/// @notice The l2BlockNumber of the disputed output root in the `L2OutputOracle`.
function l2BlockNumber() external view returns (uint256 l2BlockNumber_);
}
...@@ -72,6 +72,14 @@ error OutOfOrderResolution(); ...@@ -72,6 +72,14 @@ error OutOfOrderResolution();
/// @notice Thrown when resolving a claim that has already been resolved. /// @notice Thrown when resolving a claim that has already been resolved.
error ClaimAlreadyResolved(); error ClaimAlreadyResolved();
/// @notice Thrown when a parent output root is attempted to be found on a claim that is in
/// the output root portion of the tree.
error ClaimAboveSplit();
/// @notice Thrown on deployment if the split depth is greater than or equal to the max
/// depth of the game.
error InvalidSplitDepth();
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// `AttestationDisputeGame` Errors // // `AttestationDisputeGame` Errors //
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment