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
11 changes: 10 additions & 1 deletion src/ci.just
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ simulate-all-templates:
task_name=$(basename "$task")
task_path="$root_dir/test/tasks/example/$network/$task_name"

# Skip tasks that exceed the 15M gas limit
# 023-u13-to-u16a: OPCMUpgradeV220toV410 performs 4 sequential upgrades (U13 through U16a)
# consuming ~21.7M gas, which exceeds the 15M safety limit for Fusaka EIP-7825 compatibility.
# This template is not actively used and can be skipped in CI.
if [ "$task_name" = "023-u13-to-u16a" ]; then
echo "Skipping $task_name (exceeds 15M gas limit)"
continue
fi

# Launch each simulation in background.
"${root_dir}/src/script/simulate-task.sh" "$task_path" "$nested_safe_name_depth_1" "$nested_safe_name_depth_2" "$network" & pids+=( "$!" )
current_batch=$((current_batch + 1))
Expand All @@ -65,7 +74,7 @@ simulate-all-templates:
wait "$pid"
simulation_count=$((simulation_count + 1))
done

# Reset for next batch
pids=()
current_batch=0
Expand Down
7 changes: 4 additions & 3 deletions src/doc/simulate-l2-ownership-transfer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Simulating an L2 Deposit Transaction Before Execution

The following steps describe how to simulate an L2 deposit transaction prior to L1 task execution. The [TransferL2PAOFromL1.sol](../template/TransferL2PAOFromL1.sol) template executes an L1 transaction, which is later forwarded to the L2 by the op-node. To gain additional confidence that the L2 deposit transaction works as expected, we manually simulate it and record the results in the task’s VALIDATION.md file.
The following steps describe how to simulate an L2 deposit transaction prior to L1 task execution. The [TransferL2PAOFromL1.sol](../template/TransferL2PAOFromL1.sol) transfers the ownership of a L2PAO from a current aliased L1 address to a new aliased L1 address.
This template executes an L1 transaction, which is later forwarded to the L2 by the op-node. To gain additional confidence that the L2 deposit transaction works as expected, we manually simulate it and record the results in the task’s VALIDATION.md file.

## Steps

Expand Down Expand Up @@ -32,7 +33,7 @@ The following steps describe how to simulate an L2 deposit transaction prior to
```
We must put `0xf2fde38b0000000000000000000000006b1bae59d09fccbddb6c6cceb07b7279367c4e3b` in the `Enter raw input data` field.
![Enter Raw Input Data](./images/tenderly-raw-input-data.png)
8. Double-check that the address returned from the `cast calldata-decode` step matches the aliased L1 ProxyAdmin owner (L1PAO) for the target chain. In this case, the L1PAO is `0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A`. Confirm this by manually unaliasing the address using [chisel](https://book.getfoundry.sh/chisel/).
8. Double-check that the address returned from the `cast calldata-decode` step matches the aliased new L1 ProxyAdmin owner (L1PAO) for the target chain. In this case, the L1PAO is `0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A`. Confirm this by manually unaliasing the address using [chisel](https://book.getfoundry.sh/chisel/).
```bash
> uint160 constant offset = uint160(0x1111000000000000000000000000000000001111)
> function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {
Expand All @@ -43,7 +44,7 @@ The following steps describe how to simulate an L2 deposit transaction prior to
> undoL1ToL2Alias(0x6B1BAE59D09fCcbdDB6C6cceb07B7279367C4E3b)
# returns: 0x5a0Aae59D09fccBdDb6C6CcEB07B7279367C3d2A
```
9. Next we need to fill out the `Transaction Parameters` section on the right of the UI. Specifically, fill out the `From` address and `Gas` fields. The `From` address should be the aliased L1PAO address obtained in the previous step (i.e. `0x6B1BAE59D09fCcbdDB6C6cceb07B7279367C4E3b`). The `Gas` field should be set to `200000`. You can get this number by further parsing the opaque data and extracting the gas limit.
9. Next we need to fill out the `Transaction Parameters` section on the right of the UI. Specifically, fill out the `From` address and `Gas` fields. The `From` address should be the aliased old L1PAO address obtained as the `from` field in the `TransactionDeposited` event (i.e. `0x6B1BAE59D09fCcbdDB6C6cceb07B7279367C4E3b`). The `Gas` field should be set to `200000`. You can get this number by further parsing the opaque data and extracting the gas limit.
```bash
cast --to-dec 0x30d40
# returns: 200000
Expand Down
21 changes: 21 additions & 0 deletions src/tasks/MultisigTask.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ abstract contract MultisigTask is Test, Script, StateOverrideManager, TaskManage
using AccountAccessParser for VmSafe.AccountAccess;
using StdStyle for string;

/// @notice Maximum gas limit for transactions, 15M gas is ~90% of the limit
uint256 internal constant MAX_GAS_LIMIT = 15_000_000;

/// @notice AddressesRegistry contract
AddressRegistry public addrRegistry;

Expand Down Expand Up @@ -519,6 +522,24 @@ abstract contract MultisigTask is Test, Script, StateOverrideManager, TaskManage

(bool success, bytes memory returnData) = multisig.call{gas: gas}(callData);

// Check that the transaction did not exceed the maximum gas limit.
// We must check gas consumed BEFORE refunds, because the EVM requires enough gas upfront,
// therefore we check gasTotalUsed + gasRefunded
// Note: gasRefunded is int64, but should always be >= 0 in practice, unsure why this is
// an int64 in forge.
VmSafe.Gas memory gasInfo = vm.lastCallGas();
require(gasInfo.gasRefunded >= 0, "MultisigTask: negative gas refund is invalid");
uint256 gasRefunded = uint256(uint64(gasInfo.gasRefunded));
uint256 gasConsumedBeforeRefund = uint256(gasInfo.gasTotalUsed) + gasRefunded;
if (gasConsumedBeforeRefund > MAX_GAS_LIMIT) {
console.log("Gas consumed before refund:", gasConsumedBeforeRefund);
console.log("Gas refunded:", gasRefunded);
console.log("Gas final used:", gasInfo.gasTotalUsed);
console.log("Gas limit:", MAX_GAS_LIMIT);
console.log("Fusaka EIP-7825 cap: 16,777,216 gas");
revert("MultisigTask: transaction exceeds 15M gas limit");
}

if (!success) {
MultisigTaskPrinter.printErrorExecutingMultisigTransaction(returnData);
revert("MultisigTask: execute failed");
Expand Down
1 change: 1 addition & 0 deletions src/tasks/sep/050-op-betanet-add-game-type/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TENDERLY_GAS=15000000
21 changes: 21 additions & 0 deletions src/tasks/sep/050-op-betanet-add-game-type/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 050-op-betanet-add-game-type

Status: [READY TO SIGN]

## Objective

This task adds the dispute game type 0 (Permissionless) to the Dispute Game Factory on OP Betanet for U18.

## Simulation & Signing

Simulation commands for each safe:
```bash
cd src/tasks/sep/050-op-betanet-add-game-type
SIMULATE_WITHOUT_LEDGER=1 SKIP_DECODE_AND_PRINT=1 just --dotenv-path $(pwd)/.env simulate
```

Signing commands for each safe:
```bash
cd src/tasks/sep/050-op-betanet-add-game-type
SKIP_DECODE_AND_PRINT=1 just --dotenv-path $(pwd)/.env sign
```
31 changes: 31 additions & 0 deletions src/tasks/sep/050-op-betanet-add-game-type/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Validation

This document can be used to validate the inputs and result of the execution of the upgrade transaction which you are
signing.

The steps are:

1. [Validate the Domain and Message Hashes](#expected-domain-and-message-hashes):
2. [Transaction Inputs](config.toml): inputs can be verified in the config.toml file, which includes links to the relevant Superchain Registry sources.
3. State Changes: the template’s _validate block includes assertions to confirm the task ran correctly. State Changes can also be manually reviewed in Tenderly, using the link shown in the terminal during simulation.

## Expected Domain and Message Hashes

First, we need to validate the domain and message hashes. These values should match both the values on your ledger and
the values printed to the terminal when you run the task.

> [!CAUTION]
>
>
> ### Betanet EOA (`0xe934Dc97E347C6aCef74364B50125bb8689c40ff`)
>
> - Domain Hash: `0x07e03428d7125835eca12b6dd1a02903029b456da3a091ecd66fda859fbce61e`
> - Message Hash: `0x9c5cbe23181c28d77aa0eaf6d190d60500c2f58387134deb2249ffd0545d97c6`
>

## Task Calldata

Calldata:
```
0x82ad56cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c69e4c24db479191676611a25d977203c3bdca620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000002441661a2e900000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000005babf93ac7affeae25dc1a7ad4587fdeebba44c2000000000000000000000000cd18a0c04286eba52bb168fa1d79133da4856bef00000000000000000000000062841f5e03a56f818bc8818c5130757aca2541a7000000000000000000000000000000000000000000000000000000000000000003ccb5619628eeba89d58b204aadeb2ed9f51d18ff938069dd298b9e19fb2d310000000000000000000000000000000000000000000000000000000000000049000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000002a300000000000000000000000000000000000000000000000000000000000049d40000000000000000000000000000000000000000000000000011c37937e0800000000000000000000000000006463dee3828677f6270d83d45408044fc5edb908000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000147468697320697320612073616c74206d6978657200000000000000000000000000000000000000000000000000000000000000000000000000000000
```
16 changes: 16 additions & 0 deletions src/tasks/sep/050-op-betanet-add-game-type/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"420110022": {
"ProxyAdmin": "0xcd18a0C04286Eba52Bb168Fa1D79133Da4856bEf",
"ProxyAdminOwner": "0xe934Dc97E347C6aCef74364B50125bb8689c40ff",
"SystemConfigProxy": "0x5babF93aC7AFfeaE25dc1a7ad4587fDeEbba44C2",
"L1CrossDomainMessengerProxy": "0xF0e4aAcC6D039C05B827994C3FfBBBcf00085D11",
"L1StandardBridgeProxy": "0x3756BF0380E7fdABcB81f2cFb1d8022e8B798a8F",
"OptimismPortalProxy": "0xbd36ac8fB65F192dAEbCB2Dca819CB7ea7D60417",
"DisputeGameFactoryProxy": "0x298038f9E37b370d20E58706E8Ac78475b089FB2",
"DelayedWETHProxy": "0x62841F5E03a56f818BC8818c5130757acA2541A7",
"PermissionedDelayedWETHProxy": "0x62841F5E03a56f818BC8818c5130757acA2541A7",
"AnchorStateRegistryProxy": "0x333f8D607B81E880315716A815A9369B33ea6A77",
"AddressManager": "0x82D735Cc1e04fcFef24d0190F11b5253e05562AF",
"L1ERC721BridgeProxy": "0xe081aD91D049e9999d1e7006dbF025b38198B518"
}
}
31 changes: 31 additions & 0 deletions src/tasks/sep/050-op-betanet-add-game-type/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
templateName = "AddGameTypeTemplate"
fallbackAddressesJsonPath = "src/tasks/sep/050-op-betanet-add-game-type/addresses.json"

l2chains = [
{name = "u18-beta-1", chainId = 420110022},
]

[[configs]]
# The below addresses can be found here https://github.com/ethereum-optimism/devnets/blob/main/betanets/u18-beta/u18-beta-1/chain.yaml
chainId = 420110022
saltMixer = "this is a salt mixer"
systemConfig = "0x5babF93aC7AFfeaE25dc1a7ad4587fDeEbba44C2"
proxyAdmin = "0xcd18a0C04286Eba52Bb168Fa1D79133Da4856bEf"
delayedWETH = "0x62841F5E03a56f818BC8818c5130757acA2541A7"
disputeGameType = 0
disputeAbsolutePrestate = "0x03ccb5619628eeba89d58b204aadeb2ed9f51d18ff938069dd298b9e19fb2d31" # Source: https://www.notion.so/oplabs/Betanet-2a9f153ee16280859261e3000d866ee9?source=copy_link#2c5f153ee1628012bc4dfbeaae710c70
disputeMaxGameDepth = 73
disputeSplitDepth = 30
disputeClockExtension = 10800
disputeMaxClockDuration = 302400
initialBond = 80000000000000000
vm = "0x6463dEE3828677F6270d83d45408044fc5eDB908" # Source: https://github.com/ethereum-optimism/superchain-registry/blob/ad5becd08007b80988679b8f0c08d415e1294066/validation/standard/standard-versions-sepolia.toml#L11
permissioned = false

[addresses]
OPCM = "0xc69e4c24db479191676611a25d977203c3bdca62" # https://github.com/ethereum-optimism/superchain-registry/blob/74d9bb4ad4cd8d6fd453f2e9dfe5380d97c07ca9/validation/standard/standard-versions-sepolia.toml#L23C56-L23C98

[stateOverrides]
0xe934Dc97E347C6aCef74364B50125bb8689c40ff = [
{key = "0x0000000000000000000000000000000000000000000000000000000000000005", value = 55}
]
1 change: 1 addition & 0 deletions src/tasks/sep/051-op-betanet-set-respected-game-type/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TENDERLY_GAS=15000000
21 changes: 21 additions & 0 deletions src/tasks/sep/051-op-betanet-set-respected-game-type/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 051-op-betanet-set-respected-game-type

Status: [READY TO SIGN]

## Objective

This task sets the respected dispute game type to game type 0 (Permissionless) on OP Betanet for U18.

## Simulation & Signing

Simulation commands for each safe:
```bash
cd src/tasks/sep/051-op-betanet-set-respected-game-type
SIMULATE_WITHOUT_LEDGER=1 SKIP_DECODE_AND_PRINT=1 just --dotenv-path $(pwd)/.env simulate
```

Signing commands for each safe:
```bash
cd src/tasks/sep/051-op-betanet-set-respected-game-type
SKIP_DECODE_AND_PRINT=1 just --dotenv-path $(pwd)/.env sign
```
31 changes: 31 additions & 0 deletions src/tasks/sep/051-op-betanet-set-respected-game-type/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Validation

This document can be used to validate the inputs and result of the execution of the upgrade transaction which you are
signing.

The steps are:

1. [Validate the Domain and Message Hashes](#expected-domain-and-message-hashes):
2. [Transaction Inputs](config.toml): inputs can be verified in the config.toml file, which includes links to the relevant Superchain Registry sources.
3. State Changes: the template’s _validate block includes assertions to confirm the task ran correctly. State Changes can also be manually reviewed in Tenderly, using the link shown in the terminal during simulation.

## Expected Domain and Message Hashes

First, we need to validate the domain and message hashes. These values should match both the values on your ledger and
the values printed to the terminal when you run the task.

> [!CAUTION]
>
>
> ### Betanet EOA (`0xe934Dc97E347C6aCef74364B50125bb8689c40ff`)
>
> - Domain Hash: `0x07e03428d7125835eca12b6dd1a02903029b456da3a091ecd66fda859fbce61e`
> - Message Hash: `0x9e8127525f1f0fdfe412df910c50c9cd81d2a926147240dfcc9aaf20c0994e03`
>

## Task Calldata

Calldata:
```
0x174dea71000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000333f8d607b81e880315716a815a9369b33ea6a7700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000247fc48504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"420110022": {
"ProxyAdmin": "0xcd18a0C04286Eba52Bb168Fa1D79133Da4856bEf",
"ProxyAdminOwner": "0xe934Dc97E347C6aCef74364B50125bb8689c40ff",
"SystemConfigProxy": "0x5babF93aC7AFfeaE25dc1a7ad4587fDeEbba44C2",
"L1CrossDomainMessengerProxy": "0xF0e4aAcC6D039C05B827994C3FfBBBcf00085D11",
"L1StandardBridgeProxy": "0x3756BF0380E7fdABcB81f2cFb1d8022e8B798a8F",
"OptimismPortalProxy": "0xbd36ac8fB65F192dAEbCB2Dca819CB7ea7D60417",
"DisputeGameFactoryProxy": "0x298038f9E37b370d20E58706E8Ac78475b089FB2",
"DelayedWETHProxy": "0x62841F5E03a56f818BC8818c5130757acA2541A7",
"PermissionedDelayedWETHProxy": "0x62841F5E03a56f818BC8818c5130757acA2541A7",
"AnchorStateRegistryProxy": "0x333f8D607B81E880315716A815A9369B33ea6A77",
"AddressManager": "0x82D735Cc1e04fcFef24d0190F11b5253e05562AF",
"L1ERC721BridgeProxy": "0xe081aD91D049e9999d1e7006dbF025b38198B518"
}
}
18 changes: 18 additions & 0 deletions src/tasks/sep/051-op-betanet-set-respected-game-type/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
l2chains = [
{name = "u18-beta-1", chainId = 420110022}
]

fallbackAddressesJsonPath = "src/tasks/sep/051-op-betanet-set-respected-game-type/addresses.json"
templateName = "SetRespectedGameTypeTemplate"

safeAddressString = "ProxyAdminOwner" # We need this on betanet because the ASR checks msg.sender == SystemConfig.guardian() which is the PAO EOA, not the GuardianSafe multisig as on Sepolia.

[gameTypes]
configs = [
{chainId = 420110022, gameType = 0}
]

[stateOverrides]
0xe934Dc97E347C6aCef74364B50125bb8689c40ff = [
{key = "0x0000000000000000000000000000000000000000000000000000000000000005", value = 56}
]
1 change: 1 addition & 0 deletions src/tasks/sep/052-U18-op-betanets/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TENDERLY_GAS=15000000
22 changes: 22 additions & 0 deletions src/tasks/sep/052-U18-op-betanets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 052-U18-op-betanets

Status: [READY TO SIGN]

## Objective

Updates OP Labs Betanets (both Permissioned and Permissionless networks) to U18.

## Simulation & Signing

```bash
cd src/tasks/sep/052-U18-op-betanets

# Testing
just simulate-stack sep 052-U18-op-betanets

# Commands to execute
just --dotenv-path $(pwd)/.env simulate
USE_KEYSTORE=1 just --dotenv-path $(pwd)/.env sign
# or USE_KEYSTORE=1 just sign-stack sep 052-U18-op-betanets
SIGNATURES=0x just execute
```
19 changes: 19 additions & 0 deletions src/tasks/sep/052-U18-op-betanets/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Expected Domain and Message Hashes

First, we need to validate the domain and message hashes. These values should match both the values on your ledger and
the values printed to the terminal when you run the task.

> [!CAUTION]
>
> Before signing, ensure the below hashes match what is on your ledger.
>
> ### Betanet Proxy Admin Owner (`0xe934Dc97E347C6aCef74364B50125bb8689c40ff`)
>
> - Domain Hash: `0x07e03428d7125835eca12b6dd1a02903029b456da3a091ecd66fda859fbce61e`
> - Message Hash: `0xea39832549b35e6ff015f3138f1216b7dd1bfea74d4192ebbf5de3d9451114e7`

## Task Calldata

```
0x82ad56cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f0a2e224519e876979ea6b2cd15ef5cc3d6703bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000104cbeda5a700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000571d97509f51d7911ca51092f51c0a57d591a8f303845751c66672c0b09e68ba7c3024a7543a1a22edaa90d7c2c90ebc8cecee6803f833cc2a644a9f7bba9718c13f622b867c513f3c43f3eb5a0cad17784bd4080000000000000000000000005babf93ac7affeae25dc1a7ad4587fdeebba44c203845751c66672c0b09e68ba7c3024a7543a1a22edaa90d7c2c90ebc8cecee6803f833cc2a644a9f7bba9718c13f622b867c513f3c43f3eb5a0cad17784bd40800000000000000000000000000000000000000000000000000000000
```
Loading