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
2cb51f6a
Unverified
Commit
2cb51f6a
authored
Jun 26, 2023
by
mergify[bot]
Committed by
GitHub
Jun 26, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into aj/fpp-debug
parents
e6e69929
d6b7236b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1187 additions
and
36 deletions
+1187
-36
Makefile
op-bindings/Makefile
+4
-0
faultdisputegame.go
op-bindings/bindings/faultdisputegame.go
+1147
-0
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+23
-23
FaultDisputeGame.sol
.../contracts-bedrock/contracts/dispute/FaultDisputeGame.sol
+9
-4
FaultDisputeGame.t.sol
...s/contracts-bedrock/contracts/test/FaultDisputeGame.t.sol
+4
-9
No files found.
op-bindings/Makefile
View file @
2cb51f6a
...
...
@@ -32,6 +32,7 @@ bindings: l1block-bindings \
basefee-vault-bindings
\
legacy-erc20-eth-bindings
\
dispute-game-factory-bindings
\
fault-dispute-game-bindings
\
standard-bridge-bindings
\
cross-domain-messenger-bindings
\
cannon-mips
\
...
...
@@ -130,6 +131,9 @@ l1-blocknumber-bindings: compile
dispute-game-factory-bindings
:
compile
./gen_bindings.sh contracts/dispute/DisputeGameFactory.sol:DisputeGameFactory
$(pkg)
fault-dispute-game-bindings
:
compile
./gen_bindings.sh contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame
$(pkg)
standard-bridge-bindings
:
compile
./gen_bindings.sh contracts/universal/StandardBridge.sol:StandardBridge
$(pkg)
...
...
op-bindings/bindings/faultdisputegame.go
0 → 100644
View file @
2cb51f6a
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/.gas-snapshot
View file @
2cb51f6a
...
...
@@ -32,30 +32,30 @@ DisputeGameFactory_SetImplementation_Test:test_setImplementation_notOwner_revert
DisputeGameFactory_SetImplementation_Test:test_setImplementation_succeeds() (gas: 44243)
DisputeGameFactory_TransferOwnership_Test:test_transferOwnership_notOwner_reverts() (gas: 15950)
DisputeGameFactory_TransferOwnership_Test:test_transferOwnership_succeeds() (gas: 18642)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas:
502842
)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 50
4699
)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot:test_resolvesCorrectly_succeeds() (gas: 4
92706
)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas:
501717
)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas:
503574
)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot:test_resolvesCorrectly_succeeds() (gas: 4
91581
)
FaultDisputeGame_Test:test_defendRoot_invalidMove_reverts() (gas: 132
50
)
FaultDisputeGame_Test:test_extraData_succeeds() (gas: 174
48
)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas:
498826
)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 50
0705
)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot:test_resolvesCorrectly_succeeds() (gas: 4
88169
)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas:
497701
)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas:
499580
)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot:test_resolvesCorrectly_succeeds() (gas: 4
87044
)
FaultDisputeGame_Test:test_defendRoot_invalidMove_reverts() (gas: 132
94
)
FaultDisputeGame_Test:test_extraData_succeeds() (gas: 174
26
)
FaultDisputeGame_Test:test_gameData_succeeds() (gas: 17873)
FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 103
37
)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 82
16
)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17
691
)
FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 264
10
)
FaultDisputeGame_Test:test_move_duplicateClaim_reverts() (gas: 1032
31
)
FaultDisputeGame_Test:test_move_gameDepthExceeded_reverts() (gas: 40
7967
)
FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 109
23
)
FaultDisputeGame_Test:test_move_nonExistentParent_reverts() (gas: 246
32
)
FaultDisputeGame_Test:test_resolve_challengeContested() (gas: 221
068
)
FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 96
57
)
FaultDisputeGame_Test:test_resolve_rootContested() (gas: 1061
20
)
FaultDisputeGame_Test:test_resolve_rootUncontested() (gas: 2362
4
)
FaultDisputeGame_Test:test_resolve_teamDeathmatch() (gas: 391
731
)
FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8
203
)
FaultDisputeGame_Test:test_simpleAttack_succeeds() (gas: 1073
22
)
FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 103
15
)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 82
38
)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17
713
)
FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 264
32
)
FaultDisputeGame_Test:test_move_duplicateClaim_reverts() (gas: 1032
75
)
FaultDisputeGame_Test:test_move_gameDepthExceeded_reverts() (gas: 40
8100
)
FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 109
68
)
FaultDisputeGame_Test:test_move_nonExistentParent_reverts() (gas: 246
98
)
FaultDisputeGame_Test:test_resolve_challengeContested() (gas: 221
135
)
FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 96
35
)
FaultDisputeGame_Test:test_resolve_rootContested() (gas: 1061
43
)
FaultDisputeGame_Test:test_resolve_rootUncontested() (gas: 2362
5
)
FaultDisputeGame_Test:test_resolve_teamDeathmatch() (gas: 391
864
)
FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8
159
)
FaultDisputeGame_Test:test_simpleAttack_succeeds() (gas: 1073
88
)
FeeVault_Test:test_constructor_succeeds() (gas: 18185)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352135)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950342)
...
...
packages/contracts-bedrock/contracts/dispute/FaultDisputeGame.sol
View file @
2cb51f6a
...
...
@@ -72,12 +72,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @inheritdoc IFaultDisputeGame
function attack(uint256 _parentIndex, Claim _pivot) external payable {
_
move(_parentIndex, _pivot, true);
move(_parentIndex, _pivot, true);
}
/// @inheritdoc IFaultDisputeGame
function defend(uint256 _parentIndex, Claim _pivot) external payable {
_
move(_parentIndex, _pivot, false);
move(_parentIndex, _pivot, false);
}
/// @inheritdoc IFaultDisputeGame
...
...
@@ -162,11 +162,11 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @param _challengeIndex The index of the claim being moved against.
/// @param _pivot The claim at the next logical position in the game.
/// @param _isAttack Whether or not the move is an attack or defense.
function
_
move(
function move(
uint256 _challengeIndex,
Claim _pivot,
bool _isAttack
)
internal
{
)
public payable
{
// Moves cannot be made unless the game is currently in progress.
if (status != GameStatus.IN_PROGRESS) {
revert GameNotInProgress();
...
...
@@ -254,6 +254,11 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
l2BlockNumber_ = _getArgUint256(0x20);
}
/// @notice Returns the length of the `claimData` array.
function claimDataLen() external view returns (uint256 len_) {
len_ = claimData.length;
}
////////////////////////////////////////////////////////////////
// `IDisputeGame` impl //
////////////////////////////////////////////////////////////////
...
...
packages/contracts-bedrock/contracts/test/FaultDisputeGame.t.sol
View file @
2cb51f6a
...
...
@@ -391,7 +391,7 @@ contract GamePlayer {
// Now, search for the index of the claim that commits to the prestate's trace
// index.
uint256 len = claimDataLen();
uint256 len =
gameProxy.
claimDataLen();
for (uint256 i = 0; i < len; i++) {
(, , , Position pos, ) = gameProxy.claimData(i);
if (Position.unwrap(pos) == Position.unwrap(statePos)) {
...
...
@@ -424,7 +424,7 @@ contract GamePlayer {
// Attack the parent claim.
gameProxy.attack(_parentIndex, ourClaim);
// Call out to our counter party to respond.
counterParty.play(claimDataLen() - 1);
counterParty.play(
gameProxy.
claimDataLen() - 1);
// If we have a second move position, attack the grandparent.
if (Position.unwrap(movePos2) != 0) {
...
...
@@ -432,22 +432,17 @@ contract GamePlayer {
Claim ourGrandparentClaim = claimAt(grandparentPos.move(true));
gameProxy.attack(grandparentIndex, ourGrandparentClaim);
counterParty.play(claimDataLen() - 1);
counterParty.play(
gameProxy.
claimDataLen() - 1);
}
} else {
// Defend the parent claim.
gameProxy.defend(_parentIndex, ourClaim);
// Call out to our counter party to respond.
counterParty.play(claimDataLen() - 1);
counterParty.play(
gameProxy.
claimDataLen() - 1);
}
}
}
/// @notice Returns the length of the claim data array.
function claimDataLen() internal view returns (uint256 len_) {
return uint256(vm.load(address(gameProxy), bytes32(uint256(1))));
}
/// @notice Returns the state at the trace index within the player's trace.
function traceAt(Position _position) public view returns (uint256 state_) {
return traceAt(_position.traceIndex(maxDepth));
...
...
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