Skip to content

Commit c266254

Browse files
committed
add WIP template for gas and elasticity increase
1 parent 5fc93d3 commit c266254

File tree

8 files changed

+340
-3
lines changed

8 files changed

+340
-3
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FOUNDRY_COMMIT ?= 3b1129b5bc43ba22a9bcf4e4323c5a9df0023140
22

33
PROJECT_DIR = $(network)/$(shell date +'%Y-%m-%d')-$(task)
44
GAS_INCREASE_DIR = $(network)/$(shell date +'%Y-%m-%d')-increase-gas-limit
5+
GAS_AND_ELASTICITY_INCREASE_DIR = $(network)/$(shell date +'%Y-%m-%d')-increase-gas-and-elasticity-limit
56
FAULT_PROOF_UPGRADE_DIR = $(network)/$(shell date +'%Y-%m-%d')-upgrade-fault-proofs
67
SAFE_MANAGEMENT_DIR = $(network)/$(shell date +'%Y-%m-%d')-safe-swap-owner
78
FUNDING_DIR = $(network)/$(shell date +'%Y-%m-%d')-funding
@@ -10,6 +11,7 @@ PAUSE_BRIDGE_BASE_DIR = $(network)/$(shell date +'%Y-%m-%d')-pause-bridge-base
1011

1112
TEMPLATE_GENERIC = setup-templates/template-generic
1213
TEMPLATE_GAS_INCREASE = setup-templates/template-gas-increase
14+
TEMPLATE_GAS_AND_ELASTICITY_INCREASE = setup-templates/template-gas-and-elasticity-increase
1315
TEMPLATE_UPGRADE_FAULT_PROOFS = setup-templates/template-upgrade-fault-proofs
1416
TEMPLATE_SAFE_MANAGEMENT = setup-templates/template-safe-management
1517
TEMPLATE_FUNDING = setup-templates/template-funding
@@ -39,6 +41,11 @@ setup-gas-increase:
3941
rm -rf $(TEMPLATE_GAS_INCREASE)/cache $(TEMPLATE_GAS_INCREASE)/lib $(TEMPLATE_GAS_INCREASE)/out
4042
cp -r $(TEMPLATE_GAS_INCREASE) $(GAS_INCREASE_DIR)
4143

44+
# Run `make setup-gas-increase network=<network>`
45+
setup-gas-and-elasticity-increase:
46+
rm -rf $(TEMPLATE_GAS_AND_ELASTICITY_INCREASE)/cache $(TEMPLATE_GAS_AND_ELASTICITY_INCREASE)/lib $(TEMPLATE_GAS_AND_ELASTICITY_INCREASE)/out
47+
cp -r $(TEMPLATE_GAS_AND_ELASTICITY_INCREASE) $(GAS_AND_ELASTICITY_INCREASE_DIR)
48+
4249
# Run `make setup-upgrade-fault-proofs network=<network>`
4350
setup-upgrade-fault-proofs:
4451
cp -r $(TEMPLATE_UPGRADE_FAULT_PROOFS) $(FAULT_PROOF_UPGRADE_DIR)
@@ -112,7 +119,7 @@ checkout-base-contracts-commit:
112119
##
113120
# Task Signer Tool
114121
##
115-
SIGNER_TOOL_COMMIT=dc9dcd57e66cc71d8e8f40afc2d0bad454cba998
122+
SIGNER_TOOL_COMMIT=92a4b600252cd7ffe255a876a880c2540802b99c
116123
SIGNER_TOOL_PATH=signer-tool
117124

118125
.PHONY: checkout-signer-tool

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ To execute a new task, run one of the following commands (depending on the type
3737

3838
- For a generic task: `make setup-task network=<network> task=<task-name>`
3939
- For gas increase tasks: `make setup-gas-increase network=<network>`
40+
- For combined gas and elasticity increase tasks: `make setup-gas-and-elasticity-increase network=<network>`
4041
- For funding: `make setup-funding network=<network>`
4142
- For fault proof upgrade: `make setup-upgrade-fault-proofs network=<network>`
4243
- For safe management tasks: `make setup-safe-management network=<network>`
43-
- For funding tasks: `make setup-funding network=<network>`
4444
- For updating the partner threshold in Base Bridge: `make setup-bridge-partner-threshold network=<network>`
4545
- For pausing / un-pausing Base Bridge: `make setup-bridge-pause network=<network>`
4646

4747
Next, `cd` into the directory that was created for you and follow the steps listed below for the relevant template.
4848

4949
> **👥 For Signers:** Please read the [Signer Guide](SIGNER.md) for step-by-step instructions on using the validation UI.
5050
51-
Please note, you will need to manually create validation file(s) for your task as they are bespoke to each task and therefore not created automatically as a part of the templates. We use one validation Markdown file per multisig involved in the task, so if there's only one multisig involved in your task, then you can simply create a `VALIDATION.md` file at the root of your task containing the validation instructions, while if there are multiple multisigs involved in the task, then create a `validations/` sub-directory at the root of your task containing the corresponding validation Markdown files. If you need examples to work from, you can browse through similar past tasks in this repo and adapt them to your specific task. Also, please note that we have tooling to generate these files (like the `task-signer-tool`) which removes the manual aspect of creating these validation files, we will soon update these instructions to reflect how this process can be automated.
51+
Please note, for some older tasks (that have not yet been adapted to use the signer tool) you will need to manually create validation file(s) for your task as they are bespoke to each task and therefore not created automatically as a part of the templates. We use one validation Markdown file per multisig involved in the task, so if there's only one multisig involved in your task, then you can simply create a `VALIDATION.md` file at the root of your task containing the validation instructions, while if there are multiple multisigs involved in the task, then create a `validations/` sub-directory at the root of your task containing the corresponding validation Markdown files. If you need examples to work from, you can browse through similar past tasks in this repo and adapt them to your specific task. Also, please note that we have tooling to generate these files (like the `task-signer-tool`) which removes the manual aspect of creating these validation files, we will soon update these instructions to reflect how this process can be automated.
5252

5353
## Directory structure
5454

@@ -96,6 +96,22 @@ This template is increasing the throughput on Base Chain.
9696
1. Check in the task when it's ready to sign and collect signatures from signers
9797
1. Once executed, check in the records files and mark the task `EXECUTED` in the README.
9898

99+
## Using the combined gas limit and elasticity increase template
100+
101+
This template is used to increase the gas limit and elasticity or roll back the upgrade (if needed).
102+
103+
1. Ensure you have followed the instructions above in `setup`, including running `make setup-gas-and-elasticity-increase network=<network>` and then go to the folder that was created by this command.
104+
1. Specify the commit of [Optimism code](https://github.com/ethereum-optimism/optimism) and [Base contracts code](https://github.com/base/contracts), and the new / old gas limit and elasticity, as well the other env vars marked with a TODO, in the `.env` file.
105+
1. Run `make deps`.
106+
1. Ensure only the Sepolia or Mainnet variables are in the `.env` file depending on what network this task is for.
107+
1. Ensure the `SENDER` variable in the `.env` file is set to a signer of `OWNER_SAFE`.
108+
1. Build the contracts with `forge build`.
109+
1. Generate the validation file for signers with `make gen-validation`.
110+
1. Generate the rollback validation file for signers with `make gen-validation-rollback`.
111+
1. Appropriately fill in both of the generated validation files 6 empty fields at the top of the generated validations files (e.g. "taskName", "scriptName", etc.).
112+
1. Check in the task when it's ready to sign and request the facilitators to collect signatures from signers.
113+
1. Once executed, check in the records files and mark the task `EXECUTED` in the README.
114+
99115
## Using the fault proof upgrade template
100116

101117
This template is used to upgrade the fault proof contracts. This is commonly done in conjunction with a hard fork.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
OP_COMMIT=TODO # Recommend using the version of https://github.com/ethereum-optimism/optimism that the current SystemConfig contract is on
2+
BASE_CONTRACTS_COMMIT=TODO # Recommend using the latest version of https://github.com/base-org/contracts
3+
4+
# TODO: ensure `SYSTEM_CONFIG` is correct on the given network
5+
SYSTEM_CONFIG=0x73a79Fab69143498Ed3712e519A88a918e1f4072
6+
# TODO: ensure `OWNER_SAFE` is correct on the given network
7+
OWNER_SAFE=0x14536667Cd30e52C0b458BaACcB9faDA7046E056
8+
9+
OLD_GAS_LIMIT=TODO
10+
NEW_GAS_LIMIT=TODO
11+
12+
OLD_ELASTICITY=TODO
13+
NEW_ELASTICITY=TODO
14+
15+
# TODO: ensure `SENDER` is a signer for `OWNER_SAFE` on the given network
16+
SENDER=0x1841CB3C2ce6870D0417844C817849da64E6e937
17+
18+
RECORD_STATE_DIFF=true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Facilitator Guide
2+
3+
Guide for facilitators after collecting signatures from signers.
4+
5+
### 1. Update repo:
6+
7+
```bash
8+
cd contract-deployments
9+
git pull
10+
cd mainnet/TODO
11+
make deps
12+
```
13+
14+
### 2. Execute upgrade
15+
16+
```bash
17+
SIGNATURES=AAABBBCCC make execute
18+
```
19+
20+
### 3. (**ONLY** if needed) Execute upgrade rollback
21+
22+
> [!IMPORTANT] THIS SHOULD ONLY BE PERFORMED IN THE EVENT THAT WE NEED TO ROLLBACK
23+
24+
```bash
25+
SIGNATURES=AAABBBCCC make execute-rollback
26+
```
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
include ../../Makefile
2+
include ../../Multisig.mk
3+
4+
include ../.env
5+
include .env
6+
7+
ifndef LEDGER_ACCOUNT
8+
override LEDGER_ACCOUNT = 0
9+
endif
10+
11+
ifndef ROLLBACK_NONCE_OFFSET
12+
override ROLLBACK_NONCE_OFFSET = 1
13+
endif
14+
15+
SCRIPT = IncreaseEip1559ElasticityAndIncreaseGasLimitScript
16+
17+
# Map .env values and export them for child processes
18+
export OLD_GAS_LIMIT NEW_GAS_LIMIT OLD_ELASTICITY NEW_ELASTICITY OWNER_SAFE SYSTEM_CONFIG
19+
20+
.PHONY: gen-validation
21+
gen-validation: checkout-signer-tool run-script
22+
23+
.PHONY: run-script
24+
run-script:
25+
cd $(SIGNER_TOOL_PATH); \
26+
npm ci; \
27+
bun run scripts/genValidationFile.ts --rpc-url $(L1_RPC_URL) \
28+
--workdir .. --forge-cmd 'forge script --rpc-url $(L1_RPC_URL) \
29+
$(SCRIPT) --sig "sign(address[])" [] --sender $(SENDER)' --out ../validations/base-signer-upgrade.json;
30+
31+
.PHONY: execute
32+
execute:
33+
$(call MULTISIG_EXECUTE,$(SIGNATURES))
34+
35+
# TODO: Add rollback commands once config parameter (containing full commands) is added to the signer tool
36+
37+
# Manually swap the old and new values for the gas limit and elasticity when passing them in for the rollback
38+
39+
# .PHONY: gen-validation-rollback
40+
# gen-validation-rollback: checkout-signer-tool run-script-rollback
41+
42+
# .PHONY: run-script-rollback
43+
# run-script-rollback:
44+
# cd $(SIGNER_TOOL_PATH); \
45+
# npm ci; \
46+
# OLD_GAS_LIMIT="$(NEW_GAS_LIMIT)" NEW_GAS_LIMIT="$(OLD_GAS_LIMIT)" \
47+
# NEW_ELASTICITY="$(OLD_ELASTICITY)" OLD_ELASTICITY="$(NEW_ELASTICITY)" \
48+
# bun run scripts/genValidationFile.ts --rpc-url $(L1_RPC_URL) \
49+
# --workdir .. --forge-cmd 'forge script --rpc-url $(L1_RPC_URL) \
50+
# $(SCRIPT) --sig "sign(address[])" [] --sender $(SENDER)' --out ../validations/base-signer-rollback.json;
51+
52+
# .PHONY: execute-rollback
53+
# execute-rollback:
54+
# $(call MULTISIG_EXECUTE,$(SIGNATURES))
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Update Gas Limit & Elasticity in L1 `SystemConfig`
2+
3+
Status: TODO[READY TO SIGN|DONE]
4+
5+
## Description
6+
7+
We are updating the gas limit and elasticity 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/contracts) repository:
10+
11+
`IncreaseEip1559ElasticityAndIncreaseGasLimitScript` -- This script will update the gas limit to our new limit of TODO gas and TODO elasticity if invoked as part of the "upgrade" process, or revert to the old limit of TODO gas and TODO elasticity if invoked as part of the "rollback" process.
12+
13+
The values we are sending are statically defined in the `.env` file.
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+
## Install dependencies
21+
22+
### 1. Update foundry
23+
24+
```bash
25+
foundryup
26+
```
27+
28+
### 2. Install Node.js if needed
29+
30+
First, check if you have node installed
31+
32+
```bash
33+
node --version
34+
```
35+
36+
If you see a version output from the above command, you can move on. Otherwise, install node
37+
38+
```bash
39+
brew install node
40+
```
41+
42+
## Approving the Update transaction
43+
44+
### 1. Update repo:
45+
46+
```bash
47+
cd contract-deployments
48+
git pull
49+
```
50+
51+
### 2. Run the signing tool (NOTE: do not enter the task directory. Run this command from the project's root).
52+
53+
```bash
54+
make sign-task
55+
```
56+
57+
### 3. Open the UI at [http://localhost:3000](http://localhost:3000)
58+
59+
Be sure to select the correct task from the list of available tasks to sign (**not** the rollback task).
60+
61+
### 4. Send signature to facilitator
62+
63+
## Approving the Rollback transaction
64+
65+
Complete the above steps for `Approving the Update transaction` before continuing below.
66+
67+
### 1. Update repo:
68+
69+
```bash
70+
cd contract-deployments
71+
git pull
72+
```
73+
74+
### 2. Run the signing tool (NOTE: do not enter the task directory. Run this command from the project's root).
75+
76+
```bash
77+
make sign-task
78+
```
79+
80+
### 3. Open the UI at [http://localhost:3000](http://localhost:3000)
81+
82+
Be sure to select the correct task from the list of available tasks to sign (ensure it **is** the rollback task).
83+
84+
### 4. Send signature to facilitator
Lines changed: 20 additions & 0 deletions
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)