Skip to content

Commit

Permalink
Merge branch 'main' into bm/simulate-in-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
blmalone authored Jan 13, 2025
2 parents e11035d + c06f6af commit 31746ff
Show file tree
Hide file tree
Showing 32 changed files with 1,337 additions and 41 deletions.
29 changes: 14 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ commands:
--justfile ../../../nested.just \
simulate council
jobs:
check_sepolia_rpc_endpoints:
circleci_ip_ranges: true
Expand Down Expand Up @@ -225,14 +224,21 @@ jobs:
just simulate-council
just prepare-json
just simulate-council # simulate again to make sure the json is still valid
simulate_eth_021:
just_simulate_permissionless_fp_upgrade:
docker:
- image: << pipeline.parameters.ci_builder_image >>
steps:
- simulate_nested:
task: "/eth/ink-001-permissionless-proofs"

just_simulate_ink_respected_game_type:
docker:
- image: << pipeline.parameters.ci_builder_image >>
steps:
- simulate:
task: "eth/021-holocene-protocol-versions"
task: "/eth/ink-002-set-respected-game-type"

forge_build:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
Expand Down Expand Up @@ -279,13 +285,6 @@ jobs:
yq --version
forge --version
simulate_eth_022:
docker:
- image: << pipeline.parameters.ci_builder_image >>
steps:
- simulate_nested:
task: "eth/022-holocene-fp-upgrade"

workflows:
main:
jobs:
Expand Down Expand Up @@ -313,10 +312,10 @@ workflows:
- just_simulate_sc_rehearsal_1
- just_simulate_sc_rehearsal_2
- just_simulate_sc_rehearsal_4
- just_simulate_permissionless_fp_upgrade
- just_simulate_ink_respected_game_type
# Simulate non-terminal tasks.
# This process finds all non-terminal tasks that currently
# exist in the task list and simulates them to ensure that
# they are still valid.
- simulate_non_terminal_tasks
- simulate_eth_021
- simulate_eth_022
- simulate_non_terminal_tasks
42 changes: 25 additions & 17 deletions NESTED-VALIDATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Validation - Nested Safe

This document describes the generic validation steps for running a Mainnet or Sepolia tasks for the
nested 2/2 Security Council/Foundation Safe.
This document describes the generic validation steps for running a Mainnet or Sepolia tasks for any
nested 2/2 Safe involving either the Security Council & Foundation Upgrade Safe or the Base and Foundation Operations Safe.

## State Overrides

Expand All @@ -10,27 +10,31 @@ The following state overrides related to the nested Safe execution must be seen:
### `GnosisSafeProxy` - the 2/2 `ProxyAdminOwner` Safe

The `ProxyAdminOwner` has the following address:
- Mainnet: [`0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A`](https://etherscan.io/address/0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A)
- Sepolia: [`0x1Eb2fFc903729a0F03966B917003800b145F56E2`](https://sepolia.etherscan.io/address/0x1Eb2fFc903729a0F03966B917003800b145F56E2)
- Mainnet:
- Superchain: [`0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A`](https://etherscan.io/address/0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A)
- Base/OP: [0x7bB41C3008B3f03FE483B28b8DB90e19Cf07595c](https://etherscan.io/address/0x7bB41C3008B3f03FE483B28b8DB90e19Cf07595c)
- Sepolia Superchain: [`0x1Eb2fFc903729a0F03966B917003800b145F56E2`](https://sepolia.etherscan.io/address/0x1Eb2fFc903729a0F03966B917003800b145F56E2)

These addresses are attested to in the [Optimism Docs](https://docs.optimism.io/chain/security/privileged-roles#addresses).
The Superchain addresses are attested to in the [Optimism Docs](https://docs.optimism.io/chain/security/privileged-roles#addresses).

Enables the simulation by setting the threshold to 1:

- **Key:** `0x0000000000000000000000000000000000000000000000000000000000000004` <br/>
**Value:** `0x0000000000000000000000000000000000000000000000000000000000000001`
**Meaning:** The threshold is set to 1.

### Security Council Safe or Foundation Safe
### Safe Signer

Depending on which role (Security Council or Foundation) the task was simulated for,
Depending on which role the task was simulated for,
you must see the following overrides for the following address:
- Mainnet
- Council Safe: [`0xc2819DC788505Aac350142A7A707BF9D03E3Bd03`](https://etherscan.io/address/0xc2819DC788505Aac350142A7A707BF9D03E3Bd03)
- Foundation Safe: [`0x847B5c174615B1B7fDF770882256e2D3E95b9D92`](https://etherscan.io/address/0x847B5c174615B1B7fDF770882256e2D3E95b9D92)
- Security Council Safe: [`0xc2819DC788505Aac350142A7A707BF9D03E3Bd03`](https://etherscan.io/address/0xc2819DC788505Aac350142A7A707BF9D03E3Bd03)
- Foundation Upgrade Safe: [`0x847B5c174615B1B7fDF770882256e2D3E95b9D92`](https://etherscan.io/address/0x847B5c174615B1B7fDF770882256e2D3E95b9D92)
- Foundation Operations Safe: [`0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A`](https://etherscan.io/address/0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A)
- Base Operations Safe: [`0x9855054731540A48b28990B63DcF4f33d8AE46A1`](https://etherscan.io/address/0x9855054731540A48b28990B63DcF4f33d8AE46A1)
- Sepolia
- Council Safe: [`0xf64bc17485f0B4Ea5F06A96514182FC4cB561977`](https://sepolia.etherscan.io/address/0xf64bc17485f0B4Ea5F06A96514182FC4cB561977)
- Foundation Safe: [`0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B`](https://sepolia.etherscan.io/address/0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B)
- Fake Security Council Safe: [`0xf64bc17485f0B4Ea5F06A96514182FC4cB561977`](https://sepolia.etherscan.io/address/0xf64bc17485f0B4Ea5F06A96514182FC4cB561977)
- Fake Foundation Upgrade Safe: [`0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B`](https://sepolia.etherscan.io/address/0xDEe57160aAfCF04c34C887B5962D0a69676d3C8B)

The simulated role will also be called the **Safe Signer** in the remaining document.

Expand Down Expand Up @@ -88,15 +92,19 @@ The GnosisSafe `approvedHashes` mapping is updated to indicate approval of this
```
The output of this command must match the key of the state change.

### Liveness Guard
### Liveness Guard (Security Council only)

When the Security Council executes a transaction, the liveness timestamp are updated for each owner that signed the tasks.
This is updating at the moment of the transaction is submitted (`block.timestamp`) into the [`lastLive`](https://github.com/ethereum-optimism/optimism/blob/e84868c27776fd04dc77e95176d55c8f6b1cc9a3/packages/contracts-bedrock/src/safe/LivenessGuard.sol#L41) mapping located at the slot `0`.
When the Security Council executes a transaction, the liveness timestamps are updated for each owner that signed the task.
This is updating at the moment when the transaction is submitted (`block.timestamp`) into the [`lastLive`](https://github.com/ethereum-optimism/optimism/blob/e84868c27776fd04dc77e95176d55c8f6b1cc9a3/packages/contracts-bedrock/src/safe/LivenessGuard.sol#L41) mapping located at the slot `0`.

### Nonce increments

The only other state changes related to the nested execution are _three_ nonce increments:

- One on the `ProxyAdminOwner` 2/2. If this is not decoded, it corresponds to key `0x05` on a `GnosisSafeProxy`.
- One on the Council or Foundation Safe. If this is not decoded, it corresponds to key `0x05` on a `GnosisSafeProxy`.
- One of the EOA that is the first entry in the owner set of the simulated role.
- One increment of the `ProxyAdminOwner` Safe nonce, located as storage slot
`0x0000000000000000000000000000000000000000000000000000000000000005` on a
`GnosisSafeProxy`.
- One increment of the **Safe Signer** nonce, located as storage slot
`0x0000000000000000000000000000000000000000000000000000000000000005` on a
`GnosisSafeProxy`.
- One increment of the nonce of the EOA that is the first entry in the owner set of the Safe Signer.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ install-eip712sign:
PATH="$REPO_ROOT/bin:$PATH"
cd $REPO_ROOT
mkdir -p bin || true
GOBIN="$REPO_ROOT/bin" go install github.com/base-org/[email protected].8
GOBIN="$REPO_ROOT/bin" go install github.com/base-org/[email protected].10
# Bundle path should be provided including the .json file extension.
add-transaction bundlePath to sig *params:
Expand Down
2 changes: 1 addition & 1 deletion lib/superchain-registry
Submodule superchain-registry updated 54 files
+8 −6 .circleci/main_config.yml
+90 −0 chainList.json
+65 −0 chainList.toml
+1 −1 justfile
+1 −1 ops/cmd/add-new-chain.go
+1 −1 ops/config/config.go
+12 −8 ops/utils/addresses.go
+357 −2 superchain/configs/configs.json
+61 −0 superchain/configs/mainnet/arena-z.toml
+61 −0 superchain/configs/mainnet/ink.toml
+64 −0 superchain/configs/mainnet/redstone.toml
+60 −0 superchain/configs/mainnet/sseed.toml
+1 −1 superchain/configs/mainnet/swell.toml
+62 −0 superchain/configs/sepolia/arena-z-testnet.toml
+1 −1 superchain/configs/sepolia/ink.toml
+123 −2 superchain/extra/addresses/addresses.json
+ superchain/extra/bytecodes/0x1576b0568a7cd02ff4b9d9d880985e2fc203f4db1b91929747e682e6271d7291.bin.gz
+ superchain/extra/bytecodes/0x27983dae795f2f89bdf18340a729212426edd2efbc7ef1597b76140cf452556d.bin.gz
+ superchain/extra/bytecodes/0x301e1624e9879989f53e1d44996144e5a225695de610d56708c7ff9e67c9af3b.bin.gz
+ superchain/extra/bytecodes/0x60589b78bec8494d3772d15baf1be526b70103935e44ecfc9e1d4c677c0ae62c.bin.gz
+ superchain/extra/bytecodes/0x61bf830e231cd547c8c6f710a906f894f5dcb2fbdb5843ae896f84fb160ba33e.bin.gz
+ superchain/extra/bytecodes/0x66ca1e3e9b503a50a1fafd0a8f13c62d0587220850cb70afb415928ce64d622b.bin.gz
+ superchain/extra/bytecodes/0x69374c71022a578ce5a5888ca73ecb66f257260538e47aa99c0053c9a939c9dd.bin.gz
+ superchain/extra/bytecodes/0x6fef32409b669766f683d7520443fbc0aae15759078a4174ae1f5f7fd0d2142e.bin.gz
+ superchain/extra/bytecodes/0x7822c780fd0cedfd31865cbdeb977076679574bdec13e6055ca3f4b46b549f20.bin.gz
+ superchain/extra/bytecodes/0x7c41158b3f275aaeb388c71d8a5fea4ada3b3e7b4b4873a92c4599f04dae321a.bin.gz
+ superchain/extra/bytecodes/0x84de3b02831861efe0d2f266ce0f3661abccf0503c71e4ca935b0afeb7b60238.bin.gz
+ superchain/extra/bytecodes/0xa5f28de812f07f0b7afa7f25fdf625baa9846cc249c24da5f52afc096b706002.bin.gz
+ superchain/extra/bytecodes/0xb039a6c1d2eac2bf113f37d460e36b66477186b6173e6f737f011b79cc47bff7.bin.gz
+ superchain/extra/bytecodes/0xb1b5bbb5ade451854910efb286d846ca169298de462a5b63f4cfd2115aa2b797.bin.gz
+ superchain/extra/bytecodes/0xd0fd5f16dfe0d9be58ae2e7bf54bdc95b737c9a3a5a1b8f9fe7143506b163d23.bin.gz
+ superchain/extra/bytecodes/0xd515c0ee629f7fc3caaae3eeb3d0b1c5c01a63bf9f44fc99db460e809c8a618b.bin.gz
+ superchain/extra/bytecodes/0xf3a0130dd91f4dae0f7c991313effde2fa1f50c19933148f0641406b7a993069.bin.gz
+ superchain/extra/bytecodes/0xfc5afc02cb5a67998e014fe03df3a318998600509323d4164fa54f0a3b517077.bin.gz
+ superchain/extra/bytecodes/0xfed58c682088b86021101df2062147d4bcb98496589d11eb920119383c1eb41f.bin.gz
+ superchain/extra/genesis/mainnet/arena-z.json.gz
+ superchain/extra/genesis/mainnet/ink.json.gz
+ superchain/extra/genesis/mainnet/redstone.json.gz
+ superchain/extra/genesis/mainnet/sseed.json.gz
+ superchain/extra/genesis/sepolia/arena-z-testnet.json.gz
+5 −0 validation/exclusions_test.go
+0 −42 validation/gas-limit_test.go
+61 −0 validation/gas_limit.go
+51 −0 validation/gas_limit_test.go
+4 −0 validation/genesis/genesis-allocs_test.go
+86 −0 validation/genesis/validation-inputs/5330/deploy-config.json
+4 −0 validation/genesis/validation-inputs/5330/meta.toml
+101 −0 validation/genesis/validation-inputs/57073/deploy-config.json
+4 −0 validation/genesis/validation-inputs/57073/meta.toml
+72 −0 validation/genesis/validation-inputs/690/deploy-config.json
+4 −0 validation/genesis/validation-inputs/690/meta.toml
+103 −0 validation/genesis/validation-inputs/7897/deploy-config.json
+4 −0 validation/genesis/validation-inputs/7897/meta.toml
+1 −1 validation/genesis/validation-inputs/9897/meta.toml
2 changes: 1 addition & 1 deletion runbooks/key-handover.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document describes how to generate upgrade playbooks to upgrade chains to t

## Context

One of the requirement for getting to Stage, 1 as defined by [L2Beat](https://medium.com/l2beat/introducing-stages-a-framework-to-evaluate-rollups-maturity-d290bb22befe) is having a Security Council in place. The Security Council acts as a safeguard in the system, ready to step in in the event of bugs or issues with the proof system. It must function through a multisig setup consisting of at least 8 participants and require a 50% consensus threshold. Furthermore, at least half of the participants must be external to the organization running the rollup, with a minimum of two outsiders required for consensus.
One of the requirements for getting to Stage, 1 as defined by [L2Beat](https://medium.com/l2beat/introducing-stages-a-framework-to-evaluate-rollups-maturity-d290bb22befe) is having a Security Council in place. The Security Council acts as a safeguard in the system, ready to step in in the event of bugs or issues with the proof system. It must function through a multisig setup consisting of at least 8 participants and require a 50% consensus threshold. Furthermore, at least half of the participants must be external to the organization running the rollup, with a minimum of two outsiders required for consensus.

This setup ensures a diversity of viewpoints and minimizes the risk of any single party exerting undue influence. For the sake of transparency and accountability, the identities (or the pseudonyms) of the council participants should also be publicly disclosed.

Expand Down
59 changes: 58 additions & 1 deletion script/verification/DisputeGameUpgrade.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,34 @@ interface IASR {
function superchainConfig() external view returns (address superchainConfig_);
}

interface IMIPS is ISemver {
function oracle() external view returns (address oracle_);
}

abstract contract DisputeGameUpgrade is VerificationBase, SuperchainRegistry {
using LibString for string;

bytes32 immutable expAbsolutePrestate;
address immutable expFaultDisputeGame;
address immutable expPermissionedDisputeGame;
DisputeGameFactory immutable dgfProxy;

constructor(bytes32 _absolutePrestate, address _faultDisputeGame, address _permissionedDisputeGame) {
expAbsolutePrestate = _absolutePrestate;
expFaultDisputeGame = _faultDisputeGame;
expPermissionedDisputeGame = _permissionedDisputeGame;

dgfProxy = DisputeGameFactory(proxies.DisputeGameFactory);

addAllowedStorageAccess(proxies.DisputeGameFactory);

precheckDisputeGames();
}

/// @notice Public function that must be called by the verification script.
function checkDisputeGameUpgrade() public view {
console.log("check dispute game implementations");

DisputeGameFactory dgfProxy = DisputeGameFactory(proxies.DisputeGameFactory);
FaultDisputeGame faultDisputeGame = FaultDisputeGame(address(dgfProxy.gameImpls(GameTypes.CANNON)));
PermissionedDisputeGame permissionedDisputeGame =
PermissionedDisputeGame(address(dgfProxy.gameImpls(GameTypes.PERMISSIONED_CANNON)));
Expand Down Expand Up @@ -86,4 +94,53 @@ abstract contract DisputeGameUpgrade is VerificationBase, SuperchainRegistry {

require(address(faultDisputeGame.weth()) != address(permissionedDisputeGame.weth()), "weth-200");
}

function precheckDisputeGames() internal view {
_precheckDisputeGameImplementation(GameType.wrap(0), expFaultDisputeGame);
_precheckDisputeGameImplementation(GameType.wrap(1), expPermissionedDisputeGame);
}

// _precheckDisputeGameImplementation checks that the new game being set has the same
// configuration as the existing implementation.
function _precheckDisputeGameImplementation(GameType _targetGameType, address _newImpl) internal view {
console.log("pre-check new game implementation", _targetGameType.raw());

FaultDisputeGame currentGame = FaultDisputeGame(address(dgfProxy.gameImpls(GameType(_targetGameType))));
FaultDisputeGame newGame = FaultDisputeGame(_newImpl);

if (vm.envOr("DISPUTE_GAME_CHANGE_WETH", false)) {
console.log("Expecting DelayedWETH to change");
require(address(currentGame.weth()) != address(newGame.weth()), "pre-10");
} else {
console.log("Expecting DelayedWETH to stay the same");
require(address(currentGame.weth()) == address(newGame.weth()), "pre-10");
}

require(_targetGameType.raw() == newGame.gameType().raw(), "pre-20");
require(address(currentGame.anchorStateRegistry()) == address(newGame.anchorStateRegistry()), "pre-30");
require(currentGame.l2ChainId() == newGame.l2ChainId(), "pre-40");
require(currentGame.splitDepth() == newGame.splitDepth(), "pre-50");
require(currentGame.maxGameDepth() == newGame.maxGameDepth(), "pre-60");
require(currentGame.maxClockDuration().raw() == newGame.maxClockDuration().raw(), "pre-70");
require(currentGame.clockExtension().raw() == newGame.clockExtension().raw(), "pre-80");

if (_targetGameType.raw() == GameTypes.PERMISSIONED_CANNON.raw()) {
PermissionedDisputeGame currentPDG = PermissionedDisputeGame(address(currentGame));
PermissionedDisputeGame newPDG = PermissionedDisputeGame(address(newGame));
require(address(currentPDG.proposer()) == address(newPDG.proposer()), "pre-90");
require(address(currentPDG.challenger()) == address(newPDG.challenger()), "pre-100");
}

_precheckVm(newGame, currentGame);
}

// _precheckVm checks that the new VM has the same oracle as the old VM.
function _precheckVm(FaultDisputeGame _newGame, FaultDisputeGame _currentGame) internal view {
console.log("pre-check VM implementation", _newGame.gameType().raw());

IMIPS newVm = IMIPS(address(_newGame.vm()));
IMIPS currentVm = IMIPS(address(_currentGame.vm()));

require(newVm.oracle() == currentVm.oracle(), "vm-10");
}
}
13 changes: 13 additions & 0 deletions script/verification/Verification.s.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import {console2 as console} from "forge-std/console2.sol";
import {LibString} from "solady/utils/LibString.sol";
import {Types} from "@eth-optimism-bedrock/scripts/Types.sol";
import {CommonBase} from "forge-std/Base.sol";
Expand Down Expand Up @@ -75,6 +76,7 @@ contract SuperchainRegistry is CommonBase {
opContractsReleaseQ = string.concat("\"op-contracts/", _opContractsRelease, "\"");
_readSuperchainConfig();
_readStandardVersions();
_applyOverrides();
}

/// @notice Reads the contract addresses from the superchain registry.
Expand Down Expand Up @@ -162,4 +164,15 @@ contract SuperchainRegistry is CommonBase {
{
sv_.version = stdToml.readString(data, string.concat("$.RELEASE.", key, ".version"));
}

function _applyOverrides() internal {
try vm.envAddress("SCR_OVERRIDE_MIPS_ADDRESS") returns (address mips) {
console.log("SuperchainRegistry: overriding MIPS address to %s", mips);
standardVersions.MIPS.Address = mips;
} catch { /* Ignore, no override */ }
try vm.envString("SCR_OVERRIDE_MIPS_VERSION") returns (string memory ver) {
console.log("SuperchainRegistry: overriding MIPS version to %s", ver);
standardVersions.MIPS.version = ver;
} catch { /* Ignore, no override */ }
}
}
3 changes: 2 additions & 1 deletion tasks/eth/022-holocene-fp-upgrade/.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ SAFE_NONCE=6 # noop
SAFE_NONCE_0XC2819DC788505AAC350142A7A707BF9D03E3BD03=8 # noop
SAFE_NONCE_0X847B5C174615B1B7FDF770882256E2D3E95B9D92=11 # +1, task 021

SIMULATE_WITHOUT_LEDGER=0 # 1
# we change the WETH in this task, which is non-standard
DISPUTE_GAME_CHANGE_WETH=true
6 changes: 3 additions & 3 deletions tasks/eth/022-holocene-fp-upgrade/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Holocene Hardfork Upgrade - OP Mainnet

Status: READY TO SIGN
Status: [EXECUTED](https://etherscan.io/tx/0x22ab07b0bb1bc8504256835d555307ff522b78651dca33c9cd5b05591ca5b4f7)

## Objective

Expand All @@ -10,8 +10,8 @@ The proposal was:

- [X] [Posted](https://gov.optimism.io/t/upgrade-proposal-11-holocene-network-upgrade/9313) on the governance forum.
- [X] [Approved](https://vote.optimism.io/proposals/20127877429053636874064552098716749508236019236440427814457915785398876262515) by Token House voting.
- [ ] Not vetoed by the Citizens' house.
- [ ] Executed on OP Mainnet.
- [X] Not vetoed by the Citizens' house.
- [X] Executed on OP Mainnet.

The governance proposal should be treated as the source of truth and used to verify the correctness of the onchain operations.

Expand Down
15 changes: 15 additions & 0 deletions tasks/eth/base-003-holocene-fp-upgrade/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ETH_RPC_URL="https://ethereum.publicnode.com"

# Base L1 PAO
OWNER_SAFE=0x7bB41C3008B3f03FE483B28b8DB90e19Cf07595c
# This is Base's safe but the Nested.just file uses council as a keyword and
# we want to minimize changes
COUNCIL_SAFE=0x9855054731540A48b28990B63DcF4f33d8AE46A1
# Foundation Operations Safe
FOUNDATION_SAFE=0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A

# No nonce overrides needed, this is the next task for B1PAO, BOS, FOS.
# But doing them anyways.
SAFE_NONCE=4
SAFE_NONCE_0X9855054731540A48B28990B63DCF4F33D8AE46A1=16
SAFE_NONCE_0X9BA6E03D8B90DE867373DB8CF1A58D2F7F006B3A=97
57 changes: 57 additions & 0 deletions tasks/eth/base-003-holocene-fp-upgrade/NestedSignFromJson.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import {console2 as console} from "forge-std/console2.sol";
import {Vm} from "forge-std/Vm.sol";
import {stdJson} from "forge-std/StdJson.sol";
import {Simulation} from "@base-contracts/script/universal/Simulation.sol";
import {NestedSignFromJson as OriginalNestedSignFromJson} from "script/NestedSignFromJson.s.sol";
import {DisputeGameUpgrade} from "script/verification/DisputeGameUpgrade.s.sol";
import {CouncilFoundationNestedSign} from "script/verification/CouncilFoundationNestedSign.s.sol";
import {SuperchainRegistry} from "script/verification/Verification.s.sol";

contract NestedSignFromJson is OriginalNestedSignFromJson, CouncilFoundationNestedSign, DisputeGameUpgrade {
constructor()
SuperchainRegistry("mainnet", "base", "v1.8.0-rc.4")
DisputeGameUpgrade(
0x03f89406817db1ed7fd8b31e13300444652cdb0b9c509a674de43483b2f83568, // absolutePrestate
0xc5f3677c3C56DB4031ab005a3C9c98e1B79D438e, // faultDisputeGame
0xF62c15e2F99d4869A925B8F57076cD85335832A2 // permissionedDisputeGame
)
{}

function setUp() public view {
checkInput();
}

function checkInput() public view {
string memory inputJson;
string memory path = "/tasks/eth/base-003-holocene-fp-upgrade/input.json";
try vm.readFile(string.concat(vm.projectRoot(), path)) returns (string memory data) {
inputJson = data;
} catch {
revert(string.concat("Failed to read ", path));
}

address inputPermissionedDisputeGame =
stdJson.readAddress(inputJson, "$.transactions[0].contractInputsValues._impl");
address inputFaultDisputeGame = stdJson.readAddress(inputJson, "$.transactions[1].contractInputsValues._impl");
require(expPermissionedDisputeGame == inputPermissionedDisputeGame, "input-pdg");
require(expFaultDisputeGame == inputFaultDisputeGame, "input-fdg");
}

function _postCheck(Vm.AccountAccess[] memory accesses, Simulation.Payload memory) internal view override {
console.log("Running post-deploy assertions");
checkStateDiff(accesses);
checkDisputeGameUpgrade();
console.log("All assertions passed!");
}

function getAllowedStorageAccess() internal view override returns (address[] memory) {
return allowedStorageAccess;
}

function getCodeExceptions() internal view override returns (address[] memory) {
return codeExceptions;
}
}
Loading

0 comments on commit 31746ff

Please sign in to comment.