Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ test-dev *ARGS: build-go-ffi

# Default block number for the forked upgrade path.

export sepoliaBlockNumber := "9118951"
export mainnetBlockNumber := "23327678"
export sepoliaBlockNumber := "9366100"
export mainnetBlockNumber := "23530400"

export pinnedBlockNumber := if env_var_or_default("FORK_BASE_CHAIN", "") == "mainnet" {
mainnetBlockNumber
Expand Down
33 changes: 21 additions & 12 deletions packages/contracts-bedrock/test/L1/OPContractsManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import {
IOPContractsManager,
IOPContractsManagerGameTypeAdder,
IOPContractsManagerInteropMigrator,
IOPContractsManagerUpgrader
IOPContractsManagerUpgrader,
IOPContractsManagerStandardValidator
} from "interfaces/L1/IOPContractsManager.sol";
import { IOPContractsManagerStandardValidator } from "interfaces/L1/IOPContractsManagerStandardValidator.sol";
import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol";
import { IBigStepper } from "interfaces/dispute/IBigStepper.sol";
import { ISuperFaultDisputeGame } from "interfaces/dispute/ISuperFaultDisputeGame.sol";
Expand All @@ -56,7 +56,6 @@ import {
OPContractsManagerInteropMigrator,
OPContractsManagerStandardValidator
} from "src/L1/OPContractsManager.sol";
import { OPContractsManagerStandardValidator } from "src/L1/OPContractsManagerStandardValidator.sol";

/// @title OPContractsManager_Harness
/// @notice Exposes internal functions for testing.
Expand Down Expand Up @@ -247,6 +246,14 @@ contract OPContractsManager_Upgrade_Harness is CommonTest {
return;
}

// Create validationOverrides
IOPContractsManagerStandardValidator.ValidationOverrides memory validationOverrides =
IOPContractsManagerStandardValidator.ValidationOverrides({
l1PAOMultisig: opChainConfigs[0].proxyAdmin.owner(),
challenger: IPermissionedDisputeGame(address(disputeGameFactory.gameImpls(GameTypes.PERMISSIONED_CANNON)))
.challenger()
});

// Grab the validator before we do the error assertion because otherwise the assertion will
// try to apply to this function call instead.
IOPContractsManagerStandardValidator validator = _opcm.opcmStandardValidator();
Expand All @@ -256,19 +263,23 @@ contract OPContractsManager_Upgrade_Harness is CommonTest {
// user is requesting to use the existing prestate. We could avoid the error by grabbing
// the prestate from the actual contracts, but that doesn't actually give us any valuable
// checks. Easier to just expect the error in this case.
// We add the prefix of OVERRIDES-L1PAOMULTISIG,OVERRIDES-CHALLENGER because we use validationOverrides.
if (opChainConfigs[0].absolutePrestate.raw() == bytes32(0)) {
vm.expectRevert("OPContractsManagerStandardValidator: PDDG-40,PLDG-40");
vm.expectRevert(
"OPContractsManagerStandardValidator: OVERRIDES-L1PAOMULTISIG,OVERRIDES-CHALLENGER,PDDG-40,PLDG-40"
);
}

// Run the StandardValidator checks.
validator.validate(
validator.validateWithOverrides(
IOPContractsManagerStandardValidator.ValidationInput({
proxyAdmin: opChainConfigs[0].proxyAdmin,
sysCfg: opChainConfigs[0].systemConfigProxy,
absolutePrestate: opChainConfigs[0].absolutePrestate.raw(),
l2ChainID: l2ChainId
}),
false
false,
validationOverrides
);
}

Expand All @@ -278,14 +289,13 @@ contract OPContractsManager_Upgrade_Harness is CommonTest {
/// upgrades from this function once they've been executed on mainnet and the
/// simulation block has been bumped beyond the execution block.
/// @param _delegateCaller The address of the delegate caller to use for the upgrade.
function runPastUpgrades(address _delegateCaller) internal {
function runPastUpgrades(address _delegateCaller) internal view {
// Run past upgrades depending on network.
if (block.chainid == 1) {
// Mainnet
// U16a
_runOpcmUpgradeAndChecks(
IOPContractsManager(0x8123739C1368C2DEDc8C564255bc417FEEeBFF9D), _delegateCaller, bytes("")
);
// This is empty because the block number in the justfile is after the most recent upgrade so there are no
// past upgrades to run.
_delegateCaller;
} else {
revert UnsupportedChainId();
}
Expand Down Expand Up @@ -1215,7 +1225,6 @@ contract OPContractsManager_UpdatePrestate_Test is OPContractsManager_TestInit {
/// @notice Tests the `upgrade` function of the `OPContractsManager` contract.
contract OPContractsManager_Upgrade_Test is OPContractsManager_Upgrade_Harness {
function setUp() public override {
skipIfNotOpFork("OPContractsManager_Upgrade_Test");
super.setUp();

// Run all past upgrades.
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/test/setup/ForkLive.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ contract ForkLive is Deployer, StdAssertions {
// Run past upgrades depending on network.
if (block.chainid == 1) {
// Mainnet
// U16a.
_doUpgrade(IOPContractsManager(0x8123739C1368C2DEDc8C564255bc417FEEeBFF9D), upgrader);
// This is empty because the block number in the justfile is after the most recent upgrade so there are no
// past upgrades to run.
} else {
revert UnsupportedChainId();
}
Expand Down
8 changes: 0 additions & 8 deletions packages/contracts-bedrock/test/setup/Setup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,6 @@ contract Setup is FeatureFlags {
}
}

/// @dev Skips tests when running against a forked production network that is not OP.
function skipIfNotOpFork(string memory message) public {
if (isForkTest() && !isOpFork()) {
vm.skip(true);
console.log(string.concat("Skipping non-OP fork test: ", message));
}
}

/// @dev Skips tests when running against a forked production network using the superchain ops repo.
function skipIfOpsRepoTest(string memory message) public {
if (forkLive.useOpsRepo()) {
Expand Down