Skip to content

Commit 2c2d1db

Browse files
committed
docs: guide for multisig upgrade [WIP]
1 parent 3a92154 commit 2c2d1db

File tree

8 files changed

+257
-30
lines changed

8 files changed

+257
-30
lines changed
Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
{
22
"addresses": {
3-
"alignedLayerProxyAdmin": "0x9c50f5054784d6c5523C79c3aFA82E3184430CaC",
4-
"alignedLayerServiceManager": "0xD0fAb108d175765f70Dd2e929b74ec107db6E0e8",
5-
"alignedLayerServiceManagerImplementation": "0xbC86427A646540cF78c92F6C7432716460b97a06",
6-
"blsApkRegistry": "0x9A5B215027F85319957a3a92205BFc18529d9309",
7-
"blsApkRegistryImplementation": "0xEAE702d667bD851C9cAa59e71b23765Bea04A5aF",
8-
"indexRegistry": "0xD316A01F902d0fDF169a53AB22daB38c06c6E60E",
9-
"indexRegistryImplementation": "0x8009D6A252a41bc8fb648F71F3aa78d08231221d",
10-
"operatorStateRetriever": "0xc24023c7e43Dc6A407b1B961A6602ee6d5408A75",
11-
"registryCoordinator": "0x9C04afc13D57608a867E61BD91a10d8689B24ff8",
12-
"registryCoordinatorImplementation": "0xFc326289eF3d5ba5E525e27530329727831E834B",
13-
"serviceManagerRouter": "0x074c28d7ff24c06ab747e08772ed582c3b7C887e",
14-
"stakeRegistry": "0x1888568D57Cf6834d74ef62A78e7EF1ADbd55582",
15-
"stakeRegistryImplementation": "0x05671b5B23d16B2e198729b9Ce94696780d384b9",
16-
"batcherPaymentService": "0x4a40a9F0D29B62a2852ed893B18fAD9CfEcB14FA",
17-
"batcherPaymentServiceImplementation": "0xc40562950D62e3DbFf881149cf07833Cd0A425A9"
3+
"alignedLayerProxyAdmin": "0x6b0E241bFf4A1596E0E826E55Cc285D7E2E7A45D",
4+
"alignedLayerServiceManager": "0xc3F9c9f9CABdCe9679F5Aa184b02369f1c2A4E16",
5+
"alignedLayerServiceManagerImplementation": "0xc0A467b8Bdb6963fE922c07939c47FA7Ae7b97cC",
6+
"blsApkRegistry": "0xBDdBd0869b10079c5B00B8Da9B6e22A2C4a99040",
7+
"blsApkRegistryImplementation": "0xAf33669eb4c062c1cdc756d96a43a1e734d9BC35",
8+
"indexRegistry": "0x77042702606eC5A3c9d49a550dEE400681691c08",
9+
"indexRegistryImplementation": "0x4A89A4986c4cfeFb9e59DB0923851824E1C66013",
10+
"operatorStateRetriever": "0xfe8009EfD51FCD1BCf09712C9719e6EB3796546a",
11+
"pauserRegistry": "0x42a3879a99Ddfd56a763415a3a33529bd1699112",
12+
"registryCoordinator": "0xFfe833f349bE163EFa2fAa39f0dA2Ac37dB04857",
13+
"registryCoordinatorImplementation": "0xf0A6F3d339bE498d04fE00cD328D0B4f3b475409",
14+
"serviceManagerRouter": "0x73D68e630b4aAa35f01c4735914c55c5c3181672",
15+
"stakeRegistry": "0xB57FA20C97235dA95Cf8e83a15865a3eb659B24a",
16+
"stakeRegistryImplementation": "0x809D99a4357667203cC06fBc7046C236085be843"
1817
},
1918
"chainInfo": {
2019
"chainId": 11155111,
21-
"deploymentBlock": 6833988
20+
"deploymentBlock": 7111030
2221
},
2322
"permissions": {
24-
"alignedLayerAggregator": "0x1380D03142156d8D9950b001A566dc5cc439dE81",
25-
"alignedLayerChurner": "0x1380D03142156d8D9950b001A566dc5cc439dE81",
26-
"alignedLayerEjector": "0x1380D03142156d8D9950b001A566dc5cc439dE81",
27-
"alignedLayerOwner": "0x1380D03142156d8D9950b001A566dc5cc439dE81",
28-
"alignedLayerUpgrader": "0x1380D03142156d8D9950b001A566dc5cc439dE81",
29-
"pauserRegistry": "0xC2316E03d0871f667e75C62181089988Eb4DB7Db"
23+
"alignedLayerAggregator": "0x1Fa835Be4f67eA84617F16917FaF54A4e336F9b0",
24+
"alignedLayerChurner": "0x1Fa835Be4f67eA84617F16917FaF54A4e336F9b0",
25+
"alignedLayerEjector": "0x1Fa835Be4f67eA84617F16917FaF54A4e336F9b0",
26+
"alignedLayerOwner": "0x1Fa835Be4f67eA84617F16917FaF54A4e336F9b0",
27+
"alignedLayerPauser": "0x1Fa835Be4f67eA84617F16917FaF54A4e336F9b0",
28+
"alignedLayerUpgrader": "0x1Fa835Be4f67eA84617F16917FaF54A4e336F9b0"
3029
}
31-
}
30+
}

contracts/scripts/upgrade_aligned_contracts.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ mv "script/output/holesky/alignedlayer_deployment_output.temp.json" $OUTPUT_PATH
5353

5454
data=$(cast calldata "upgrade(address, address)" $aligned_layer_service_manager $new_aligned_layer_service_manager_implementation)
5555

56+
echo "The new AlignedLayerServiceManager Implementation is $new_aligned_layer_service_manager_implementation"
57+
5658
if [ "$MULTISIG" = false ]; then
5759
echo "Executing upgrade transaction"
5860
proxy_admin=$(jq -r '.addresses.alignedLayerProxyAdmin' $OUTPUT_PATH)

contracts/scripts/upgrade_batcher_payment_service.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ rm -f "$OUTPUT_PATH.temp"
4343

4444
data=$(cast calldata "upgradeTo(address)" $batcher_payment_service_implementation)
4545

46+
echo "The new Batcher Payment Service Implementation is $batcher_payment_service_implementation"
47+
4648
if [ "$MULTISIG" = false ]; then
4749
echo "Executing upgrade transaction"
4850
cast send $batcher_payment_service_proxy $data \

contracts/scripts/upgrade_registry_coordinator.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"
4040

4141
data=$(cast calldata "upgrade(address, address)" $registry_coordinator $new_registry_coordinator_implementation)
4242

43+
echo "The new RegistryCoordinator Implementation is $new_registry_coordinator_implementation"
44+
4345
if [ "$MULTISIG" = false ]; then
4446
echo "Executing upgrade transaction"
4547
proxy_admin=$(jq -r '.addresses.alignedLayerProxyAdmin' $OUTPUT_PATH)

docs/0_internal/0_guides.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ This guide will walk you through the deployment of the Aligned Layer contracts.
1515

1616
3. Once you have deployed the Aligned contracts, you can perform upgrades on them.
1717

18-
a. If you are not using a Multisig wallet, you can follow the [Upgrade Guide](./3_a_upgrade_contracts.md).
18+
a. If you are not using a Multisig wallet, you can follow the [Upgrade Guide](./3_a_upgrade_contracts.md).
19+
20+
b. If you are using a Multisig wallet, you can follow the [Upgrade Guide with Multisig](./3_b_upgrade_contracts_with_multisig.md).
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,147 @@
11
# Deploy New Implementation
22

3+
To deploy a new implementation, you can follow the steps below.
34

5+
## Prerequisites
6+
7+
1. Make sure you have set the `.env`, `DEPLOY_CONFIG_PATH` and `BATCHER_PAYMENT_SERVICE_CONFIG_PATH` as specified in the [Deploy Contracts Guide](./2_deploy_contracts.md).
8+
9+
2. Add the following variables to the `.env` file:
10+
11+
```makefile
12+
MULTISIG=true
13+
```
14+
15+
## Deploy New Implementation
16+
17+
You can deploy the new implementation of the following contracts:
18+
19+
- AlignedLayerServiceManager
20+
- BatcherPaymentService
21+
- RegistryCoordinator
22+
23+
### Deploy New Implementation for AlignedLayerServiceManager
24+
25+
1. Deploy the new implementation by running:
26+
27+
```shell
28+
make upgrade_aligned_contracts
29+
```
30+
31+
If the new implementation is correctly deployed, the script will show the following message:
32+
33+
```
34+
The new aligned layer service manager implementation is <new_aligned_layer_service_manager_implementation>
35+
36+
You can propose the upgrade transaction with the multisig using this calldata
37+
<calldata>
38+
```
39+
40+
You should save this `calldata` for later use.
41+
42+
2. Get the `upgrade` function signature:
43+
44+
```
45+
cast sig "upgrade(address, address)"
46+
```
47+
48+
This will show the `upgrade` signature hash: `0x99a88ec4`.
49+
50+
3. Validate the `calldata` by running:
51+
52+
```
53+
cast calldata-decode "upgrade(address, address)" <calldata>
54+
```
55+
56+
This will show two addresses. The first one is the `alignedLayerServiceManager` address, and the second one is the new implementation address of `alignedServiceManagerImplementation`.
57+
58+
> [!NOTE]
59+
>
60+
> Make sure the `alignedLayerServiceManager` address is the same as the one you deployed in the [Deploy Contracts Guide](./2_deploy_contracts.md).
61+
>
62+
> Make sure the `alignedServiceManagerImplementation` address is the same as the one you deployed in this guide.
63+
64+
65+
### Deploy New Implementation for BatcherPaymentService
66+
67+
1. Deploy the new implementation by running:
68+
69+
```shell
70+
make upgrade_batcher_payment_service
71+
```
72+
73+
If the new implementation is correctly deployed, the script will show the following message:
74+
75+
```
76+
You can propose the upgrade transaction with the multisig using this calldata
77+
<calldata>
78+
```
79+
80+
You should save this `calldata` for later use.
81+
82+
2. Get the `upgradeTo` function signature:
83+
84+
```bash
85+
cast sig "upgradeTo(address)"
86+
```
87+
88+
This will show the `upgradeTo` signature hash: `0x3659cfe6`.
89+
90+
3. Validate the `calldata` by running:
91+
92+
```
93+
cast calldata-decode "upgradeTo(address)" <calldata>
94+
```
95+
96+
This will show the `batcherPaymentServiceImplementation` address.
97+
98+
> [!NOTE]
99+
>
100+
> Make sure the `batcherPaymentServiceImplementation` address is the same as the one you deployed in this guide.
101+
102+
103+
### Deploy New Implementation for RegistryCoordinator
104+
105+
1. Deploy the new implementation by running:
106+
107+
```shell
108+
make upgrade_registry_coordinator
109+
```
110+
111+
If the new implementation is correctly deployed, the script will show the following message:
112+
113+
```
114+
You can propose the upgrade transaction with the multisig using this calldata
115+
<calldata>
116+
```
117+
118+
You should save this `calldata` for later use.
119+
120+
2. Get the `upgrade` function signature:
121+
122+
```bash
123+
cast sig "upgrade(address, address)"
124+
```
125+
126+
This will show the `upgrade` signature hash: `0x99a88ec4`.
127+
128+
3. Validate the `calldata` by running:
129+
130+
```
131+
cast calldata-decode "upgrade(address, address)" <calldata>
132+
```
133+
134+
This will show two addresses. The first one is the `registryCoordinator` address, and the second one is the new implementation address of `registryCoordinatorImplementation`.
135+
136+
> [!NOTE]
137+
>
138+
> Make sure the `registryCoordinator` address is the same as the one you deployed in the [Deploy Contracts Guide](./2_deploy_contracts.md).
139+
>
140+
> Make sure the `registryCoordinatorImplementation` address is the same as the one you deployed in this guide.
141+
142+
143+
## Next Steps
144+
145+
Once you have deployed the new implementation of the contract you want to upgrade, you need to propose the upgrade transaction following this [guide](./3_b_2_propose_upgrade.md).
146+
147+
Send the new address and `calldata` to the multisig participants to propose the upgrade transaction.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Propose the Transaction for Upgrade using Multisig
2+
3+
After deploying a new implementation candidate for the upgrade, you need to propose the upgrade transaction using the multisig wallet.
4+
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+
11+
## Propose transaction
12+
13+
To propose the upgrade transaction you can follow the steps below:
14+
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`.
24+
25+
Else, if you are upgrading the BatcherPaymentService, you can get the function signature by running:
26+
27+
```bash
28+
cast sig "upgradeTo(address)"
29+
```
30+
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:
36+
37+
```
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+
>
49+
> The first 10 characters must be the same the signature hash obtained in the previous step.
50+
>
51+
> Make sure the `alignedLayerServiceManager` address is the same as the one you deployed in the [Deploy Contracts Guide](./2_deploy_contracts.md).
52+
>
53+
> Make sure the `alignedServiceManagerImplementation` address is the same as the one you deployed in this guide.
54+
55+
Else, if you are upgrading the BatcherPaymentService, you can validate the calldata by running:
56+
57+
```
58+
cast calldata-decode "upgradeTo(address)" <calldata>
59+
```
60+
61+
This will show the `batcherPaymentServiceImplementation` address.
62+
63+
> [!NOTE]
64+
>
65+
> The first 10 characters must be the same the signature hash obtained in the previous step.
66+
>
67+
> Make sure the `batcherPaymentServiceImplementation` address is the same as the one you deployed in this guide.
68+
69+
3.

docs/0_internal/3_b_upgrade_contracts_with_multisig.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,30 @@ In this guide we make an upgrade of Aligned Layer Service Manager contract using
1717

1818
## Prerequisites
1919

20-
- To upgrade any of the contracts, you need to have set the `.env`, `DEPLOY_CONFIG_PATH` and `BATCHER_PAYMENT_SERVICE_CONFIG_PATH`
21-
22-
- You need to have installed git and make.
20+
- You need to have installed
21+
- git
22+
- make
23+
- [jq](https://jqlang.github.io/jq/download/)
2324

2425
- Clone the repository
26+
2527
```
2628
git clone https://github.com/yetanotherco/aligned_layer.git
2729
```
2830

2931
- Install foundry
32+
3033
```shell
3134
make install_foundry
3235
foundryup -v nightly-a428ba6ad8856611339a6319290aade3347d25d9
3336
```
3437

35-
## Deploy the new implementation
38+
## Steps
39+
40+
1. Deploy the new implementation following the [Deploy New Implementation Guide](./3_b_1_deploy_new_impl.md).
41+
42+
2. Once you have deployed the new implementation, you can propose the upgrade transaction with the multisig following the [Propose Upgrade Guide](./3_b_2_propose_upgrade.md).
3643

37-
The first step is to deploy the new implementation of the contract.
44+
3. After the upgrade is proposed, multisig participants can approve the upgrade following the [Approve Upgrade Guide](./3_b_3_approve_upgrade.md).
3845

39-
You need to
46+
Finishing the approval process, the contract will be upgraded to the new implementation.

0 commit comments

Comments
 (0)