From 72581a7622ab95daa9d87c1190053ae4b7cddea4 Mon Sep 17 00:00:00 2001 From: Brian Bland Date: Wed, 2 Oct 2024 10:35:23 -0700 Subject: [PATCH] chore: Update mainnet gas limit from 132M->144M (#217) * chore: Update gas limit from 132M->144M * Add execution record --- mainnet/2024-10-01-increase-gas-limit/.env | 8 + .../2024-10-01-increase-gas-limit/Makefile | 31 ++ .../2024-10-01-increase-gas-limit/README.md | 292 ++++++++++++++++++ .../foundry.toml | 20 ++ .../UpgradeGasLimit.sol/1/run-1727888979.json | 87 ++++++ 5 files changed, 438 insertions(+) create mode 100644 mainnet/2024-10-01-increase-gas-limit/.env create mode 100644 mainnet/2024-10-01-increase-gas-limit/Makefile create mode 100644 mainnet/2024-10-01-increase-gas-limit/README.md create mode 100644 mainnet/2024-10-01-increase-gas-limit/foundry.toml create mode 100644 mainnet/2024-10-01-increase-gas-limit/records/UpgradeGasLimit.sol/1/run-1727888979.json diff --git a/mainnet/2024-10-01-increase-gas-limit/.env b/mainnet/2024-10-01-increase-gas-limit/.env new file mode 100644 index 0000000..9d5f7d8 --- /dev/null +++ b/mainnet/2024-10-01-increase-gas-limit/.env @@ -0,0 +1,8 @@ +OP_COMMIT=9047beb54c66a5c572784efec8984f259302ec92 +BASE_CONTRACTS_COMMIT=6df77b49e16c2da29d1530b624eb6df4ff00cb2e + +L1_SYSTEM_CONFIG_ADDRESS=0x73a79Fab69143498Ed3712e519A88a918e1f4072 +SYSTEM_CONFIG_OWNER=0x14536667Cd30e52C0b458BaACcB9faDA7046E056 + +OLD_GAS_LIMIT=132000000 +NEW_GAS_LIMIT=144000000 diff --git a/mainnet/2024-10-01-increase-gas-limit/Makefile b/mainnet/2024-10-01-increase-gas-limit/Makefile new file mode 100644 index 0000000..e9ec21c --- /dev/null +++ b/mainnet/2024-10-01-increase-gas-limit/Makefile @@ -0,0 +1,31 @@ +include ../../Makefile +include ../.env +include .env + +ifndef LEDGER_ACCOUNT +override LEDGER_ACCOUNT = 0 +endif + +.PHONY: sign-upgrade +sign-upgrade: + $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ + forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/UpgradeGasLimit.sol \ + --sig "sign()" + +.PHONY: execute-upgrade +execute-upgrade: + forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/UpgradeGasLimit.sol \ + --sig "run(bytes)" $(SIGNATURES) --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --broadcast + + +.PHONY: sign-rollback +sign-rollback: + $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ + forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/RollbackGasLimit.sol \ + --sig "sign()" + + +.PHONY: execute-rollback +execute-rollback: + forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/RollbackGasLimit.sol \ + --sig "run(bytes)" $(SIGNATURES) --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --broadcast diff --git a/mainnet/2024-10-01-increase-gas-limit/README.md b/mainnet/2024-10-01-increase-gas-limit/README.md new file mode 100644 index 0000000..f9e92b4 --- /dev/null +++ b/mainnet/2024-10-01-increase-gas-limit/README.md @@ -0,0 +1,292 @@ +# Update Gas Limit in L1 `SystemConfig` + +Status: DONE + +## Objective + +We are updating the gas limit to improve TPS and reduce gas fees. + +This runbook invokes two scripts which allow our signers to sign two different calls for our Incident Multisig, which are both defined in the [base-org/contracts](https://github.com/base-org/contracts) repository: +1. `UpgradeGasLimit` -- This script will update the gas limit to our new limit of 144M gas +2. `RollbackGasLimit` -- This script establishes a rollback call in the case we need to revert to gas + +The values we are sending are statically defined in the `.env`. + +> [!IMPORTANT] We have two transactions to sign. Please follow +> the flow for both "Approving the Update transaction" and +> "Approving the Rollback transaction". Hopefully we only need +> the former, but will have the latter available if needed. + +## Approving the Upgrade transaction + +### 1. Update repo and move to the appropriate folder: +``` +cd contract-deployments +git pull +cd mainnet/2024-09-23-increase-gas-limit +make deps +``` + +### 2. Setup Ledger + +Your Ledger needs to be connected and unlocked. The Ethereum +application needs to be opened on Ledger with the message "Application +is ready". + +### 3. Simulate and validate the transaction + +Make sure your ledger is still unlocked and run the following. + +``` shell +make sign-upgrade +``` + +Once you run the `make sign...` command successfully, you will see a "Simulation link" from the output. + +Paste this URL in your browser. A prompt may ask you to choose a +project, any project will do. You can create one if necessary. + +Click "Simulate Transaction". + +We will be performing 3 validations and then we'll extract the domain hash and +message hash to approve on your Ledger then verify completion: + +1. Validate integrity of the simulation. +2. Validate correctness of the state diff. +3. Validate and extract domain hash and message hash to approve. + + +#### 3.1. Validate integrity of the simulation. + +Make sure you are on the "Overview" tab of the tenderly simulation, to +validate integrity of the simulation, we need to check the following: + +1. "Network": Check the network is Ethereum Mainnet. +2. "Timestamp": Check the simulation is performed on a block with a + recent timestamp (i.e. close to when you run the script). +3. "Sender": Check the address shown is your signer account. If not, + you will need to determine which “number” it is in the list of + addresses on your ledger. +4. "Success" with a green check mark + + +#### 3.2. Validate correctness of the state diff. + +Now click on the "State" tab. Verify that: + +1. Verify that the nonce is incremented for the Incident Multisig under the "GnosisSafeProxy" at address `0x14536667Cd30e52C0b458BaACcB9faDA7046E056`. We should see the nonce increment from 32 to 33: + +``` +Key: 0x0000000000000000000000000000000000000000000000000000000000000005 +Before: 0x0000000000000000000000000000000000000000000000000000000000000020 +After: 0x00000000000000000000000000000000000000000000000000000000000000021 +``` + +2. Verify that gas limit value is appropriately updated under "Proxy" at address `0x73a79fab69143498ed3712e519a88a918e1f4072`. We should see that the gas limit has been changed from 132M to 144M: + +``` +Key: 0x0000000000000000000000000000000000000000000000000000000000000068 +Before: 0x0000000000000000000000000000000000000000000000000000000007DE2900 +After: 0x0000000000000000000000000000000000000000000000000000000008954400 +``` + +#### 3.3. Extract the domain hash and the message hash to approve. + +Now that we have verified the transaction performs the right +operation, we need to extract the domain hash and the message hash to +approve. + +Go back to the "Overview" tab, and find the +`GnosisSafe.checkSignatures` call. This call's `data` parameter +contains both the domain hash and the message hash that will show up +in your Ledger. + +Here is an example screenshot. Note that the value will be +different for each signer: + +![Screenshot 2024-03-07 at 5 49 02 PM](https://github.com/base-org/contract-deployments/assets/84420280/1b7905f1-1350-4634-a804-7b4458d0ddc9) + + +It will be a concatenation of `0x1901`, the domain hash, and the +message hash: `0x1901[domain hash][message hash]`. + +Note down this value. You will need to compare it with the ones +displayed on the Ledger screen at signing. + +### 4. Approve the signature on your ledger + +Once the validations are done, it's time to actually sign the +transaction. Make sure your ledger is still unlocked and run the +following: + +``` shell +make sign-upgrade +``` + +> [!IMPORTANT] This is the most security critical part of the +> playbook: make sure the domain hash and message hash in the +> following two places match: + +1. on your Ledger screen. +2. in the Tenderly simulation. You should use the same Tenderly + simulation as the one you used to verify the state diffs, instead + of opening the new one printed in the console. + +There is no need to verify anything printed in the console. There is +no need to open the new Tenderly simulation link either. + +After verification, sign the transaction. You will see the `Data`, +`Signer` and `Signature` printed in the console. Format should be +something like this: + +``` +Data: +Signer:
+Signature: +``` + +Double check the signer address is the right one. + +### 5. Send the output to Facilitator(s) + +Nothing has occurred onchain - these are offchain signatures which +will be collected by Facilitators for execution. Execution can occur +by anyone once a threshold of signatures are collected, so a +Facilitator will do the final execution for convenience. + +Share the `Data`, `Signer` and `Signature` with the Facilitator, and +congrats, you are done! + + +## Approving the Rollback transaction + +Complete the above steps for `Approving the Update transaction` before continuing below. + +### 1. Simulate and validate the transaction + +Make sure your ledger is still unlocked and run the following. +``` shell +make sign-rollback +``` +Once you run the make sign command successfully, you will see a "Simulation link" from the output. Once again paste this URL in your browser and click "Simulate Transaction". + +We will be performing 3 validations and then we'll extract the domain hash and +message hash to approve on your Ledger then verify completion: + +1. Validate integrity of the simulation. +2. Validate correctness of the state diff. +3. Validate and extract domain hash and message hash to approve. +4. Validate that the transaction completed successfully + + +#### 3.1. Validate integrity of the simulation. + +Make sure you are on the "Overview" tab of the tenderly simulation, to +validate integrity of the simulation, we need to check the following: + +1. "Network": Check the network is Ethereum Mainnet. +2. "Timestamp": Check the simulation is performed on a block with a + recent timestamp (i.e. close to when you run the script). +3. "Sender": Check the address shown is your signer account. If not, + you will need to determine which “number” it is in the list of + addresses on your ledger. +4. "Success" with a green check mark + + +#### 3.2. Validate correctness of the state diff. + +Now click on the "State" tab. Verify that: + +1. Verify that the nonce is incremented for the Incident Multisig under the "GnosisSafeProxy" at address `0x14536667Cd30e52C0b458BaACcB9faDA7046E056`: + +``` +Key: 0x0000000000000000000000000000000000000000000000000000000000000005 +Before: 0x00000000000000000000000000000000000000000000000000000000000000021 +After: 0x00000000000000000000000000000000000000000000000000000000000000022 +``` + +2. Verify that gas limit value is appropriately updated under "Proxy" at address `0x73a79fab69143498ed3712e519a88a918e1f4072`: + +``` +Key: 0x0000000000000000000000000000000000000000000000000000000000000068 +Before: 0x0000000000000000000000000000000000000000000000000000000008954400 +After: 0x0000000000000000000000000000000000000000000000000000000007DE2900 +``` + +#### 3.3. Extract the domain hash and the message hash to approve. + +Now that we have verified the transaction performs the right +operation, we need to extract the domain hash and the message hash to +approve. + +Go back to the "Overview" tab, and find the +`GnosisSafe.checkSignatures` call. This call's `data` parameter +contains both the domain hash and the message hash that will show up +in your Ledger. + +Here is an example screenshot. Note that the value will be +different for each signer: + +![Screenshot 2024-03-07 at 5 49 32 PM](https://github.com/base-org/contract-deployments/assets/84420280/b6b5817f-0d05-4862-b16a-4f7f5f18f036) + +It will be a concatenation of `0x1901`, the domain hash, and the +message hash: `0x1901[domain hash][message hash]`. + +Note down this value. You will need to compare it with the ones +displayed on the Ledger screen at signing. + +### 4. Approve the signature on your ledger + +Once the validations are done, it's time to actually sign the +transaction. Make sure your ledger is still unlocked and run the +following: + +``` shell +make sign-rollback +``` + +> [!IMPORTANT] This is the most security critical part of the +> playbook: make sure the domain hash and message hash in the +> following two places match: + +1. on your Ledger screen. +2. in the Tenderly simulation. You should use the same Tenderly + simulation as the one you used to verify the state diffs, instead + of opening the new one printed in the console. + +There is no need to verify anything printed in the console. There is +no need to open the new Tenderly simulation link either. + +After verification, sign the transaction. You will see the `Data`, +`Signer` and `Signature` printed in the console. Format should be +something like this: + +``` +Data: +Signer:
+Signature: +``` + +Double check the signer address is the right one. + +### 5. Send the output to Facilitator(s) + +Nothing has occurred onchain - these are offchain signatures which +will be collected by Facilitators for execution. Execution can occur +by anyone once a threshold of signatures are collected, so a +Facilitator will do the final execution for convenience. + +Share the `Data`, `Signer` and `Signature` with the Facilitator, and +congrats, you are done! + +## Execute the output + +1. Collect outputs from all participating signers. +2. Concatenate all signatures and export it as the `SIGNATURES` + environment variable, i.e. `export + SIGNATURES="0x[SIGNATURE1][SIGNATURE2]..."`. +3. Run `make execute-upgrade` + +> [!IMPORTANT] IN THE EVENT WE NEED TO PERFORM ROLLBACK +> Repeat the above, but replace the signatures with the signed +> rollback signatures collected, the call `make execute-rollback` diff --git a/mainnet/2024-10-01-increase-gas-limit/foundry.toml b/mainnet/2024-10-01-increase-gas-limit/foundry.toml new file mode 100644 index 0000000..0d7a9ef --- /dev/null +++ b/mainnet/2024-10-01-increase-gas-limit/foundry.toml @@ -0,0 +1,20 @@ +[profile.default] +src = 'src' +out = 'out' +libs = ['lib'] +broadcast = 'records' +fs_permissions = [ {access = "read-write", path = "./"} ] +optimizer = true +optimizer_runs = 999999 +solc_version = "0.8.15" +via-ir = true +remappings = [ + '@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/', + '@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts', + '@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts', + '@rari-capital/solmate/=lib/solmate/', + '@base-contracts/=lib/base-contracts', + '@solady/=lib/solady/src/' +] + +# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file diff --git a/mainnet/2024-10-01-increase-gas-limit/records/UpgradeGasLimit.sol/1/run-1727888979.json b/mainnet/2024-10-01-increase-gas-limit/records/UpgradeGasLimit.sol/1/run-1727888979.json new file mode 100644 index 0000000..3a9baae --- /dev/null +++ b/mainnet/2024-10-01-increase-gas-limit/records/UpgradeGasLimit.sol/1/run-1727888979.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0xed7e69063c77704b24d882df61e0640f92fc81c1f696a27e7814720a665c81dc", + "transactionType": "CALL", + "contractName": null, + "contractAddress": "0x14536667cd30e52c0b458baaccb9fada7046e056", + "function": "execTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)", + "arguments": [ + "0xcA11bde05977b3631167028862bE2a173976CA11", + "0", + "0x82ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000073a79fab69143498ed3712e519a88a918e1f4072000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024b40a817c000000000000000000000000000000000000000000000000000000000895440000000000000000000000000000000000000000000000000000000000", + "1", + "0", + "0", + "0", + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + "0xe20392ad9d53434f8d8e8a494ecc8df24d4c397053473b14f093dc1a944e35a374761628c12c8c12c2c05453575c6a4cef651743438df6a77c09bd92187aacb01b4f6ff10fe354e4c4ec89a339b2ddcc8e57a5d7ed3b6de47a09e399ae8892038b3fa6c7de3d34b55f4ec78d9fa1424701f6d0f2a5c67608c5a543719ade066f8d1c7d9179112e06b3aab0209f941af28b212c316a3132767acaa1bf14e0f10d64a7262e34b5dc2fa3e8879d80d9e3155cd9398a0bd81de93ac7173a77509447bdf01c" + ], + "transaction": { + "from": "0x26c72586fb396325f58718152fefa94e93cf177b", + "to": "0x14536667cd30e52c0b458baaccb9fada7046e056", + "gas": "0x203dc", + "value": "0x0", + "input": "0x6a761202000000000000000000000000ca11bde05977b3631167028862be2a173976ca110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000012482ad56cb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000073a79fab69143498ed3712e519a88a918e1f4072000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024b40a817c0000000000000000000000000000000000000000000000000000000008954400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c3e20392ad9d53434f8d8e8a494ecc8df24d4c397053473b14f093dc1a944e35a374761628c12c8c12c2c05453575c6a4cef651743438df6a77c09bd92187aacb01b4f6ff10fe354e4c4ec89a339b2ddcc8e57a5d7ed3b6de47a09e399ae8892038b3fa6c7de3d34b55f4ec78d9fa1424701f6d0f2a5c67608c5a543719ade066f8d1c7d9179112e06b3aab0209f941af28b212c316a3132767acaa1bf14e0f10d64a7262e34b5dc2fa3e8879d80d9e3155cd9398a0bd81de93ac7173a77509447bdf01c0000000000000000000000000000000000000000000000000000000000", + "nonce": "0x1", + "chainId": "0x1" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x151603f", + "logs": [ + { + "address": "0x73a79fab69143498ed3712e519a88a918e1f4072", + "topics": [ + "0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000002" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000008954400", + "blockHash": "0x4b3300ae320cf29ce2c64815bd02bdeedb11c12adf30b504f6ece51bba2ace08", + "blockNumber": "0x13e9770", + "transactionHash": "0xed7e69063c77704b24d882df61e0640f92fc81c1f696a27e7814720a665c81dc", + "transactionIndex": "0x81", + "logIndex": "0x245", + "removed": false + }, + { + "address": "0x14536667cd30e52c0b458baaccb9fada7046e056", + "topics": [ + "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + ], + "data": "0xfcf91431b8866c0f985d7f59d82af1f1ad64f6e94739b2124c454b17699684af0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4b3300ae320cf29ce2c64815bd02bdeedb11c12adf30b504f6ece51bba2ace08", + "blockNumber": "0x13e9770", + "transactionHash": "0xed7e69063c77704b24d882df61e0640f92fc81c1f696a27e7814720a665c81dc", + "transactionIndex": "0x81", + "logIndex": "0x246", + "removed": false + } + ], + "logsBloom": "0x0400000040000000000000000000000000000000000000000000000004000000000000a000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000420000000000000000000800000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000004000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000020000000000000000040000000000000000000000000008000000000008000000000", + "type": "0x2", + "transactionHash": "0xed7e69063c77704b24d882df61e0640f92fc81c1f696a27e7814720a665c81dc", + "transactionIndex": "0x81", + "blockHash": "0x4b3300ae320cf29ce2c64815bd02bdeedb11c12adf30b504f6ece51bba2ace08", + "blockNumber": "0x13e9770", + "gasUsed": "0x160ba", + "effectiveGasPrice": "0x86b1b9398", + "from": "0x26c72586fb396325f58718152fefa94e93cf177b", + "to": "0x14536667cd30e52c0b458baaccb9fada7046e056", + "contractAddress": null + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1727888979, + "chain": 1, + "commit": "c886565" +} \ No newline at end of file