Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
396ee89
feat: integrate v2 implementations into opcm
stevennevins Sep 10, 2025
5ba2178
fix: skip v2 implementations if not deployed
stevennevins Sep 10, 2025
97b34ab
chore: bump semver version
stevennevins Sep 11, 2025
961e8cd
feat: conditionally set the v2 games based on feature flag
stevennevins Sep 15, 2025
9287013
feat: add override for setup to re-deploy opcm with feature flag
stevennevins Sep 15, 2025
ef29b42
test: improve test by deploying with the feature flag and asserting o…
stevennevins Sep 15, 2025
249ba99
test: add assertion that the deployment configuration on the dgf is c…
stevennevins Sep 15, 2025
e3584b7
chore: improve test name
stevennevins Sep 15, 2025
3022729
refactor: add helper function for feature toggled deployment of opcm
stevennevins Sep 15, 2025
78656fd
fix: bytecode size check failing
stevennevins Sep 16, 2025
3749303
chore: run forge fmt
stevennevins Sep 16, 2025
ddd42de
fix: address CI naming and semver bump
stevennevins Sep 16, 2025
015c220
fix: rename setup contract name to align with ci checks
stevennevins Sep 16, 2025
71374af
chore: comment out added fix
stevennevins Sep 17, 2025
d491a4b
fix: verify opcm
stevennevins Sep 17, 2025
2ebc280
fix: naming convention for test contracts
stevennevins Sep 17, 2025
67194d8
fix: move the updates for addGameType to the addGameType pr
stevennevins Sep 17, 2025
3b769e0
fix: proposer removed
stevennevins Sep 24, 2025
8734e9d
fix: rename function for clarity in VerifyOPCM script
stevennevins Sep 24, 2025
1fb7ca5
fix: add proper gameArgs for V2 dispute game registration and fix set…
stevennevins Sep 24, 2025
cef1fc3
test: add helper functin for creating game proxies
stevennevins Sep 25, 2025
503835f
test: refactor helper functions for test and remove impl from output …
stevennevins Sep 25, 2025
30ef2f3
test: test args correct on created proxy games
stevennevins Sep 25, 2025
bcbe98f
chore: remove unused helper for now
stevennevins Sep 25, 2025
78f65b6
fix: remove guard clause from local issue
stevennevins Sep 25, 2025
0a464cd
chore: bump semver
stevennevins Sep 25, 2025
ac768a5
chore: revert changes to ignore v2 implementations
stevennevins Sep 25, 2025
5fda712
fix: check bitmap and contract name for ref
stevennevins Sep 26, 2025
d688186
test: with feature toggle on
stevennevins Sep 26, 2025
5a585a3
chore: forge fmt
stevennevins Sep 26, 2025
3c4c529
Revert "chore: forge fmt"
stevennevins Sep 26, 2025
e6e7888
Revert "test: with feature toggle on"
stevennevins Sep 26, 2025
3bd2507
chore: forge fmt
stevennevins Sep 26, 2025
a253141
fix: test compiler restriction fix
stevennevins Sep 29, 2025
df9a767
Revert "fix: test compiler restriction fix"
stevennevins Sep 29, 2025
7adc269
fix: compiler bump
stevennevins Sep 29, 2025
05f8750
fix: typo
stevennevins Sep 29, 2025
113651b
test: add test for verify opcm with v2 dispute games deployed
stevennevins Sep 29, 2025
8e8d8a5
test: add skips for v1 tests if v2 deployed
stevennevins Sep 29, 2025
c2a4b66
fix: skip standard validator until its implemented
stevennevins Sep 30, 2025
35ffb7a
fix: skip addGameType until its implemented
stevennevins Sep 30, 2025
c9aebae
fix: skip updatePrestate until its implemented
stevennevins Sep 30, 2025
d2d8781
fix: remove diff in natspec
stevennevins Sep 30, 2025
ebb8185
chore: add TODO comments with issue tracking to skips
stevennevins Sep 30, 2025
8bf14ec
fix: bump semver
stevennevins Sep 30, 2025
df5f3b1
fix: override inheritance for helper function
stevennevins Sep 17, 2025
7bb7ca4
chore: remove commented function
stevennevins Sep 17, 2025
2ae7354
fix: test setup
stevennevins Sep 17, 2025
b25ecac
fix: add game type v2 test
stevennevins Sep 18, 2025
e9170b2
fix: correct v2 dispute game test setup for addGameType
stevennevins Sep 19, 2025
681da74
fix: conflict from duplicate helper
stevennevins Sep 19, 2025
1005541
fix: remove empty contract
stevennevins Sep 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol";
import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol";
import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol";
import { IFaultDisputeGameV2 } from "interfaces/dispute/v2/IFaultDisputeGameV2.sol";
import { IPermissionedDisputeGameV2 } from "interfaces/dispute/v2/IPermissionedDisputeGameV2.sol";
import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol";
import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol";
import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
Expand Down Expand Up @@ -177,6 +179,9 @@ interface IOPContractsManager {
IPermissionedDisputeGame permissionedDisputeGame;
IDelayedWETH delayedWETHPermissionedGameProxy;
IDelayedWETH delayedWETHPermissionlessGameProxy;
// V2 dispute game contracts (deployed when DEPLOY_V2_DISPUTE_GAMES flag is set)
IFaultDisputeGameV2 faultDisputeGameV2;
IPermissionedDisputeGameV2 permissionedDisputeGameV2;
}

/// @notice Addresses of ERC-5202 Blueprint contracts. There are used for deploying full size
Expand Down Expand Up @@ -216,6 +221,8 @@ interface IOPContractsManager {
address anchorStateRegistryImpl;
address delayedWETHImpl;
address mipsImpl;
address faultDisputeGameV2Impl;
address permissionedDisputeGameV2Impl;
}

/// @notice The input required to identify a chain for upgrading.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ contract DeployImplementations is Script {
disputeGameFactoryImpl: address(_output.disputeGameFactoryImpl),
anchorStateRegistryImpl: address(_output.anchorStateRegistryImpl),
delayedWETHImpl: address(_output.delayedWETHImpl),
mipsImpl: address(_output.mipsSingleton)
mipsImpl: address(_output.mipsSingleton),
faultDisputeGameV2Impl: address(_output.faultDisputeGameV2Impl),
permissionedDisputeGameV2Impl: address(_output.permissionedDisputeGameV2Impl)
});

deployOPCMBPImplsContainer(_input, _output, _blueprints, implementations);
Expand Down
44 changes: 44 additions & 0 deletions packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { LibString } from "@solady/utils/LibString.sol";
import { Process } from "scripts/libraries/Process.sol";
import { Config } from "scripts/libraries/Config.sol";
import { Bytes } from "src/libraries/Bytes.sol";
import { DevFeatures } from "src/libraries/DevFeatures.sol";

// Interfaces
import { IOPContractsManager } from "interfaces/L1/IOPContractsManager.sol";
Expand Down Expand Up @@ -106,13 +107,18 @@ contract VerifyOPCM is Script {
/// @notice Setup flag.
bool internal ready;

/// @notice The OPCM address being verified, stored to access during contract verification.
address internal currentOpcmAddress;
/// @notice Populates override mappings.

function setUp() public {
// Overrides for situations where field names do not cleanly map to contract names.
fieldNameOverrides["optimismPortalImpl"] = "OptimismPortal2";
fieldNameOverrides["optimismPortalInteropImpl"] = "OptimismPortalInterop";
fieldNameOverrides["mipsImpl"] = "MIPS64";
fieldNameOverrides["ethLockboxImpl"] = "ETHLockbox";
fieldNameOverrides["faultDisputeGameV2Impl"] = "FaultDisputeGameV2";
fieldNameOverrides["permissionedDisputeGameV2Impl"] = "PermissionedDisputeGameV2";
fieldNameOverrides["permissionlessDisputeGame1"] = "FaultDisputeGame";
fieldNameOverrides["permissionlessDisputeGame2"] = "FaultDisputeGame";
fieldNameOverrides["permissionedDisputeGame1"] = "PermissionedDisputeGame";
Expand Down Expand Up @@ -199,6 +205,9 @@ contract VerifyOPCM is Script {
console.log(" Do NOT do this in production");
}

// Store OPCM address for use in verification functions
currentOpcmAddress = _opcmAddress;

// Fetch Implementations & Blueprints from OPCM
IOPContractsManager opcm = IOPContractsManager(_opcmAddress);

Expand Down Expand Up @@ -394,6 +403,25 @@ contract VerifyOPCM is Script {
{
console.log();
console.log(string.concat("Checking Contract: ", _target.field));
// Check if this is a V2 dispute game that should be skipped
if (_isV2DisputeGameImplementation(_target.name)) {
IOPContractsManager opcm = IOPContractsManager(currentOpcmAddress);

if (!_isV2DisputeGamesEnabled(opcm)) {
if (_target.addr == address(0)) {
console.log(" [SKIP] V2 dispute game not deployed (feature disabled)");
console.log(string.concat(" Contract: ", _target.name));
return true; // Consider this "verified" when feature is off
} else {
console.log(" [FAIL] V2 dispute game deployed but feature disabled");
console.log(string.concat(" Contract: ", _target.name));
console.log(string.concat(" Address: ", vm.toString(_target.addr)));
return false;
}
}
// If feature is enabled, continue with normal verification
}

console.log(string.concat(" Type: ", _target.blueprint ? "Blueprint" : "Implementation"));
console.log(string.concat(" Contract: ", _target.name));
console.log(string.concat(" Address: ", vm.toString(_target.addr)));
Expand Down Expand Up @@ -498,6 +526,22 @@ contract VerifyOPCM is Script {
return success;
}

/// @notice Checks if V2 dispute games feature is enabled in the dev feature bitmap.
/// @param _opcm The OPContractsManager to check.
/// @return True if V2 dispute games are enabled.
function _isV2DisputeGamesEnabled(IOPContractsManager _opcm) internal view returns (bool) {
bytes32 bitmap = _opcm.devFeatureBitmap();
return DevFeatures.isDevFeatureEnabled(bitmap, DevFeatures.DEPLOY_V2_DISPUTE_GAMES);
}

/// @notice Checks if a contract is a V2 dispute game implementation.
/// @param _contractName The name to check.
/// @return True if this is a V2 dispute game.
function _isV2DisputeGameImplementation(string memory _contractName) internal pure returns (bool) {
return LibString.eq(_contractName, "FaultDisputeGameV2")
|| LibString.eq(_contractName, "PermissionedDisputeGameV2");
}

/// @notice Verifies that the immutable variables in the OPCM contract match expected values.
/// @param _opcm The OPCM contract to verify immutable variables for.
/// @return True if all immutable variables are verified, false otherwise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@
"internalType": "contract IDelayedWETH",
"name": "delayedWETHPermissionlessGameProxy",
"type": "address"
},
{
"internalType": "contract IFaultDisputeGameV2",
"name": "faultDisputeGameV2",
"type": "address"
},
{
"internalType": "contract IPermissionedDisputeGameV2",
"name": "permissionedDisputeGameV2",
"type": "address"
}
],
"internalType": "struct OPContractsManager.DeployOutput",
Expand Down Expand Up @@ -530,6 +540,16 @@
"internalType": "address",
"name": "mipsImpl",
"type": "address"
},
{
"internalType": "address",
"name": "faultDisputeGameV2Impl",
"type": "address"
},
{
"internalType": "address",
"name": "permissionedDisputeGameV2Impl",
"type": "address"
}
],
"internalType": "struct OPContractsManager.Implementations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@
"internalType": "address",
"name": "mipsImpl",
"type": "address"
},
{
"internalType": "address",
"name": "faultDisputeGameV2Impl",
"type": "address"
},
{
"internalType": "address",
"name": "permissionedDisputeGameV2Impl",
"type": "address"
}
],
"internalType": "struct OPContractsManager.Implementations",
Expand Down Expand Up @@ -340,6 +350,16 @@
"internalType": "address",
"name": "mipsImpl",
"type": "address"
},
{
"internalType": "address",
"name": "faultDisputeGameV2Impl",
"type": "address"
},
{
"internalType": "address",
"name": "permissionedDisputeGameV2Impl",
"type": "address"
}
],
"internalType": "struct OPContractsManager.Implementations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@
"internalType": "contract IDelayedWETH",
"name": "delayedWETHPermissionlessGameProxy",
"type": "address"
},
{
"internalType": "contract IFaultDisputeGameV2",
"name": "faultDisputeGameV2",
"type": "address"
},
{
"internalType": "contract IPermissionedDisputeGameV2",
"name": "permissionedDisputeGameV2",
"type": "address"
}
],
"internalType": "struct OPContractsManager.DeployOutput",
Expand Down Expand Up @@ -428,6 +438,16 @@
"internalType": "address",
"name": "mipsImpl",
"type": "address"
},
{
"internalType": "address",
"name": "faultDisputeGameV2Impl",
"type": "address"
},
{
"internalType": "address",
"name": "permissionedDisputeGameV2Impl",
"type": "address"
}
],
"internalType": "struct OPContractsManager.Implementations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,16 @@
"internalType": "address",
"name": "mipsImpl",
"type": "address"
},
{
"internalType": "address",
"name": "faultDisputeGameV2Impl",
"type": "address"
},
{
"internalType": "address",
"name": "permissionedDisputeGameV2Impl",
"type": "address"
}
],
"internalType": "struct OPContractsManager.Implementations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,16 @@
"internalType": "address",
"name": "mipsImpl",
"type": "address"
},
{
"internalType": "address",
"name": "faultDisputeGameV2Impl",
"type": "address"
},
{
"internalType": "address",
"name": "permissionedDisputeGameV2Impl",
"type": "address"
}
],
"internalType": "struct OPContractsManager.Implementations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,16 @@
"internalType": "address",
"name": "mipsImpl",
"type": "address"
},
{
"internalType": "address",
"name": "faultDisputeGameV2Impl",
"type": "address"
},
{
"internalType": "address",
"name": "permissionedDisputeGameV2Impl",
"type": "address"
}
],
"internalType": "struct OPContractsManager.Implementations",
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"sourceCodeHash": "0xfca613b5d055ffc4c3cbccb0773ddb9030abedc1aa6508c9e2e7727cc0cd617b"
},
"src/L1/OPContractsManager.sol:OPContractsManager": {
"initCodeHash": "0xf414fb79a8941d3ff24f7c6ae65ccee0927c78bd444b20540db9e3376cf2e9e2",
"sourceCodeHash": "0x74a5c3a080db33be6780c9b9bff37c0ce46b4335d6a35148e080a8c2096cd2c8"
"initCodeHash": "0xfea70b2646110201bc6e5cdc33033a764c9bdc1f1c8696c6100f1da5767c3e18",
"sourceCodeHash": "0x49d0020391f7814c2063f33aafc28dfd94cd6e0314e3c05b9ad8fa951d811506"
},
"src/L1/OPContractsManagerStandardValidator.sol:OPContractsManagerStandardValidator": {
"initCodeHash": "0xcc5dacb9e1c2b9395aa5f9c300f03c18af1ff5a9efd6a7ce4d5135dfbe7b1e2b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "struct OPContractsManager.Blueprints"
},
{
"bytes": "448",
"bytes": "512",
"label": "implementation",
"offset": 0,
"slot": "13",
Expand Down
Loading