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
30c242d9
Commit
30c242d9
authored
Jul 20, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize `FaultDisputeGame` with the current L1 head hash
parent
1888081c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
FaultDisputeGame.sol
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
+7
-4
IFaultDisputeGame.sol
...acts-bedrock/src/dispute/interfaces/IFaultDisputeGame.sol
+3
-0
No files found.
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
View file @
30c242d9
...
...
@@ -48,6 +48,9 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @inheritdoc IDisputeGame
IBondManager public bondManager;
/// @inheritdoc IFaultDisputeGame
Hash public l1Head;
/// @notice An append-only array of all claims made during the dispute game.
ClaimData[] public claimData;
...
...
@@ -243,7 +246,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @inheritdoc IFaultDisputeGame
function l2BlockNumber() public pure returns (uint256 l2BlockNumber_) {
l2BlockNumber_ = _getArgUint256(0x
4
0);
l2BlockNumber_ = _getArgUint256(0x
2
0);
}
////////////////////////////////////////////////////////////////
...
...
@@ -336,8 +339,7 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @inheritdoc IDisputeGame
function extraData() public pure returns (bytes memory extraData_) {
// The extra data starts at the third word within the cwia calldata.
// Account for the `l2BlockNumber` argument @ 0x40.
// The extra data starts at the second word within the cwia calldata.
extraData_ = _getArgDynBytes(0x20, 0x20);
}
...
...
@@ -378,7 +380,8 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
})
);
// TODO(clabby): Load the local data into the preimage oracle.
// Set the L1 head hash at the time of the game's creation.
l1Head = Hash.wrap(blockhash(block.number));
}
/// @notice Returns the length of the `claimData` array.
...
...
packages/contracts-bedrock/src/dispute/interfaces/IFaultDisputeGame.sol
View file @
30c242d9
...
...
@@ -53,6 +53,9 @@ interface IFaultDisputeGame is IDisputeGame {
bytes calldata _proof
) external;
/// @notice Returns the L1 block hash at the time of the game's creation.
function l1Head() external view returns (Hash l1Head_);
/// @notice The l2BlockNumber that the `rootClaim` commits to. The trace being bisected within
/// the game is from `l2BlockNumber - 1` -> `l2BlockNumber`.
/// @return l2BlockNumber_ The l2BlockNumber that the `rootClaim` commits to.
...
...
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