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
cb62ae37
Commit
cb62ae37
authored
Jun 14, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add zero claim check
parent
54ece5fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+1
-1
FaultDisputeGame.sol
.../contracts-bedrock/contracts/dispute/FaultDisputeGame.sol
+5
-0
DisputeErrors.sol
...s/contracts-bedrock/contracts/libraries/DisputeErrors.sol
+5
-0
No files found.
packages/contracts-bedrock/.gas-snapshot
View file @
cb62ae37
...
@@ -38,7 +38,7 @@ FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10315)
...
@@ -38,7 +38,7 @@ FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10315)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8237)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8237)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 19522)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 19522)
FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8225)
FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8225)
FaultDisputeGame_Test:test_simpleAttack_succeeds() (gas: 1290
16
)
FaultDisputeGame_Test:test_simpleAttack_succeeds() (gas: 1290
33
)
FaultDisputeGame_Test:test_version_succeeds() (gas: 9736)
FaultDisputeGame_Test:test_version_succeeds() (gas: 9736)
FeeVault_Test:test_constructor_succeeds() (gas: 18185)
FeeVault_Test:test_constructor_succeeds() (gas: 18185)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352135)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352135)
...
...
packages/contracts-bedrock/contracts/dispute/FaultDisputeGame.sol
View file @
cb62ae37
...
@@ -132,6 +132,11 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
...
@@ -132,6 +132,11 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
revert GameNotInProgress();
revert GameNotInProgress();
}
}
// The zero hash is not a valid claim.
if (Claim.unwrap(pivot) == bytes32(0)) {
revert InvalidClaim();
}
// The only move that can be made against a root claim is an attack. This is because the
// The only move that can be made against a root claim is an attack. This is because the
// root claim commits to the entire state; Therefore, the only valid defense is to do
// root claim commits to the entire state; Therefore, the only valid defense is to do
// nothing if it is agreed with.
// nothing if it is agreed with.
...
...
packages/contracts-bedrock/contracts/libraries/DisputeErrors.sol
View file @
cb62ae37
...
@@ -39,6 +39,11 @@ error CannotDefendRootClaim();
...
@@ -39,6 +39,11 @@ error CannotDefendRootClaim();
*/
*/
error ClaimAlreadyExists();
error ClaimAlreadyExists();
/**
* @notice Thrown when a given claim is invalid (0).
*/
error InvalidClaim();
/**
/**
* @notice Thrown when an action that requires the game to be `IN_PROGRESS` is invoked when
* @notice Thrown when an action that requires the game to be `IN_PROGRESS` is invoked when
* the game is not in progress.
* the game is not in progress.
...
...
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