From b1d5f42b33acedaa0fb1cc836431e772b54f5e3a Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 18 Sep 2025 11:27:25 +0100 Subject: [PATCH 1/5] fix jovian specs We had generated the upgrade transactions with an account which had already been used cast nonce 0x4210000000000000000000000000000000000004 --rpc-url=https://mainnet.optimism.io 1 This means the upgrade transactions would revert. There is already a contract at the address we were trying to deploy to. --- specs/protocol/jovian/derivation.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/specs/protocol/jovian/derivation.md b/specs/protocol/jovian/derivation.md index 543e0d534..9ae645ff4 100644 --- a/specs/protocol/jovian/derivation.md +++ b/specs/protocol/jovian/derivation.md @@ -22,28 +22,28 @@ derivation pipeline in the following order: ## Network Upgrade Transactions ### L1Block Deployment - + The `L1Block` contract is deployed. A deposit transaction is derived with the following attributes: -- `from`: `0x4210000000000000000000000000000000000004` +- `from`: `0x4210000000000000000000000000000000000006` - `to`: `null` - `mint`: `0` - `value`: `0` - `nonce`: `0` - `gasLimit`: `444775` - `data`: `0x0x608060405234801561001057600080...` ([full bytecode](../../../specs/static/bytecode/jovian-l1-block-deployment.txt)) -- `sourceHash`: `0x98faf23b9795967bc0b1c543144739d50dba3ea40420e77ad6ca9848dbfb62e8`, +- `sourceHash`: `0x98faf23b9795967bc0b1c543144739d50dba3ea40420e77ad6ca9848dbfb62e8`, computed with the "Upgrade-deposited" type, with `intent = "Jovian: L1Block Deployment"` This results in the Jovian L1Block contract being deployed to -`0x93e57A196454CB919193fa9946f14943cf733845`, to verify: +`0x3Ba4007f5C922FBb33C454B41ea7a1f11E83df2C`, to verify: ```bash -cast compute-address --nonce=0 0x4210000000000000000000000000000000000004 -Computed Address: 0x93e57A196454CB919193fa9946f14943cf733845 +cast compute-address --nonce=0 0x4210000000000000000000000000000000000006 +Computed Address: 0x3Ba4007f5C922FBb33C454B41ea7a1f11E83df2C ``` Verify `sourceHash`: @@ -61,7 +61,7 @@ make build-contracts jq -r ".bytecode.object" packages/contracts-bedrock/forge-artifacts/L1Block.sol/L1Block.json ``` -This transaction MUST deploy a contract with the following code hash +This transaction MUST deploy a contract with the following code hash `0xf7b6ef0de2a53625d467d98c2932a5a5d64ffa1a331ebbde5bb06e2591b5835a`. To verify the code hash: @@ -72,6 +72,7 @@ make build-contracts cast k $(jq -r ".deployedBytecode.object" packages/contracts-bedrock/forge-artifacts/L1Block.sol/L1Block.json) ``` + ### L1Block Proxy Update This transaction updates the L1Block Proxy ERC-1967 @@ -84,15 +85,15 @@ A deposit transaction is derived with the following attributes: - `mint`: `0` - `value`: `0` - `gasLimit`: `50,000` -- `data`: `0x3659cfe600000000000000000000000093e57a196454cb919193fa9946f14943cf733845` +- `data`: `0x3659cfe60000000000000000000000003ba4007f5c922fbb33c454b41ea7a1f11e83df2c` - `sourceHash`: `0x08447273a4fbce97bc8c515f97ac74efc461f6a4001553712f31ebc11288bad2` computed with the "Upgrade-deposited" type, with `intent = "Jovian: L1Block Proxy Update"` Verify data: ```bash -cast concat-hex $(cast sig "upgradeTo(address)") $(cast abi-encode "upgradeTo(address)" 0x93e57A196454CB919193fa9946f14943cf733845) -# 0x3659cfe600000000000000000000000093e57a196454cb919193fa9946f14943cf733845 +cast concat-hex $(cast sig "upgradeTo(address)") $(cast abi-encode "upgradeTo(address)" 0x3Ba4007f5C922FBb33C454B41ea7a1f11E83df2C) +# 0x3659cfe60000000000000000000000003ba4007f5c922fbb33c454b41ea7a1f11e83df2c ``` Verify `sourceHash`: @@ -100,3 +101,4 @@ Verify `sourceHash`: ```bash cast keccak $(cast concat-hex 0x0000000000000000000000000000000000000000000000000000000000000002 $(cast keccak "Jovian: L1Block Proxy Update")) # 0x08447273a4fbce97bc8c515f97ac74efc461f6a4001553712f31ebc11288bad2 +``` From 87cc50542ca1c729f9c4fbb3ab3981f0120728b9 Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 18 Sep 2025 11:28:49 +0100 Subject: [PATCH 2/5] commit script to generate specs This anticipates https://github.com/ethereum-optimism/specs/pull/673 --- .../upgrades/gen_jovian_upgrade_tx_specs.sh | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/upgrades/gen_jovian_upgrade_tx_specs.sh diff --git a/scripts/upgrades/gen_jovian_upgrade_tx_specs.sh b/scripts/upgrades/gen_jovian_upgrade_tx_specs.sh new file mode 100755 index 000000000..7737a0d11 --- /dev/null +++ b/scripts/upgrades/gen_jovian_upgrade_tx_specs.sh @@ -0,0 +1,37 @@ +#!/bin/bash -e + +GIT_COMMIT_HASH=7daaabbf2c2cce892aa171bc7e1331ad31bcc8ca +FROM_ADDRESS_NONCE=0 +FROM_ADDRESS=0x4210000000000000000000000000000000000006 +FORK_NAME=Jovian + +# Array of contract names and their corresponding proxy addresses +declare -a contracts=( + "L1Block:0x4200000000000000000000000000000000000015" +) + +inc_hex() { + # $1 : hex string, with or without 0x + local hex="${1#0x}" # remove leading “0x” if it’s there + # perform the add via bc + local next + next=$(printf 'obase=16; ibase=16; %s + 1\n' "$hex" | bc) + # print with 0x + printf '0x%s\n' "$next" +} + +for contract_pair in "${contracts[@]}"; do + IFS=':' read -r contract_name proxy_address <<< "$contract_pair" + ./scripts/run_gen_predeploy_docs.sh \ + --optimism-repo-path ../optimism \ + --fork-name $FORK_NAME \ + --contract-name "$contract_name" \ + --from-address $FROM_ADDRESS \ + --from-address-nonce $FROM_ADDRESS_NONCE \ + --git-commit-hash $GIT_COMMIT_HASH \ + --eth-rpc-url https://optimism.rpc.subquery.network/public \ + --proxy-address "$proxy_address" \ + --copy-contract-bytecode true + # increment the from address itself by 1 in hex here + FROM_ADDRESS=$(inc_hex "$FROM_ADDRESS") +done From 37c33e4261c7bdf001537d13122541b7805b4004 Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 18 Sep 2025 11:30:01 +0100 Subject: [PATCH 3/5] lint --- specs/protocol/jovian/derivation.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/specs/protocol/jovian/derivation.md b/specs/protocol/jovian/derivation.md index 9ae645ff4..9f79f9199 100644 --- a/specs/protocol/jovian/derivation.md +++ b/specs/protocol/jovian/derivation.md @@ -22,7 +22,10 @@ derivation pipeline in the following order: ## Network Upgrade Transactions ### L1Block Deployment - + The `L1Block` contract is deployed. @@ -72,7 +75,6 @@ make build-contracts cast k $(jq -r ".deployedBytecode.object" packages/contracts-bedrock/forge-artifacts/L1Block.sol/L1Block.json) ``` - ### L1Block Proxy Update This transaction updates the L1Block Proxy ERC-1967 From 306e4c5d660301dab259515c677e737b045e9ba2 Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 18 Sep 2025 15:56:01 +0100 Subject: [PATCH 4/5] remove file --- .../upgrades/gen_jovian_upgrade_tx_specs.sh | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100755 scripts/upgrades/gen_jovian_upgrade_tx_specs.sh diff --git a/scripts/upgrades/gen_jovian_upgrade_tx_specs.sh b/scripts/upgrades/gen_jovian_upgrade_tx_specs.sh deleted file mode 100755 index 7737a0d11..000000000 --- a/scripts/upgrades/gen_jovian_upgrade_tx_specs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -e - -GIT_COMMIT_HASH=7daaabbf2c2cce892aa171bc7e1331ad31bcc8ca -FROM_ADDRESS_NONCE=0 -FROM_ADDRESS=0x4210000000000000000000000000000000000006 -FORK_NAME=Jovian - -# Array of contract names and their corresponding proxy addresses -declare -a contracts=( - "L1Block:0x4200000000000000000000000000000000000015" -) - -inc_hex() { - # $1 : hex string, with or without 0x - local hex="${1#0x}" # remove leading “0x” if it’s there - # perform the add via bc - local next - next=$(printf 'obase=16; ibase=16; %s + 1\n' "$hex" | bc) - # print with 0x - printf '0x%s\n' "$next" -} - -for contract_pair in "${contracts[@]}"; do - IFS=':' read -r contract_name proxy_address <<< "$contract_pair" - ./scripts/run_gen_predeploy_docs.sh \ - --optimism-repo-path ../optimism \ - --fork-name $FORK_NAME \ - --contract-name "$contract_name" \ - --from-address $FROM_ADDRESS \ - --from-address-nonce $FROM_ADDRESS_NONCE \ - --git-commit-hash $GIT_COMMIT_HASH \ - --eth-rpc-url https://optimism.rpc.subquery.network/public \ - --proxy-address "$proxy_address" \ - --copy-contract-bytecode true - # increment the from address itself by 1 in hex here - FROM_ADDRESS=$(inc_hex "$FROM_ADDRESS") -done From 9141bd32f5cf04e5d543bf6639dc490ef051715c Mon Sep 17 00:00:00 2001 From: geoknee Date: Thu, 18 Sep 2025 15:56:38 +0100 Subject: [PATCH 5/5] whitespace nits --- specs/protocol/jovian/derivation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/protocol/jovian/derivation.md b/specs/protocol/jovian/derivation.md index 9f79f9199..2923fd5ef 100644 --- a/specs/protocol/jovian/derivation.md +++ b/specs/protocol/jovian/derivation.md @@ -38,7 +38,7 @@ A deposit transaction is derived with the following attributes: - `nonce`: `0` - `gasLimit`: `444775` - `data`: `0x0x608060405234801561001057600080...` ([full bytecode](../../../specs/static/bytecode/jovian-l1-block-deployment.txt)) -- `sourceHash`: `0x98faf23b9795967bc0b1c543144739d50dba3ea40420e77ad6ca9848dbfb62e8`, +- `sourceHash`: `0x98faf23b9795967bc0b1c543144739d50dba3ea40420e77ad6ca9848dbfb62e8`, computed with the "Upgrade-deposited" type, with `intent = "Jovian: L1Block Deployment"` This results in the Jovian L1Block contract being deployed to @@ -64,7 +64,7 @@ make build-contracts jq -r ".bytecode.object" packages/contracts-bedrock/forge-artifacts/L1Block.sol/L1Block.json ``` -This transaction MUST deploy a contract with the following code hash +This transaction MUST deploy a contract with the following code hash `0xf7b6ef0de2a53625d467d98c2932a5a5d64ffa1a331ebbde5bb06e2591b5835a`. To verify the code hash: