Skip to content

Commit 40a1ac1

Browse files
authored
Chore: bump gas target to 28 Mgas/s (#279)
* Chore: bump gas target to 28 Mgas/s * Add execution records
1 parent 09a9525 commit 40a1ac1

File tree

5 files changed

+448
-0
lines changed

5 files changed

+448
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
OP_COMMIT=dff5f16c510e7f44f1be0574372ccb08bfec045c
2+
# https://github.com/base/contracts/commit/cdedd0fe728eb1f9d63eaa4c6e59138cfb3803d3 commit with update to RollbackGasLimit
3+
BASE_CONTRACTS_COMMIT=cdedd0fe728eb1f9d63eaa4c6e59138cfb3803d3
4+
5+
L1_SYSTEM_CONFIG_ADDRESS=0x73a79Fab69143498Ed3712e519A88a918e1f4072
6+
SYSTEM_CONFIG_OWNER=0x14536667Cd30e52C0b458BaACcB9faDA7046E056
7+
8+
OLD_GAS_LIMIT=108000000
9+
NEW_GAS_LIMIT=112000000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
include ../../Makefile
2+
include ../.env
3+
include .env
4+
5+
ifndef LEDGER_ACCOUNT
6+
override LEDGER_ACCOUNT = 0
7+
endif
8+
9+
ifndef ROLLBACK_NONCE_OFFSET
10+
override ROLLBACK_NONCE_OFFSET = 1
11+
endif
12+
13+
.PHONY: sign-upgrade
14+
sign-upgrade:
15+
FROM_GAS_LIMIT=$(OLD_GAS_LIMIT) \
16+
TO_GAS_LIMIT=$(NEW_GAS_LIMIT) \
17+
$(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \
18+
forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/SetGasLimit.sol \
19+
--sig "sign()"
20+
21+
.PHONY: execute-upgrade
22+
execute-upgrade:
23+
FROM_GAS_LIMIT=$(OLD_GAS_LIMIT) \
24+
TO_GAS_LIMIT=$(NEW_GAS_LIMIT) \
25+
forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/SetGasLimit.sol \
26+
--sig "run(bytes)" $(SIGNATURES) --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --broadcast
27+
28+
.PHONY: sign-rollback
29+
sign-rollback:
30+
FROM_GAS_LIMIT=$(NEW_GAS_LIMIT) \
31+
TO_GAS_LIMIT=$(OLD_GAS_LIMIT) \
32+
SAFE_NONCE=$(shell expr $$(cast call $(SYSTEM_CONFIG_OWNER) "nonce()" --rpc-url $(L1_RPC_URL) | cast to-dec) + $(ROLLBACK_NONCE_OFFSET)) \
33+
$(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \
34+
forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/SetGasLimit.sol \
35+
--sig "sign()"
36+
37+
.PHONY: execute-rollback
38+
execute-rollback:
39+
FROM_GAS_LIMIT=$(NEW_GAS_LIMIT) \
40+
TO_GAS_LIMIT=$(OLD_GAS_LIMIT) \
41+
SAFE_NONCE=$(shell expr $$(cast call $(SYSTEM_CONFIG_OWNER) "nonce()" --rpc-url $(L1_RPC_URL) | cast to-dec) + $(ROLLBACK_NONCE_OFFSET)) \
42+
forge script --rpc-url $(L1_RPC_URL) lib/base-contracts/script/deploy/l1/SetGasLimit.sol \
43+
--sig "run(bytes)" $(SIGNATURES) --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --broadcast
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
# Update Gas Limit in L1 `SystemConfig`
2+
3+
Status: DONE
4+
5+
## Objective
6+
7+
We are updating the gas limit to improve TPS and reduce gas fees.
8+
9+
This runbook invokes the following script which allows our signers to sign the same call with two different sets of parameters for our Incident Multisig, defined in the [base-org/contracts](https://github.com/base-org/contracts) repository:
10+
11+
`SetGasLimit` -- This script will update the gas limit to our new limit of 108 Mgas if invoked as part of the "upgrade" process, or revert to the old limit of 104 Mgas if invoked as part of the "rollback" process.
12+
13+
The values we are sending are statically defined in the `.env`.
14+
15+
> [!IMPORTANT] We have two transactions to sign. Please follow
16+
> the flow for both "Approving the Update transaction" and
17+
> "Approving the Rollback transaction". Hopefully we only need
18+
> the former, but will have the latter available if needed.
19+
20+
## Approving the Upgrade transaction
21+
22+
### 1. Update repo and move to the appropriate folder:
23+
24+
```
25+
cd contract-deployments
26+
git pull
27+
cd mainnet/2025-03-05-increase-gas-limit
28+
make deps
29+
```
30+
31+
### 2. Setup Ledger
32+
33+
Your Ledger needs to be connected and unlocked. The Ethereum
34+
application needs to be opened on Ledger with the message "Application
35+
is ready".
36+
37+
### 3. Simulate and validate the transaction
38+
39+
Make sure your ledger is still unlocked and run the following.
40+
41+
```shell
42+
make sign-upgrade
43+
```
44+
45+
Once you run the `make sign...` command successfully, you will see a "Simulation link" from the output.
46+
47+
Paste this URL in your browser. A prompt may ask you to choose a
48+
project, any project will do. You can create one if necessary.
49+
50+
Click "Simulate Transaction".
51+
52+
We will be performing 3 validations and then we'll extract the domain hash and
53+
message hash to approve on your Ledger then verify completion:
54+
55+
1. Validate integrity of the simulation.
56+
2. Validate correctness of the state diff.
57+
3. Validate and extract domain hash and message hash to approve.
58+
59+
#### 3.1. Validate integrity of the simulation.
60+
61+
Make sure you are on the "Overview" tab of the tenderly simulation, to
62+
validate integrity of the simulation, we need to check the following:
63+
64+
1. "Network": Check the network is Ethereum Mainnet.
65+
2. "Timestamp": Check the simulation is performed on a block with a
66+
recent timestamp (i.e. close to when you run the script).
67+
3. "Sender": Check the address shown is your signer account. If not,
68+
you will need to determine which “number” it is in the list of
69+
addresses on your ledger.
70+
4. "Success" with a green check mark
71+
72+
#### 3.2. Validate correctness of the state diff.
73+
74+
Now click on the "State" tab. Verify that:
75+
76+
1. Verify that the nonce is incremented for the Incident Multisig under the "GnosisSafeProxy" at address `0x14536667Cd30e52C0b458BaACcB9faDA7046E056`. We should see the nonce increment from 55 to 56:
77+
78+
```
79+
Key: 0x0000000000000000000000000000000000000000000000000000000000000005
80+
Before: 0x0000000000000000000000000000000000000000000000000000000000000038
81+
After: 0x0000000000000000000000000000000000000000000000000000000000000039
82+
```
83+
84+
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 104000000 to 108000000:
85+
86+
```
87+
Key: 0x0000000000000000000000000000000000000000000000000000000000000068
88+
Before: 0x00000000000000000000000000000000000000000000000000000000066ff300
89+
After: 0x0000000000000000000000000000000000000000000000000000000006acfc00
90+
```
91+
92+
#### 3.3. Extract the domain hash and the message hash to approve.
93+
94+
Now that we have verified the transaction performs the right
95+
operation, we need to extract the domain hash and the message hash to
96+
approve.
97+
98+
Go back to the "Overview" tab, and find the
99+
`GnosisSafe.checkSignatures` call. This call's `data` parameter
100+
contains both the domain hash and the message hash that will show up
101+
in your Ledger.
102+
103+
Here is an example screenshot. Note that the value will be
104+
different for each signer:
105+
106+
![Screenshot 2024-03-07 at 5 49 02 PM](https://github.com/base-org/contract-deployments/assets/84420280/1b7905f1-1350-4634-a804-7b4458d0ddc9)
107+
108+
It will be a concatenation of `0x1901`, the domain hash, and the
109+
message hash: `0x1901[domain hash][message hash]`.
110+
111+
Note down this value. You will need to compare it with the ones
112+
displayed on the Ledger screen at signing.
113+
114+
### 4. Approve the signature on your ledger
115+
116+
Once the validations are done, it's time to actually sign the
117+
transaction. Make sure your ledger is still unlocked and run the
118+
following:
119+
120+
```shell
121+
make sign-upgrade
122+
```
123+
124+
> [!IMPORTANT] This is the most security critical part of the
125+
> playbook: make sure the domain hash and message hash in the
126+
> following two places match:
127+
128+
1. on your Ledger screen.
129+
2. in the Tenderly simulation. You should use the same Tenderly
130+
simulation as the one you used to verify the state diffs, instead
131+
of opening the new one printed in the console.
132+
133+
There is no need to verify anything printed in the console. There is
134+
no need to open the new Tenderly simulation link either.
135+
136+
After verification, sign the transaction. You will see the `Data`,
137+
`Signer` and `Signature` printed in the console. Format should be
138+
something like this:
139+
140+
```
141+
Data: <DATA>
142+
Signer: <ADDRESS>
143+
Signature: <SIGNATURE>
144+
```
145+
146+
Double check the signer address is the right one.
147+
148+
### 5. Send the output to Facilitator(s)
149+
150+
Nothing has occurred onchain - these are offchain signatures which
151+
will be collected by Facilitators for execution. Execution can occur
152+
by anyone once a threshold of signatures are collected, so a
153+
Facilitator will do the final execution for convenience.
154+
155+
Share the `Data`, `Signer` and `Signature` with the Facilitator, and
156+
congrats, you are done!
157+
158+
## Approving the Rollback transaction
159+
160+
Complete the above steps for `Approving the Update transaction` before continuing below.
161+
162+
### 1. Simulate and validate the transaction
163+
164+
Make sure your ledger is still unlocked and run the following.
165+
166+
```shell
167+
make sign-rollback
168+
```
169+
170+
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".
171+
172+
We will be performing 3 validations and then we'll extract the domain hash and
173+
message hash to approve on your Ledger then verify completion:
174+
175+
1. Validate integrity of the simulation.
176+
2. Validate correctness of the state diff.
177+
3. Validate and extract domain hash and message hash to approve.
178+
4. Validate that the transaction completed successfully
179+
180+
#### 3.1. Validate integrity of the simulation.
181+
182+
Make sure you are on the "Overview" tab of the tenderly simulation, to
183+
validate integrity of the simulation, we need to check the following:
184+
185+
1. "Network": Check the network is Ethereum Mainnet.
186+
2. "Timestamp": Check the simulation is performed on a block with a
187+
recent timestamp (i.e. close to when you run the script).
188+
3. "Sender": Check the address shown is your signer account. If not,
189+
you will need to determine which “number” it is in the list of
190+
addresses on your ledger.
191+
4. "Success" with a green check mark
192+
193+
#### 3.2. Validate correctness of the state diff.
194+
195+
Now click on the "State" tab. Verify that:
196+
197+
1. Verify that the nonce is incremented for the Incident Multisig under the "GnosisSafeProxy" at address `0x14536667Cd30e52C0b458BaACcB9faDA7046E056`:
198+
199+
```
200+
Key: 0x0000000000000000000000000000000000000000000000000000000000000005
201+
Before: 0x0000000000000000000000000000000000000000000000000000000000000039
202+
After: 0x000000000000000000000000000000000000000000000000000000000000003a
203+
```
204+
205+
2. Verify that gas limit value is appropriately updated under "Proxy" at address `0x73a79fab69143498ed3712e519a88a918e1f4072`:
206+
207+
```
208+
Key: 0x0000000000000000000000000000000000000000000000000000000000000068
209+
Before: 0x0000000000000000000000000000000000000000000000000000000006acfc00
210+
After: 0x00000000000000000000000000000000000000000000000000000000066ff300
211+
```
212+
213+
#### 3.3. Extract the domain hash and the message hash to approve.
214+
215+
Now that we have verified the transaction performs the right
216+
operation, we need to extract the domain hash and the message hash to
217+
approve.
218+
219+
Go back to the "Overview" tab, and find the
220+
`GnosisSafe.checkSignatures` call. This call's `data` parameter
221+
contains both the domain hash and the message hash that will show up
222+
in your Ledger.
223+
224+
Here is an example screenshot. Note that the value will be
225+
different for each signer:
226+
227+
![Screenshot 2024-03-07 at 5 49 32 PM](https://github.com/base-org/contract-deployments/assets/84420280/b6b5817f-0d05-4862-b16a-4f7f5f18f036)
228+
229+
It will be a concatenation of `0x1901`, the domain hash, and the
230+
message hash: `0x1901[domain hash][message hash]`.
231+
232+
Note down this value. You will need to compare it with the ones
233+
displayed on the Ledger screen at signing.
234+
235+
### 4. Approve the signature on your ledger
236+
237+
Once the validations are done, it's time to actually sign the
238+
transaction. Make sure your ledger is still unlocked and run the
239+
following:
240+
241+
```shell
242+
make sign-rollback
243+
```
244+
245+
> [!IMPORTANT] This is the most security critical part of the
246+
> playbook: make sure the domain hash and message hash in the
247+
> following two places match:
248+
249+
1. on your Ledger screen.
250+
2. in the Tenderly simulation. You should use the same Tenderly
251+
simulation as the one you used to verify the state diffs, instead
252+
of opening the new one printed in the console.
253+
254+
There is no need to verify anything printed in the console. There is
255+
no need to open the new Tenderly simulation link either.
256+
257+
After verification, sign the transaction. You will see the `Data`,
258+
`Signer` and `Signature` printed in the console. Format should be
259+
something like this:
260+
261+
```
262+
Data: <DATA>
263+
Signer: <ADDRESS>
264+
Signature: <SIGNATURE>
265+
```
266+
267+
Double check the signer address is the right one.
268+
269+
### 5. Send the output to Facilitator(s)
270+
271+
Nothing has occurred onchain - these are offchain signatures which
272+
will be collected by Facilitators for execution. Execution can occur
273+
by anyone once a threshold of signatures are collected, so a
274+
Facilitator will do the final execution for convenience.
275+
276+
Share the `Data`, `Signer` and `Signature` with the Facilitator, and
277+
congrats, you are done!
278+
279+
## Execute the output
280+
281+
1. Collect outputs from all participating signers.
282+
2. Concatenate all signatures and export it as the `SIGNATURES`
283+
environment variable, i.e. `export
284+
SIGNATURES="0x[SIGNATURE1][SIGNATURE2]..."`.
285+
3. Run `make execute-upgrade`
286+
287+
> [!IMPORTANT] IN THE EVENT WE NEED TO PERFORM ROLLBACK
288+
> Repeat the above, but replace the signatures with the signed
289+
> rollback signatures collected, the call `make execute-rollback`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[profile.default]
2+
src = 'src'
3+
out = 'out'
4+
libs = ['lib']
5+
broadcast = 'records'
6+
fs_permissions = [ {access = "read-write", path = "./"} ]
7+
optimizer = true
8+
optimizer_runs = 999999
9+
solc_version = "0.8.15"
10+
via-ir = false
11+
remappings = [
12+
'@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/',
13+
'@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts',
14+
'@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts',
15+
'@rari-capital/solmate/=lib/solmate/',
16+
'@base-contracts/=lib/base-contracts',
17+
'@solady/=lib/solady/src/'
18+
]
19+
20+
# See more config options https://github.com/foundry-rs/foundry/tree/master/config

0 commit comments

Comments
 (0)