Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6837780f
Unverified
Commit
6837780f
authored
Apr 18, 2024
by
clabby
Committed by
GitHub
Apr 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(ctb): Expose ASR + mappings in FDG (#10211)
parent
3f297b65
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
328 additions
and
41 deletions
+328
-41
faultdisputegame.go
op-bindings/bindings/faultdisputegame.go
+126
-2
faultdisputegame_more.go
op-bindings/bindings/faultdisputegame_more.go
+2
-2
FPACOPS.s.sol
packages/contracts-bedrock/scripts/fpac/FPACOPS.s.sol
+15
-9
semver-lock.json
packages/contracts-bedrock/semver-lock.json
+2
-2
FaultDisputeGame.json
...ges/contracts-bedrock/snapshots/abi/FaultDisputeGame.json
+75
-0
PermissionedDisputeGame.json
...tracts-bedrock/snapshots/abi/PermissionedDisputeGame.json
+75
-0
FaultDisputeGame.json
...cts-bedrock/snapshots/storageLayout/FaultDisputeGame.json
+8
-8
PermissionedDisputeGame.json
...rock/snapshots/storageLayout/PermissionedDisputeGame.json
+8
-8
FaultDisputeGame.sol
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
+15
-10
FaultDisputeGame.t.sol
...ges/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol
+2
-0
No files found.
op-bindings/bindings/faultdisputegame.go
View file @
6837780f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
op-bindings/bindings/faultdisputegame_more.go
View file @
6837780f
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/scripts/fpac/FPACOPS.s.sol
View file @
6837780f
...
@@ -177,6 +177,15 @@ contract FPACOPS is Deploy, StdAssertions {
...
@@ -177,6 +177,15 @@ contract FPACOPS is Deploy, StdAssertions {
MIPS mips = MIPS(mustGetAddress("Mips"));
MIPS mips = MIPS(mustGetAddress("Mips"));
assertEq(address(mips.oracle()), address(oracle));
assertEq(address(mips.oracle()), address(oracle));
// Check the AnchorStateRegistry configuration.
AnchorStateRegistry asr = AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy"));
(Hash root1, uint256 l2BlockNumber1) = asr.anchors(GameTypes.CANNON);
(Hash root2, uint256 l2BlockNumber2) = asr.anchors(GameTypes.PERMISSIONED_CANNON);
assertEq(root1.raw(), cfg.faultGameGenesisOutputRoot());
assertEq(root2.raw(), cfg.faultGameGenesisOutputRoot());
assertEq(l2BlockNumber1, cfg.faultGameGenesisBlock());
assertEq(l2BlockNumber2, cfg.faultGameGenesisBlock());
// Check the FaultDisputeGame configuration.
// Check the FaultDisputeGame configuration.
FaultDisputeGame gameImpl = FaultDisputeGame(payable(address(dgfProxy.gameImpls(GameTypes.CANNON))));
FaultDisputeGame gameImpl = FaultDisputeGame(payable(address(dgfProxy.gameImpls(GameTypes.CANNON))));
assertEq(gameImpl.maxGameDepth(), cfg.faultGameMaxDepth());
assertEq(gameImpl.maxGameDepth(), cfg.faultGameMaxDepth());
...
@@ -184,6 +193,9 @@ contract FPACOPS is Deploy, StdAssertions {
...
@@ -184,6 +193,9 @@ contract FPACOPS is Deploy, StdAssertions {
assertEq(gameImpl.clockExtension().raw(), cfg.faultGameClockExtension());
assertEq(gameImpl.clockExtension().raw(), cfg.faultGameClockExtension());
assertEq(gameImpl.maxClockDuration().raw(), cfg.faultGameMaxClockDuration());
assertEq(gameImpl.maxClockDuration().raw(), cfg.faultGameMaxClockDuration());
assertEq(gameImpl.absolutePrestate().raw(), bytes32(cfg.faultGameAbsolutePrestate()));
assertEq(gameImpl.absolutePrestate().raw(), bytes32(cfg.faultGameAbsolutePrestate()));
assertEq(address(gameImpl.weth()), wethProxyAddr);
assertEq(address(gameImpl.anchorStateRegistry()), address(asr));
assertEq(address(gameImpl.vm()), address(mips));
// Check the security override yoke configuration.
// Check the security override yoke configuration.
PermissionedDisputeGame soyGameImpl =
PermissionedDisputeGame soyGameImpl =
...
@@ -195,15 +207,9 @@ contract FPACOPS is Deploy, StdAssertions {
...
@@ -195,15 +207,9 @@ contract FPACOPS is Deploy, StdAssertions {
assertEq(soyGameImpl.clockExtension().raw(), cfg.faultGameClockExtension());
assertEq(soyGameImpl.clockExtension().raw(), cfg.faultGameClockExtension());
assertEq(soyGameImpl.maxClockDuration().raw(), cfg.faultGameMaxClockDuration());
assertEq(soyGameImpl.maxClockDuration().raw(), cfg.faultGameMaxClockDuration());
assertEq(soyGameImpl.absolutePrestate().raw(), bytes32(cfg.faultGameAbsolutePrestate()));
assertEq(soyGameImpl.absolutePrestate().raw(), bytes32(cfg.faultGameAbsolutePrestate()));
assertEq(address(soyGameImpl.weth()), wethProxyAddr);
// Check the AnchorStateRegistry configuration.
assertEq(address(soyGameImpl.anchorStateRegistry()), address(asr));
AnchorStateRegistry asr = AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy"));
assertEq(address(soyGameImpl.vm()), address(mips));
(Hash root1, uint256 l2BlockNumber1) = asr.anchors(GameTypes.CANNON);
(Hash root2, uint256 l2BlockNumber2) = asr.anchors(GameTypes.PERMISSIONED_CANNON);
assertEq(root1.raw(), cfg.faultGameGenesisOutputRoot());
assertEq(root2.raw(), cfg.faultGameGenesisOutputRoot());
assertEq(l2BlockNumber1, cfg.faultGameGenesisBlock());
assertEq(l2BlockNumber2, cfg.faultGameGenesisBlock());
}
}
/// @notice Prints a review of the fault proof configuration section of the deploy config.
/// @notice Prints a review of the fault proof configuration section of the deploy config.
...
...
packages/contracts-bedrock/semver-lock.json
View file @
6837780f
...
@@ -116,8 +116,8 @@
...
@@ -116,8 +116,8 @@
"sourceCodeHash"
:
"0xc4dbd17217b63f8117f56f78c213e57dda304fee7577fe296e1d804ebe049542"
"sourceCodeHash"
:
"0xc4dbd17217b63f8117f56f78c213e57dda304fee7577fe296e1d804ebe049542"
},
},
"src/dispute/FaultDisputeGame.sol"
:
{
"src/dispute/FaultDisputeGame.sol"
:
{
"initCodeHash"
:
"0x
989b87a852a1c4f50e4fb6872b8481334c8f11281984c96db565d40e042448ef
"
,
"initCodeHash"
:
"0x
8b8be450739ffdc236e5cbad7d59140d5c1f80cfc096c75260fb7224701fa3f3
"
,
"sourceCodeHash"
:
"0x
27b900bb305c9ee2c98df3f611bee8a9408086cf95d34442c557136803cdf8c6
"
"sourceCodeHash"
:
"0x
e5bcdc2d310c46445a1f420db76225e0b5446671ba1c9a2f0b73e2a522faf967
"
},
},
"src/dispute/weth/DelayedWETH.sol"
:
{
"src/dispute/weth/DelayedWETH.sol"
:
{
"initCodeHash"
:
"0x7b6ec89eaec09e369426e73161a9c6932223bb1f974377190c3f6f552995da35"
,
"initCodeHash"
:
"0x7b6ec89eaec09e369426e73161a9c6932223bb1f974377190c3f6f552995da35"
,
...
...
packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json
View file @
6837780f
...
@@ -91,6 +91,19 @@
...
@@ -91,6 +91,19 @@
"stateMutability"
:
"nonpayable"
,
"stateMutability"
:
"nonpayable"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[],
"name"
:
"anchorStateRegistry"
,
"outputs"
:
[
{
"internalType"
:
"contract IAnchorStateRegistry"
,
"name"
:
"registry_"
,
"type"
:
"address"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[
"inputs"
:
[
{
{
...
@@ -184,6 +197,25 @@
...
@@ -184,6 +197,25 @@
"stateMutability"
:
"view"
,
"stateMutability"
:
"view"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[
{
"internalType"
:
"ClaimHash"
,
"name"
:
""
,
"type"
:
"bytes32"
}
],
"name"
:
"claims"
,
"outputs"
:
[
{
"internalType"
:
"bool"
,
"name"
:
""
,
"type"
:
"bool"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[],
"inputs"
:
[],
"name"
:
"clockExtension"
,
"name"
:
"clockExtension"
,
...
@@ -481,6 +513,25 @@
...
@@ -481,6 +513,25 @@
"stateMutability"
:
"view"
,
"stateMutability"
:
"view"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
}
],
"name"
:
"resolvedSubgames"
,
"outputs"
:
[
{
"internalType"
:
"bool"
,
"name"
:
""
,
"type"
:
"bool"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[],
"inputs"
:
[],
"name"
:
"rootClaim"
,
"name"
:
"rootClaim"
,
...
@@ -592,6 +643,30 @@
...
@@ -592,6 +643,30 @@
"stateMutability"
:
"nonpayable"
,
"stateMutability"
:
"nonpayable"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
},
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
}
],
"name"
:
"subgames"
,
"outputs"
:
[
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[],
"inputs"
:
[],
"name"
:
"version"
,
"name"
:
"version"
,
...
...
packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGame.json
View file @
6837780f
...
@@ -101,6 +101,19 @@
...
@@ -101,6 +101,19 @@
"stateMutability"
:
"nonpayable"
,
"stateMutability"
:
"nonpayable"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[],
"name"
:
"anchorStateRegistry"
,
"outputs"
:
[
{
"internalType"
:
"contract IAnchorStateRegistry"
,
"name"
:
"registry_"
,
"type"
:
"address"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[
"inputs"
:
[
{
{
...
@@ -207,6 +220,25 @@
...
@@ -207,6 +220,25 @@
"stateMutability"
:
"view"
,
"stateMutability"
:
"view"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[
{
"internalType"
:
"ClaimHash"
,
"name"
:
""
,
"type"
:
"bytes32"
}
],
"name"
:
"claims"
,
"outputs"
:
[
{
"internalType"
:
"bool"
,
"name"
:
""
,
"type"
:
"bool"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[],
"inputs"
:
[],
"name"
:
"clockExtension"
,
"name"
:
"clockExtension"
,
...
@@ -517,6 +549,25 @@
...
@@ -517,6 +549,25 @@
"stateMutability"
:
"view"
,
"stateMutability"
:
"view"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
}
],
"name"
:
"resolvedSubgames"
,
"outputs"
:
[
{
"internalType"
:
"bool"
,
"name"
:
""
,
"type"
:
"bool"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[],
"inputs"
:
[],
"name"
:
"rootClaim"
,
"name"
:
"rootClaim"
,
...
@@ -628,6 +679,30 @@
...
@@ -628,6 +679,30 @@
"stateMutability"
:
"nonpayable"
,
"stateMutability"
:
"nonpayable"
,
"type"
:
"function"
"type"
:
"function"
},
},
{
"inputs"
:
[
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
},
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
}
],
"name"
:
"subgames"
,
"outputs"
:
[
{
"internalType"
:
"uint256"
,
"name"
:
""
,
"type"
:
"uint256"
}
],
"stateMutability"
:
"view"
,
"type"
:
"function"
},
{
{
"inputs"
:
[],
"inputs"
:
[],
"name"
:
"version"
,
"name"
:
"version"
,
...
...
packages/contracts-bedrock/snapshots/storageLayout/FaultDisputeGame.json
View file @
6837780f
...
@@ -20,6 +20,13 @@
...
@@ -20,6 +20,13 @@
"slot"
:
"0"
,
"slot"
:
"0"
,
"type"
:
"enum GameStatus"
"type"
:
"enum GameStatus"
},
},
{
"bytes"
:
"1"
,
"label"
:
"initialized"
,
"offset"
:
17
,
"slot"
:
"0"
,
"type"
:
"bool"
},
{
{
"bytes"
:
"32"
,
"bytes"
:
"32"
,
"label"
:
"claimData"
,
"label"
:
"claimData"
,
...
@@ -55,18 +62,11 @@
...
@@ -55,18 +62,11 @@
"slot"
:
"5"
,
"slot"
:
"5"
,
"type"
:
"mapping(uint256 => bool)"
"type"
:
"mapping(uint256 => bool)"
},
},
{
"bytes"
:
"1"
,
"label"
:
"initialized"
,
"offset"
:
0
,
"slot"
:
"6"
,
"type"
:
"bool"
},
{
{
"bytes"
:
"64"
,
"bytes"
:
"64"
,
"label"
:
"startingOutputRoot"
,
"label"
:
"startingOutputRoot"
,
"offset"
:
0
,
"offset"
:
0
,
"slot"
:
"
7
"
,
"slot"
:
"
6
"
,
"type"
:
"struct OutputRoot"
"type"
:
"struct OutputRoot"
}
}
]
]
\ No newline at end of file
packages/contracts-bedrock/snapshots/storageLayout/PermissionedDisputeGame.json
View file @
6837780f
...
@@ -20,6 +20,13 @@
...
@@ -20,6 +20,13 @@
"slot"
:
"0"
,
"slot"
:
"0"
,
"type"
:
"enum GameStatus"
"type"
:
"enum GameStatus"
},
},
{
"bytes"
:
"1"
,
"label"
:
"initialized"
,
"offset"
:
17
,
"slot"
:
"0"
,
"type"
:
"bool"
},
{
{
"bytes"
:
"32"
,
"bytes"
:
"32"
,
"label"
:
"claimData"
,
"label"
:
"claimData"
,
...
@@ -55,18 +62,11 @@
...
@@ -55,18 +62,11 @@
"slot"
:
"5"
,
"slot"
:
"5"
,
"type"
:
"mapping(uint256 => bool)"
"type"
:
"mapping(uint256 => bool)"
},
},
{
"bytes"
:
"1"
,
"label"
:
"initialized"
,
"offset"
:
0
,
"slot"
:
"6"
,
"type"
:
"bool"
},
{
{
"bytes"
:
"64"
,
"bytes"
:
"64"
,
"label"
:
"startingOutputRoot"
,
"label"
:
"startingOutputRoot"
,
"offset"
:
0
,
"offset"
:
0
,
"slot"
:
"
7
"
,
"slot"
:
"
6
"
,
"type"
:
"struct OutputRoot"
"type"
:
"struct OutputRoot"
}
}
]
]
\ No newline at end of file
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
View file @
6837780f
...
@@ -62,8 +62,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
...
@@ -62,8 +62,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
Position internal constant ROOT_POSITION = Position.wrap(1);
Position internal constant ROOT_POSITION = Position.wrap(1);
/// @notice Semantic version.
/// @notice Semantic version.
/// @custom:semver 0.1
6.1
/// @custom:semver 0.1
7.0
string public constant version = "0.1
6.1
";
string public constant version = "0.1
7.0
";
/// @notice The starting timestamp of the game
/// @notice The starting timestamp of the game
Timestamp public createdAt;
Timestamp public createdAt;
...
@@ -74,23 +74,23 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
...
@@ -74,23 +74,23 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
/// @inheritdoc IDisputeGame
/// @inheritdoc IDisputeGame
GameStatus public status;
GameStatus public status;
/// @notice Flag for the `initialize` function to prevent re-initialization.
bool internal initialized;
/// @notice An append-only array of all claims made during the dispute game.
/// @notice An append-only array of all claims made during the dispute game.
ClaimData[] public claimData;
ClaimData[] public claimData;
/// @notice Credited balances for winning participants.
/// @notice Credited balances for winning participants.
mapping(address => uint256) public credit;
mapping(address => uint256) public credit;
/// @notice A
n internal
mapping to allow for constant-time lookups of existing claims.
/// @notice A mapping to allow for constant-time lookups of existing claims.
mapping(ClaimHash => bool)
internal
claims;
mapping(ClaimHash => bool)
public
claims;
/// @notice A
n internal
mapping of subgames rooted at a claim index to other claim indices in the subgame.
/// @notice A mapping of subgames rooted at a claim index to other claim indices in the subgame.
mapping(uint256 => uint256[])
internal
subgames;
mapping(uint256 => uint256[])
public
subgames;
/// @notice An interneal mapping of resolved subgames rooted at a claim index.
/// @notice An interneal mapping of resolved subgames rooted at a claim index.
mapping(uint256 => bool) internal resolvedSubgames;
mapping(uint256 => bool) public resolvedSubgames;
/// @notice Flag for the `initialize` function to prevent re-initialization.
bool internal initialized;
/// @notice The latest finalized output root, serving as the anchor for output bisection.
/// @notice The latest finalized output root, serving as the anchor for output bisection.
OutputRoot public startingOutputRoot;
OutputRoot public startingOutputRoot;
...
@@ -715,6 +715,11 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
...
@@ -715,6 +715,11 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
weth_ = WETH;
weth_ = WETH;
}
}
/// @notice Returns the anchor state registry contract.
function anchorStateRegistry() external view returns (IAnchorStateRegistry registry_) {
registry_ = ANCHOR_STATE_REGISTRY;
}
/// @notice Returns the chain ID of the L2 network this contract argues about.
/// @notice Returns the chain ID of the L2 network this contract argues about.
function l2ChainId() external view returns (uint256 l2ChainId_) {
function l2ChainId() external view returns (uint256 l2ChainId_) {
l2ChainId_ = L2_CHAIN_ID;
l2ChainId_ = L2_CHAIN_ID;
...
...
packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol
View file @
6837780f
...
@@ -70,6 +70,8 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
...
@@ -70,6 +70,8 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
assertEq(gameProxy.splitDepth(), 2 ** 2);
assertEq(gameProxy.splitDepth(), 2 ** 2);
assertEq(gameProxy.clockExtension().raw(), 3 hours);
assertEq(gameProxy.clockExtension().raw(), 3 hours);
assertEq(gameProxy.maxClockDuration().raw(), 3.5 days);
assertEq(gameProxy.maxClockDuration().raw(), 3.5 days);
assertEq(address(gameProxy.weth()), address(delayedWeth));
assertEq(address(gameProxy.anchorStateRegistry()), address(anchorStateRegistry));
assertEq(address(gameProxy.vm()), address(_vm));
assertEq(address(gameProxy.vm()), address(_vm));
// Label the proxy
// Label the proxy
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment