Skip to content
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
79 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
997d107
chore: bump semver
stevennevins Sep 30, 2025
9f2d031
Merge branch 'develop' into snevin/issue-17257/creator-pattern-opcm-d…
mbaxter Oct 2, 2025
d8d2426
Fix silent merge conflicts with develop
mbaxter Oct 2, 2025
3301eea
Bump semver version
mbaxter Oct 6, 2025
5eb5f3b
Run semver-lock
mbaxter Oct 6, 2025
06a236d
Reintroduce OPContractsManager_Version_Test
mbaxter Oct 6, 2025
40f9160
Cleanup - revert comment change
mbaxter Oct 6, 2025
9df861a
Remove v2 contracts from DeployOutput
mbaxter Oct 6, 2025
61e4338
Remove unused imports
mbaxter Oct 6, 2025
7f7c1c7
Update DeployOPChain tests to run across feature flags (in progress)
mbaxter Oct 7, 2025
f355827
Update OPCM tests to work with FeatureFlags options
mbaxter Oct 7, 2025
3394856
Merge PermissionedDisputeGame tests, use feature flags
mbaxter Oct 7, 2025
f6cd910
Merge FaultDisputeGame tests, use feature flag in setup
mbaxter Oct 7, 2025
6032f6d
Remove redundant test
mbaxter Oct 7, 2025
4fe9e44
Fix test name
mbaxter Oct 7, 2025
c7ab682
Fix anchorRootNotFound test - pass in extra data
mbaxter Oct 7, 2025
d5385ce
Extend deployment test to check more fields
mbaxter Oct 7, 2025
7184c8b
Add guards around new setImplementation call
mbaxter Oct 7, 2025
f1f963f
Add new error to OPCM interface
mbaxter Oct 7, 2025
8168bd6
Merge branch 'develop' into snevin/issue-17257/creator-pattern-opcm-d…
mbaxter Oct 7, 2025
756ce03
Run semver-lock
mbaxter Oct 7, 2025
9be001b
Prefix var with underscore
mbaxter Oct 9, 2025
9d1323f
Remove unused imports
mbaxter Oct 9, 2025
0409e70
Regenerate snapshots
mbaxter Oct 9, 2025
97e6775
Pass opcm as an argument to _verifyOpcmContractRef
mbaxter Oct 9, 2025
94ef1c6
Reorganize verifyOPCM v2 skip logic
mbaxter Oct 9, 2025
cdb9d1f
Merge branch 'develop' into snevin/issue-17257/creator-pattern-opcm-d…
mbaxter Oct 9, 2025
ad552a0
Add TODO to fix acceptance test
mbaxter Oct 9, 2025
26ce735
Add function documentation for the new opcm param
mbaxter Oct 10, 2025
d68a798
Cleanup: add test assertion messages
mbaxter Oct 10, 2025
63409d3
Remove opcm param from runSingle script
mbaxter Oct 10, 2025
463a7d1
Tweak method documentation
mbaxter Oct 10, 2025
81cbdd2
Cleanup dead code
mbaxter Oct 10, 2025
a2e4cc6
Merge branch 'develop' into snevin/issue-17257/creator-pattern-opcm-d…
mbaxter Oct 10, 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;
Comment thread
stevennevins marked this conversation as resolved.
}

/// @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)) {
Comment thread
mbaxter marked this conversation as resolved.
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
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