|
| 1 | +# Deriving Payload Attributes |
| 2 | + |
| 3 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 4 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 5 | +**Table of Contents** |
| 6 | + |
| 7 | +- [Deriving the Transaction List](#deriving-the-transaction-list) |
| 8 | + - [Network upgrade automation transactions](#network-upgrade-automation-transactions) |
| 9 | + - [Fjord](#fjord) |
| 10 | + - [L1Block Deployment - Fjord](#l1block-deployment---fjord) |
| 11 | + - [GasPriceOracle Deployment - Fjord](#gaspriceoracle-deployment---fjord) |
| 12 | + - [L1Block Proxy Update - Fjord](#l1block-proxy-update---fjord) |
| 13 | + - [GasPriceOracle Proxy Update - Fjord](#gaspriceoracle-proxy-update---fjord) |
| 14 | + - [GasPriceOracle Enable Fjord](#gaspriceoracle-enable-fjord) |
| 15 | + |
| 16 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 17 | + |
| 18 | +## Deriving the Transaction List |
| 19 | + |
| 20 | +### Network upgrade automation transactions |
| 21 | + |
| 22 | +#### Fjord |
| 23 | + |
| 24 | +The Fjord hardfork activation block, contains the following transactions in this order: |
| 25 | + |
| 26 | +- L1 Attributes Transaction, using the pre-Fjord `setL1BlockValuesEcotone` |
| 27 | +- User deposits from L1 |
| 28 | +- Network Upgrade Transactions |
| 29 | + - L1Block deployment |
| 30 | + - GasPriceOracle deployment |
| 31 | + - Update L1Block Proxy ERC-1967 Implementation Slot |
| 32 | + - Update GasPriceOracle Proxy ERC-1967 Implementation Slot |
| 33 | + - GasPriceOracle Enable Fjord |
| 34 | + |
| 35 | +To not modify or interrupt the system behavior around gas computation, this block will not include any sequenced |
| 36 | +transactions by setting `noTxPool: true`. |
| 37 | + |
| 38 | +##### L1Block Deployment - Fjord |
| 39 | + |
| 40 | +The `L1Block` contract is upgraded to store the new Fjord Fast LZ parameters. |
| 41 | + |
| 42 | +To perform this upgrade, a deposit transaction is derived with the following attributes: |
| 43 | + |
| 44 | +- `from`: `0x4210000000000000000000000000000000000002` |
| 45 | +- `to`: `null` |
| 46 | +- `mint`: `0` |
| 47 | +- `value`: `0` |
| 48 | +- `gasLimit`: `420,000` |
| 49 | +- `data`: `0x60806040523...` ([full bytecode](../static/bytecode/fjord-l1-block-deployment.txt)) |
| 50 | +- `sourceHash`: `0x402f75bf100f605f36c2e2b8d5544a483159e26f467a9a555c87c125e7ab09f3`, |
| 51 | + computed with the "Upgrade-deposited" type, with `intent = "Fjord: L1 Block Deployment" |
| 52 | + |
| 53 | +This results in the Fjord L1Block contract being deployed to `0xa919894851548179A0750865e7974DA599C0Fac7`, to verify: |
| 54 | + |
| 55 | +```bash |
| 56 | +cast compute-address --nonce=0 0x4210000000000000000000000000000000000002 |
| 57 | +Computed Address: 0xa919894851548179A0750865e7974DA599C0Fac7 |
| 58 | +``` |
| 59 | + |
| 60 | +Verify `sourceHash`: |
| 61 | + |
| 62 | +```bash |
| 63 | +cast keccak $(cast concat-hex 0x0000000000000000000000000000000000000000000000000000000000000002 $(cast keccak "Fjord: L1 Block Deployment")) |
| 64 | +# 0x402f75bf100f605f36c2e2b8d5544a483159e26f467a9a555c87c125e7ab09f3 |
| 65 | +``` |
| 66 | + |
| 67 | +Verify `data`: |
| 68 | + |
| 69 | +```bash |
| 70 | +git checkout TODO (update once merged) |
| 71 | +pnpm clean && pnpm install && pnpm build |
| 72 | +jq -r ".bytecode.object" packages/contracts-bedrock/forge-artifacts/L1Block.sol/L1Block.json |
| 73 | +``` |
| 74 | + |
| 75 | +This transaction MUST deploy a contract with the following code hash |
| 76 | +`0x12e89c50902af815d85608f9a2a35579a74e9491077b94211c96f79ef265bf9c`. |
| 77 | + |
| 78 | +##### GasPriceOracle Deployment - Fjord |
| 79 | + |
| 80 | +The `GasPriceOracle` contract is upgraded to support the new Fjord L1 data fee computation. Post fork this contract |
| 81 | +will use FastLZ to compute the L1 data fee. |
| 82 | + |
| 83 | +To perform this upgrade, a deposit transaction is derived with the following attributes: |
| 84 | + |
| 85 | +- `from`: `0x4210000000000000000000000000000000000003` |
| 86 | +- `to`: `null`, |
| 87 | +- `mint`: `0` |
| 88 | +- `value`: `0` |
| 89 | +- `gasLimit`: `1,450,000` |
| 90 | +- `data`: `0x60806040523...` ([full bytecode](../static/bytecode/fjord-gas-price-oracle-deployment.txt)) |
| 91 | +- `sourceHash`: `0x86122c533fdcb89b16d8713174625e44578a89751d96c098ec19ab40a51a8ea3` |
| 92 | + computed with the "Upgrade-deposited" type, with `intent = "Fjord: Gas Price Oracle Deployment" |
| 93 | + |
| 94 | +This results in the Fjord GasPriceOracle contract being deployed to `0xFf256497D61dcd71a9e9Ff43967C13fdE1F72D12`, |
| 95 | +to verify: |
| 96 | + |
| 97 | +```bash |
| 98 | +cast compute-address --nonce=0 0x4210000000000000000000000000000000000003 |
| 99 | +Computed Address: 0xFf256497D61dcd71a9e9Ff43967C13fdE1F72D12 |
| 100 | +``` |
| 101 | + |
| 102 | +Verify `sourceHash`: |
| 103 | + |
| 104 | +```bash |
| 105 | +❯ cast keccak $(cast concat-hex 0x0000000000000000000000000000000000000000000000000000000000000002 $(cast keccak "Fjord: Gas Price Oracle Deployment")) |
| 106 | +# 0x86122c533fdcb89b16d8713174625e44578a89751d96c098ec19ab40a51a8ea3 |
| 107 | +``` |
| 108 | + |
| 109 | +Verify `data`: |
| 110 | + |
| 111 | +```bash |
| 112 | +git checkout TODO (update once merged) |
| 113 | +pnpm clean && pnpm install && pnpm build |
| 114 | +jq -r ".bytecode.object" packages/contracts-bedrock/forge-artifacts/GasPriceOracle.sol/GasPriceOracle.json |
| 115 | +``` |
| 116 | + |
| 117 | +This transaction MUST deploy a contract with the following code hash |
| 118 | +`0xcb82de8a527fee307214950192bf0ff5b2701c6b6eda2fbd025cf6d4075fbe38`. |
| 119 | + |
| 120 | +##### L1Block Proxy Update - Fjord |
| 121 | + |
| 122 | +This transaction updates the L1Block Proxy ERC-1967 implementation slot to point to the new L1Block deployment. |
| 123 | + |
| 124 | +A deposit transaction is derived with the following attributes: |
| 125 | + |
| 126 | +- `from`: `0x0000000000000000000000000000000000000000` |
| 127 | +- `to`: `0x4200000000000000000000000000000000000015` (L1Block Proxy) |
| 128 | +- `mint`: `0` |
| 129 | +- `value`: `0` |
| 130 | +- `gasLimit`: `50,000` |
| 131 | +- `data`: `0x3659cfe6000000000000000000000000a919894851548179a0750865e7974da599c0fac7` |
| 132 | +- `sourceHash`: `0x0fefb8cb7f44b866e21a59f647424cee3096de3475e252eb3b79fa3f733cee2d` |
| 133 | + computed with the "Upgrade-deposited" type, with `intent = "Fjord: L1 Block Proxy Update" |
| 134 | + |
| 135 | +Verify data: |
| 136 | + |
| 137 | +```bash |
| 138 | +cast concat-hex $(cast sig "upgradeTo(address)") $(cast abi-encode "upgradeTo(address)" 0xa919894851548179A0750865e7974DA599C0Fac7) |
| 139 | +0x3659cfe6000000000000000000000000a919894851548179a0750865e7974da599c0fac7 |
| 140 | +``` |
| 141 | + |
| 142 | +Verify `sourceHash`: |
| 143 | + |
| 144 | +```bash |
| 145 | +cast keccak $(cast concat-hex 0x0000000000000000000000000000000000000000000000000000000000000002 $(cast keccak "Fjord: L1 Block Proxy Update")) |
| 146 | +# 0x0fefb8cb7f44b866e21a59f647424cee3096de3475e252eb3b79fa3f733cee2d |
| 147 | +``` |
| 148 | + |
| 149 | +##### GasPriceOracle Proxy Update - Fjord |
| 150 | + |
| 151 | +This transaction updates the GasPriceOracle Proxy ERC-1967 implementation slot to point to the new GasPriceOracle |
| 152 | +deployment. |
| 153 | + |
| 154 | +A deposit transaction is derived with the following attributes: |
| 155 | + |
| 156 | +- `from`: `0x0000000000000000000000000000000000000000` |
| 157 | +- `to`: `0x420000000000000000000000000000000000000F` (Gas Price Oracle Proxy) |
| 158 | +- `mint`: `0` |
| 159 | +- `value`: `0` |
| 160 | +- `gasLimit`: `50,000` |
| 161 | +- `data`: `0x3659cfe6000000000000000000000000ff256497d61dcd71a9e9ff43967c13fde1f72d12` |
| 162 | +- `sourceHash`: `0x1e6bb0c28bfab3dc9b36ffb0f721f00d6937f33577606325692db0965a7d58c6` |
| 163 | + computed with the "Upgrade-deposited" type, with `intent = "Fjord: Gas Price Oracle Proxy Update"` |
| 164 | + |
| 165 | +Verify data: |
| 166 | + |
| 167 | +```bash |
| 168 | +cast concat-hex $(cast sig "upgradeTo(address)") $(cast abi-encode "upgradeTo(address)" 0xFf256497D61dcd71a9e9Ff43967C13fdE1F72D12) |
| 169 | +0x3659cfe6000000000000000000000000ff256497d61dcd71a9e9ff43967c13fde1f72d12 |
| 170 | +``` |
| 171 | + |
| 172 | +Verify `sourceHash`: |
| 173 | + |
| 174 | +```bash |
| 175 | +cast keccak $(cast concat-hex 0x0000000000000000000000000000000000000000000000000000000000000002 $(cast keccak "Fjord: Gas Price Oracle Proxy Update")) |
| 176 | +# 0x1e6bb0c28bfab3dc9b36ffb0f721f00d6937f33577606325692db0965a7d58c6 |
| 177 | +``` |
| 178 | + |
| 179 | +##### GasPriceOracle Enable Fjord |
| 180 | + |
| 181 | +This transaction informs the GasPriceOracle to start using the Fjord gas calculation formula. |
| 182 | + |
| 183 | +A deposit transaction is derived with the following attributes: |
| 184 | + |
| 185 | +- `from`: `0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001` (Depositer Account) |
| 186 | +- `to`: `0x420000000000000000000000000000000000000F` (Gas Price Oracle Proxy) |
| 187 | +- `mint`: `0` |
| 188 | +- `value`: `0` |
| 189 | +- `gasLimit`: `80,000` |
| 190 | +- `data`: `0x8e98b106` |
| 191 | +- `sourceHash`: `0xbac7bb0d5961cad209a345408b0280a0d4686b1b20665e1b0f9cdafd73b19b6b`, |
| 192 | + computed with the "Upgrade-deposited" type, with `intent = "Fjord: Gas Price Oracle Set Fjord" |
| 193 | + |
| 194 | +Verify data: |
| 195 | + |
| 196 | +```bash |
| 197 | +cast sig "setFjord()" |
| 198 | +0x8e98b106 |
| 199 | +``` |
| 200 | + |
| 201 | +Verify `sourceHash`: |
| 202 | + |
| 203 | +```bash |
| 204 | +cast keccak $(cast concat-hex 0x0000000000000000000000000000000000000000000000000000000000000002 $(cast keccak "Fjord: Gas Price Oracle Set Fjord")) |
| 205 | +# 0xbac7bb0d5961cad209a345408b0280a0d4686b1b20665e1b0f9cdafd73b19b6b |
| 206 | +``` |
0 commit comments