Skip to content

Commit 22230bd

Browse files
committed
docs: improve deploy_new_impl and propose_upgrade
1 parent f3a7624 commit 22230bd

File tree

2 files changed

+22
-124
lines changed

2 files changed

+22
-124
lines changed

docs/0_internal/3_b_1_deploy_new_impl.md

Lines changed: 13 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22

33
To deploy a new implementation, you can follow the steps below.
44

5+
56
## Prerequisites
67

78
1. Make sure you have set variables as specified in the [Deploy Contracts Guide](./2_deploy_contracts.md).
89

910
2. Set ```MULTISIG=true``` on the ```.env``` used to deploy. ```contracts/scripts/.env.mainnet``` or ```contracts/scripts/.env.holesky``` or ```contracts/scripts/.env.sepolia```
1011

11-
## What contracts can be upgraded?
12-
13-
You can deploy the new implementation of the following contracts:
14-
15-
- AlignedLayerServiceManager
16-
- BatcherPaymentService
1712

1813
## Deploy New Implementation for AlignedLayerServiceManager
1914

@@ -39,36 +34,16 @@ You can deploy the new implementation of the following contracts:
3934

4035
If the new implementation is correctly deployed, the terminal will show the following message:
4136

42-
```sh
37+
```
4338
The new aligned layer service manager implementation is <new_aligned_layer_service_manager_implementation>
4439

4540
You can propose the upgrade transaction with the multisig using this calldata
46-
<calldata>
47-
```
48-
49-
You should save this `calldata` for later use.
50-
51-
2. Get the `upgrade` function signature:
52-
53-
```sh
54-
cast sig "upgrade(address, address)"
41+
<calldata>
5542
```
5643
57-
This will show the `upgrade` signature hash: `0x99a88ec4`.
58-
59-
Verify the first 8 digits of the `calldata` are the same as the signature hash obtained in this step.
60-
61-
3. Validate the contracts addresses of the `calldata` by running:
62-
63-
```sh
64-
cast calldata-decode "upgrade(address, address)" <calldata>
65-
```
66-
67-
This will show two addresses. The first one is the `alignedLayerServiceManager` address, and the second one is the new implementation address of `alignedServiceManagerImplementation`.
68-
69-
Make sure the `alignedLayerServiceManager` address is the same as the one you deployed in the [Deploy Contracts Guide](./2_deploy_contracts.md).
44+
Also, the ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json``` file will be updated with the new implementation address depending on the network you are deploying.
7045
71-
Make sure the `alignedServiceManagerImplementation` address is the same as the one you deployed in this guide.
46+
2. Create a PR with the new address for the AlignedLayerServiceManagerImplementation.
7247
7348
7449
## Deploy New Implementation for BatcherPaymentService
@@ -95,33 +70,18 @@ You can deploy the new implementation of the following contracts:
9570
9671
If the new implementation is correctly deployed, the script will show the following message:
9772
98-
`You can propose the upgrade transaction with the multisig using this calldata <calldata>`
99-
100-
You should save this `calldata` for later use.
101-
102-
2. Get the `upgradeTo` function signature:
103-
104-
```bash
105-
cast sig "upgradeTo(address)"
106-
```
107-
108-
This will show the `upgradeTo` signature hash: `0x3659cfe6`.
109-
110-
Verify the first 8 digits of the `calldata` are the same as the signature hash obtained in this step.
111-
112-
3. Validate the `calldata` by running:
113-
114-
```shell
115-
cast calldata-decode "upgradeTo(address)" <calldata>
11673
```
117-
118-
This will show the `batcherPaymentServiceImplementation` address.
74+
The new Batcher Payment Service Implementation is <new_batcher_payment_service_implementation>
11975

120-
Make sure the `batcherPaymentServiceImplementation` address is the same as the one you deployed in this guide.
76+
You can propose the upgrade transaction with the multisig using this calldata
77+
<calldata>
78+
```
79+
80+
Also, the ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json``` file will be updated with the new implementation address depending on the network you are deploying.
81+
82+
2. Create a PR with the new address for the BatcherPaymentServiceImplementation.
12183
12284
12385
## Next Steps
12486
12587
Once you have deployed the new implementation of the contract you want to upgrade, you need to propose the upgrade transaction to the mulstisig, following this [guide](./3_b_2_propose_upgrade.md).
126-
127-
You must also send the contracts addresses and `calldata` you gathered from this guide, to all the multisig participants.

docs/0_internal/3_b_2_propose_upgrade.md

Lines changed: 9 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,33 @@
22

33
After deploying a new implementation candidate for the upgrade, you need to propose the upgrade transaction using the multisig wallet.
44

5-
## Prerequisites
6-
7-
- You need to have deployed the new implementation following the [Deploy New Implementation Guide](./3_b_1_deploy_new_impl.md).
8-
9-
- Upgrade `calldata` obtained from the deployment of the new implementation.
10-
115
## Propose transaction
126

137
To propose the upgrade transaction you can follow the steps below:
148

15-
1. Get the function signature
16-
17-
If you are upgrading the AlignedLayerServiceManager or the RegistryCoordinator, you can get the function signature by running:
18-
19-
```bash
20-
cast sig "upgrade(address, address)"
21-
```
22-
23-
This will show the `upgrade` signature hash: `0x99a88ec4`.
9+
1. If you want to upgrade the ```alignedLayerServiceManager``` get the ```alignedLayerServiceManager``` and ```alignedServiceManagerImplementation``` address from ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json```.
10+
11+
If you want to upgrade the ```batcherPaymentService``` get the ```batcherPaymentServiceImplementation``` address from ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json```.
2412

25-
Else, if you are upgrading the BatcherPaymentService, you can get the function signature by running:
13+
2. If you want to upgrade the ```alignedLayerServiceManager``` generate the `calldata` for the upgrade transaction by running:
2614

2715
```bash
28-
cast sig "upgradeTo(address)"
16+
cast calldata "upgrade(address, address)" <alignedLayerServiceManager> <alignedLayerServiceManagerImplementation>
2917
```
3018

31-
This will show the `upgradeTo` signature hash: `0x3659cfe6`.
32-
33-
2. Validate the calldata
34-
35-
If you are upgrading the AlignedLayerServiceManager or the RegistryCoordinator, you can validate the calldata by running:
19+
If you want to upgrade the ```batcherPaymentService``` generate the `calldata` for the upgrade transaction by running:
3620

3721
```bash
38-
cast calldata-decode "upgrade(address, address)" <calldata>
39-
```
40-
41-
This will show two addresses.
42-
43-
If you are upgrading the AlignmentLayerServiceManager, the first one is the `alignedLayerServiceManager` address, and the second one is the new implementation address of `alignedServiceManagerImplementation`.
44-
45-
If you are upgrading the RegistryCoordinator, the first one is the `registryCoordinator` address, and the second one is the new implementation address of `registryCoordinatorImplementation`.
46-
47-
> [!NOTE]
48-
> The first 10 characters must be the same the signature hash obtained in the previous step.
49-
>
50-
> Make sure the `alignedLayerServiceManager` address is the same as the one you deployed in the [Deploy Contracts Guide](./2_deploy_contracts.md).
51-
>
52-
> Make sure the `alignedServiceManagerImplementation` address is the same as the one you deployed in this guide.
53-
54-
Else, if you are upgrading the BatcherPaymentService, you can validate the calldata by running:
55-
56-
```bash
57-
cast calldata-decode "upgradeTo(address)" <calldata>
22+
cast calldata "upgradeTo(address)" <batcherPaymentServiceImplementation>
5823
```
5924

60-
This will show the `batcherPaymentServiceImplementation` address.
61-
62-
> [!NOTE]
63-
> The first 10 characters must be the same the signature hash obtained in the previous step.
64-
>
65-
> Make sure the `batcherPaymentServiceImplementation` address is the same as the one you deployed in this guide.
66-
6725
3. Verify the contract bytecode running the following command:
6826

6927
```
7028
TODO
7129
```
7230
73-
4. Once the calldata and the proposed upgrade are validated, you can create the upgrade transaction on [Safe](https://app.safe.global/home)
31+
4. Once the proposed upgrade is validated, you can create the upgrade transaction on [Safe](https://app.safe.global/home)
7432
7533
5. Click on `New transaction` -> `Transaction Builder`
7634
@@ -80,27 +38,7 @@ To propose the upgrade transaction you can follow the steps below:
8038
8139
6. Enable `Custom data`
8240
83-
7. Get the `ProxyAdmin` address, and paste it on `Enter Address or ENS Name`
84-
85-
To get the `ProxyAdmin` address the following command will copy the address to the clipboard:
86-
87-
```bash
88-
# SEPOLIA
89-
jq -r ".addresses.alignedLayerProxyAdmin" contracts/script/output/sepolia/alignedlayer_deployment_output.json | pbcopy
90-
```
91-
92-
```bash
93-
# HOLESKY
94-
jq -r ".addresses.alignedLayerProxyAdmin" contracts/script/output/holesky/alignedlayer_deployment_output.json | pbcopy
95-
```
96-
97-
```bash
98-
# MAINNET
99-
jq -r ".addresses.alignedLayerProxyAdmin" contracts/script/output/mainnet/alignedlayer_deployment_output.json | pbcopy
100-
```
101-
102-
> [!NOTE]
103-
> Make sure to set the path to the correct deployment output file.
41+
7. Get the `ProxyAdmin` address from ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json```, and paste it on `Enter Address or ENS Name`
10442
10543
8. Once you paste the `ProxyAdmin` address, the ABI should be automatically filled.
10644

0 commit comments

Comments
 (0)