Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface IFaultDisputeGame is IDisputeGame {

error AlreadyInitialized();
error AnchorRootNotFound();
error BadExtraData();
error BlockNumberMatches();
error BondTransferFailed();
error CannotDefendRootClaim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface IPermissionedDisputeGame is IDisputeGame {

error AlreadyInitialized();
error AnchorRootNotFound();
error BadExtraData();
error BlockNumberMatches();
error BondTransferFailed();
error CannotDefendRootClaim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ interface ISuperFaultDisputeGame is IDisputeGame {

error AlreadyInitialized();
error AnchorRootNotFound();
error BadExtraData();
error BondTransferFailed();
error CannotDefendRootClaim();
error ClaimAboveSplit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface ISuperPermissionedDisputeGame is IDisputeGame {

error AlreadyInitialized();
error AnchorRootNotFound();
error BadExtraData();
error BondTransferFailed();
error CannotDefendRootClaim();
error ClaimAboveSplit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,11 @@
"name": "AnchorRootNotFound",
"type": "error"
},
{
"inputs": [],
"name": "BadExtraData",
"type": "error"
},
{
"inputs": [],
"name": "BlockNumberMatches",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,11 @@
"name": "BadAuth",
"type": "error"
},
{
"inputs": [],
"name": "BadExtraData",
"type": "error"
},
{
"inputs": [],
"name": "BlockNumberMatches",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,11 @@
"name": "AnchorRootNotFound",
"type": "error"
},
{
"inputs": [],
"name": "BadExtraData",
"type": "error"
},
{
"inputs": [],
"name": "BondTransferFailed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,11 @@
"name": "BadAuth",
"type": "error"
},
{
"inputs": [],
"name": "BadExtraData",
"type": "error"
},
{
"inputs": [],
"name": "BondTransferFailed",
Expand Down
20 changes: 10 additions & 10 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"sourceCodeHash": "0xb1264c7af50b6134c98cb82d1ffc7891adf97068fa7048ee70992fb94bc15bd1"
},
"src/L1/OPContractsManagerStandardValidator.sol:OPContractsManagerStandardValidator": {
"initCodeHash": "0x4c9b9f7888ce14a672dae0f24af9cf20627b1629b5075a364ad17f4db0d06a70",
"sourceCodeHash": "0xb65ed0b9cc62c13a053f1b416792802269be37409df917c31e1140f064cf1073"
"initCodeHash": "0x4bf3bbdaf08989de57408b2ea88995e2f477b98add164dbf82e0dceb01417ef6",
"sourceCodeHash": "0x36861c793b247f4922ecd77b1b153a0f2a47a129117fbe59e7e1f6498ef46c42"
},
"src/L1/OptimismPortal2.sol:OptimismPortal2": {
"initCodeHash": "0x785b09610b2da65d248b49150fafc85b8369c921ddae95b0ea45608b1ce5cbc6",
Expand Down Expand Up @@ -156,20 +156,20 @@
"sourceCodeHash": "0x1871aaeba0658f17270190cc95ffff172d92dca795d698401ec34a7462bf5242"
},
"src/dispute/FaultDisputeGame.sol:FaultDisputeGame": {
"initCodeHash": "0x9748700f873b6fe0599f9674a4c2dfbc9e35bbc918ebd2f7c54f709b1480df36",
"sourceCodeHash": "0xe6d4bdbfb05491164f203f1c5542a7ba961a20727a5b706b393f4f886ba5f901"
"initCodeHash": "0xe7d3c982532946d196d7efadb9e2576c76b8f9e0d1f885ac36977d6f3fb72a65",
"sourceCodeHash": "0x63222e6926c8dd050d1adc0e65039c42382f269c3b0e113751d79e7a5167b7ac"
},
"src/dispute/PermissionedDisputeGame.sol:PermissionedDisputeGame": {
"initCodeHash": "0x1018dcbe7714a80a33dd8ad09bcc533dc6cbe1e97d2a17d3780887d406fc46a8",
"sourceCodeHash": "0x09455fe79619e63a08244647dca734fa58e96352fe21aeb289cc467437389125"
"initCodeHash": "0xefa478f976e55eb53fcccf653b202bc2532781230f20013450ce0845b77d815c",
"sourceCodeHash": "0x335a503a4cc02dd30d88d163393680f3fd89168e0faa4fa4b0ae5da399656f91"
},
"src/dispute/SuperFaultDisputeGame.sol:SuperFaultDisputeGame": {
"initCodeHash": "0x687bde7b8632b47dc16530cc523946e4109e023f0d32c9bf0281b51f412f0f0d",
"sourceCodeHash": "0x7dd3852f6b744ddfb08699bf2d201eba92314ef70c9c62c06d84b0baac5f0299"
"initCodeHash": "0xe7591ef9c806c236d78ed4b83e81701732e0fe2237d3d455d26f054aefcc54b6",
"sourceCodeHash": "0x089f457ecaa85379bcdb4b843a2b2db9616d87f957f7964de23f80e7655d3f53"
},
"src/dispute/SuperPermissionedDisputeGame.sol:SuperPermissionedDisputeGame": {
"initCodeHash": "0x9c954076097eb80f70333a387f12ba190eb9374aebb923ce30ecfe1d17030cc0",
"sourceCodeHash": "0x9baa0f9e744cc0ecc61d0fade8bffc18321b228833ea0904dc645f3975be9ed1"
"initCodeHash": "0x615baee73b605785025893fad655f8b7d8d546d77fbeca1f799000513ded3309",
"sourceCodeHash": "0x8fdd69d4bcd33a3d8b49a73ff5b6855f9ad5f7e2b7393e67cd755973b127b1e8"
},
"src/legacy/DeployerWhitelist.sol:DeployerWhitelist": {
"initCodeHash": "0x53099379ed48b87f027d55712dbdd1da7d7099925426eb0531da9c0012e02c29",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol";
/// before and after an upgrade.
contract OPContractsManagerStandardValidator is ISemver {
/// @notice The semantic version of the OPContractsManagerStandardValidator contract.
/// @custom:semver 1.5.0
string public constant version = "1.5.0";
/// @custom:semver 1.6.0
string public constant version = "1.6.0";

/// @notice The SuperchainConfig contract.
ISuperchainConfig public superchainConfig;
Expand Down Expand Up @@ -226,7 +226,7 @@ contract OPContractsManagerStandardValidator is ISemver {

/// @notice Returns the expected PermissionedDisputeGame version.
function permissionedDisputeGameVersion() public pure returns (string memory) {
return "1.7.0";
return "1.8.0";
}

/// @notice Returns the expected PreimageOracle version.
Expand Down
39 changes: 17 additions & 22 deletions packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ import {
InvalidBondDistributionMode,
GameNotResolved,
ReservedGameType,
GamePaused
GamePaused,
BadExtraData
} from "src/dispute/lib/Errors.sol";

// Interfaces
Expand Down Expand Up @@ -171,9 +172,9 @@ contract FaultDisputeGame is Clone, ISemver {
uint256 internal constant HEADER_BLOCK_NUMBER_INDEX = 8;

/// @notice Semantic version.
/// @custom:semver 1.7.0
/// @custom:semver 1.8.0
function version() public pure virtual returns (string memory) {
return "1.7.0";
return "1.8.0";
}

/// @notice The starting timestamp of the game
Expand Down Expand Up @@ -312,20 +313,14 @@ contract FaultDisputeGame is Clone, ISemver {
// in the factory, but are not used by the game, which would allow for multiple dispute games for the same
// output proposal to be created.
//
// Expected length: 0x7A
// - 0x04 selector
// - 0x14 creator address
// - 0x20 root claim
// - 0x20 l1 head
// - 0x20 extraData
// - 0x02 CWIA bytes
assembly {
if iszero(eq(calldatasize(), 0x7A)) {
// Store the selector for `BadExtraData()` & revert
mstore(0x00, 0x9824bdab)
revert(0x1C, 0x04)
}
}
// Expected length: 122 bytes
// - 4 bytes selector
// - 20 bytes creator address
// - 32 bytes root claim
// - 32 bytes l1 head
// - 32 bytes extraData
// - 2 bytes CWIA length
if (msg.data.length != 122) revert BadExtraData();

// Do not allow the game to be initialized if the root claim corresponds to a block at or before the
// configured starting block number.
Expand Down Expand Up @@ -645,7 +640,7 @@ contract FaultDisputeGame is Clone, ISemver {

/// @notice The l2BlockNumber of the disputed output root in the `L2OutputOracle`.
function l2BlockNumber() public pure returns (uint256 l2BlockNumber_) {
l2BlockNumber_ = _getArgUint256(0x54);
l2BlockNumber_ = _getArgUint256(84);
}

/// @notice The l2SequenceNumber of the disputed output root in the `L2OutputOracle` (in this case - block number).
Expand Down Expand Up @@ -860,21 +855,21 @@ contract FaultDisputeGame is Clone, ISemver {
/// @dev `clones-with-immutable-args` argument #1
/// @return creator_ The creator of the dispute game.
function gameCreator() public pure returns (address creator_) {
creator_ = _getArgAddress(0x00);
creator_ = _getArgAddress(0);
}

/// @notice Getter for the root claim.
/// @dev `clones-with-immutable-args` argument #2
/// @return rootClaim_ The root claim of the DisputeGame.
function rootClaim() public pure returns (Claim rootClaim_) {
rootClaim_ = Claim.wrap(_getArgBytes32(0x14));
rootClaim_ = Claim.wrap(_getArgBytes32(20));
}

/// @notice Getter for the parent hash of the L1 block when the dispute game was created.
/// @dev `clones-with-immutable-args` argument #3
/// @return l1Head_ The parent hash of the L1 block when the dispute game was created.
function l1Head() public pure returns (Hash l1Head_) {
l1Head_ = Hash.wrap(_getArgBytes32(0x34));
l1Head_ = Hash.wrap(_getArgBytes32(52));
}

/// @notice Getter for the extra data.
Expand All @@ -883,7 +878,7 @@ contract FaultDisputeGame is Clone, ISemver {
function extraData() public pure returns (bytes memory extraData_) {
// The extra data starts at the second word within the cwia calldata and
// is 32 bytes long.
extraData_ = _getArgBytes(0x54, 0x20);
extraData_ = _getArgBytes(84, 32);
}

/// @notice A compliant implementation of this interface should return the components of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ contract PermissionedDisputeGame is FaultDisputeGame {
}

/// @notice Semantic version.
/// @custom:semver 1.7.0
/// @custom:semver 1.8.0
function version() public pure override returns (string memory) {
return "1.7.0";
return "1.8.0";
}

/// @param _params Parameters for creating a new FaultDisputeGame.
Expand Down
39 changes: 17 additions & 22 deletions packages/contracts-bedrock/src/dispute/SuperFaultDisputeGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ import {
InvalidBondDistributionMode,
GameNotResolved,
ReservedGameType,
GamePaused
GamePaused,
BadExtraData
} from "src/dispute/lib/Errors.sol";

// Interfaces
Expand Down Expand Up @@ -164,9 +165,9 @@ contract SuperFaultDisputeGame is Clone, ISemver {
Position internal constant ROOT_POSITION = Position.wrap(1);

/// @notice Semantic version.
/// @custom:semver 0.4.0
/// @custom:semver 0.5.0
function version() public pure virtual returns (string memory) {
return "0.4.0";
return "0.5.0";
}

/// @notice The starting timestamp of the game
Expand Down Expand Up @@ -302,20 +303,14 @@ contract SuperFaultDisputeGame is Clone, ISemver {
// in the factory, but are not used by the game, which would allow for multiple dispute games for the same
// output proposal to be created.
//
// Expected length: 0x7A
// - 0x04 selector
// - 0x14 creator address
// - 0x20 root claim
// - 0x20 l1 head
// - 0x20 extraData
// - 0x02 CWIA bytes
assembly {
if iszero(eq(calldatasize(), 0x7A)) {
// Store the selector for `BadExtraData()` & revert
mstore(0x00, 0x9824bdab)
revert(0x1C, 0x04)
}
}
// Expected length: 122 bytes
// - 4 bytes selector
// - 20 bytes creator address
// - 32 bytes root claim
// - 32 bytes l1 head
// - 32 bytes extraData
// - 2 bytes CWIA length
if (msg.data.length != 122) revert BadExtraData();

// Do not allow the game to be initialized if the root claim corresponds to a l2 sequence number (timestamp) at
// or before the configured starting sequence number.
Expand Down Expand Up @@ -618,7 +613,7 @@ contract SuperFaultDisputeGame is Clone, ISemver {

/// @notice The l2SequenceNumber (timestamp) of the disputed super root in game root claim.
function l2SequenceNumber() public pure returns (uint256 l2SequenceNumber_) {
l2SequenceNumber_ = _getArgUint256(0x54);
l2SequenceNumber_ = _getArgUint256(84);
}

/// @notice Only the starting sequence number (timestamp) of the game.
Expand Down Expand Up @@ -772,21 +767,21 @@ contract SuperFaultDisputeGame is Clone, ISemver {
/// @dev `clones-with-immutable-args` argument #1
/// @return creator_ The creator of the dispute game.
function gameCreator() public pure returns (address creator_) {
creator_ = _getArgAddress(0x00);
creator_ = _getArgAddress(0);
}

/// @notice Getter for the root claim.
/// @dev `clones-with-immutable-args` argument #2
/// @return rootClaim_ The root claim of the DisputeGame.
function rootClaim() public pure returns (Claim rootClaim_) {
rootClaim_ = Claim.wrap(_getArgBytes32(0x14));
rootClaim_ = Claim.wrap(_getArgBytes32(20));
}

/// @notice Getter for the parent hash of the L1 block when the dispute game was created.
/// @dev `clones-with-immutable-args` argument #3
/// @return l1Head_ The parent hash of the L1 block when the dispute game was created.
function l1Head() public pure returns (Hash l1Head_) {
l1Head_ = Hash.wrap(_getArgBytes32(0x34));
l1Head_ = Hash.wrap(_getArgBytes32(52));
}

/// @notice Getter for the extra data.
Expand All @@ -795,7 +790,7 @@ contract SuperFaultDisputeGame is Clone, ISemver {
function extraData() public pure returns (bytes memory extraData_) {
// The extra data starts at the second word within the cwia calldata and
// is 32 bytes long.
extraData_ = _getArgBytes(0x54, 0x20);
extraData_ = _getArgBytes(84, 32);
}

/// @notice A compliant implementation of this interface should return the components of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ contract SuperPermissionedDisputeGame is SuperFaultDisputeGame {
}

/// @notice Semantic version.
/// @custom:semver 0.4.0
/// @custom:semver 0.5.0
function version() public pure override returns (string memory) {
return "0.4.0";
return "0.5.0";
}

/// @param _params Parameters for creating a new FaultDisputeGame.
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/test/L1/OPContractsManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,13 @@ contract OPContractsManager_Upgrade_Harness is CommonTest {
// Check that the PermissionedDisputeGame is upgraded to the expected version, references
// the correct anchor state and has the mipsImpl. Although Upgrade 15 doesn't actually
// change any of this, we might as well check it again.
assertEq(ISemver(address(pdg)).version(), "1.7.0");
assertEq(ISemver(address(pdg)).version(), "1.8.0");
assertEq(address(pdg.vm()), impls.mipsImpl);
assertEq(pdg.l2ChainId(), oldPDG.l2ChainId());

// If the old FaultDisputeGame exists, we expect it to be upgraded. Check same as above.
if (address(oldFDG) != address(0)) {
assertEq(ISemver(address(fdg)).version(), "1.7.0");
assertEq(ISemver(address(fdg)).version(), "1.8.0");
assertEq(address(fdg.vm()), impls.mipsImpl);
assertEq(fdg.l2ChainId(), oldFDG.l2ChainId());
}
Expand Down