Skip to content

Commit d2ad5f9

Browse files
committed
docs: pause process with multisig [wip]
1 parent 8ab0376 commit d2ad5f9

19 files changed

+340
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Pause Contracts
2+
This doc contains a guide on how to use the Pausable functionality of Aligned.
3+
4+
To run the make targets specified in this guide, you must first have the relevant following env vars:
5+
```
6+
export RPC_URL=<rpc_url>
7+
export ALIGNED_SERVICE_MANAGER=<aligned_contract_address>
8+
export ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY=<aligned_service_manager_pauser_private_key>
9+
export BATCHER_PAYMENT_SERVICE=<payment_service_contract_address>
10+
export BATCHER_PAYMENT_SERVICE_PAUSER_PRIVATE_KEY=<batcher_payment_service_pauser_private_key>
11+
```
12+
13+
## Aligned Service Manager
14+
15+
Aligned Service Manager is granulary pausable, which means you can pause the whole contract, or only specific functions. For this,
16+
Aligned uses the Pauser Registry contract provided by Eigenlayer. This contract stores the role of different accounts, so
17+
you can have X pausers and Y unpausers.
18+
19+
To interact with it you can:
20+
21+
- Get current paused state:
22+
```
23+
make get_paused_state_aligned_service_manager
24+
```
25+
26+
- Pause or Unpause the whole aligned service manager contract:
27+
```
28+
make pause_all_aligned_service_manager
29+
```
30+
```
31+
make unpause_all_aligned_service_manager
32+
```
33+
34+
- Pause only specific functions, receiving a list of the functions to pause/remain paused:
35+
For example, if you want to pause functions 0, 2 and 3, you can run
36+
```
37+
contracts/scripts/pause_aligned_service_manager.sh 0 2 3
38+
```
39+
Then, if you want to unpause, for example, function 2, you must run
40+
```
41+
contracts/scripts/unpause_aligned_service_manager.sh 0 3
42+
```
43+
44+
Note: when executing a Pause, you can only ADD functions to the paused list, and when executing an Unpause, you can only REMOVE functions from the paused list. This is because the base pausable contract has different ACL for Pausers and Unpausers.
45+
46+
Note: the list of pausable functions and their numbers can be seen in the `AlignedLayerServiceManager.sol` contract. But the list is the following:
47+
48+
0. createNewTask
49+
1. respondToTaskV2
50+
2. verifyBatchInclusion
51+
3. withdraw
52+
4. depositToBatcher
53+
5. receive
54+
55+
## BatcherPaymentsService
56+
57+
BatcherPayments is also pausable, but without so much detail. You can either pause or unpause the contract running the following:
58+
59+
- Get current paused state:
60+
```
61+
make get_paused_state_batcher_payments_service
62+
```
63+
64+
```
65+
make pause_batcher_payment_service
66+
```
67+
```
68+
make unpause_batcher_payment_service
69+
```
70+
71+
And this will either pause or unpause the following functions:
72+
- createNewTask
73+
- unlock
74+
- lock
75+
- withdraw
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Propose the Transaction for Pause using Multisig
2+
3+
If you want to pause the contracts, you can propose the pause transaction using the multisig wallet.
4+
5+
## Prerequisites
6+
7+
- You need to have deployed the contracts following the [Deploy Contracts Guide](./2_deploy_contracts.md).
8+
9+
## Propose transaction for Pause AlignedLayerServiceManager
10+
11+
To propose the pause transaction you can follow the steps below:
12+
13+
1. Create the pause transaction on [Safe](https://app.safe.global/home)
14+
15+
2. Click on `New transaction` -> `Transaction Builder`
16+
17+
![New transaction](./images/4_b_1_pause_1.png)
18+
19+
![Transaction Builder](./images/4_b_1_pause_2.png)
20+
21+
3. . Enable `Custom data`
22+
23+
4. . Get the `AlignedLayerServiceManager` address:
24+
25+
```bash
26+
# SEPOLIA
27+
jq -r ".addresses.alignedLayerServiceManager" contracts/script/output/sepolia/alignedlayer_deployment_output.json | pbcopy
28+
```
29+
30+
```bash
31+
# HOLESKY
32+
jq -r ".addresses.alignedLayerServiceManager" contracts/script/output/holesky/alignedlayer_deployment_output.json | pbcopy
33+
```
34+
35+
```bash
36+
# MAINNET
37+
jq -r ".addresses.alignedLayerServiceManager" contracts/script/output/mainnet/alignedlayer_deployment_output.json | pbcopy
38+
```
39+
40+
> [!NOTE]
41+
> Make sure to set the path to the correct deployment output file.
42+
43+
5. Paste the `AlignedLayerServiceManager` address on `Enter Address or ENS Name`
44+
45+
![Enter Address](./images/4_b_1_pause_3.png)
46+
47+
6. Set the `ETH Value` to 0.
48+
49+
7. . Generate the function calldata
50+
51+
```bash
52+
cast calldata "pauseAll()"
53+
```
54+
55+
This will show the `pauseAll()` calldata: `0x595c6a67`.
56+
57+
8. Paste the `calldata` on `Enter Data`
58+
59+
![Enter Data](./images/4_b_1_pause_4.png)
60+
61+
9. Click on `+ Add new transaction`
62+
63+
You should see the new transaction to be executed
64+
65+
10. Click on `Create batch` to create the transaction.
66+
67+
11. Simulate the transaction by clicking on `Simulate`
68+
69+
12. Check the data matches with the generated data on step 7.
70+
71+
![Validate data](./images/4_b_1_pause_5.png)
72+
73+
13. If everything is correct, click on `Send batch` to send the transaction.
74+
75+
14. Simulate the transaction, and if everything is correct, click on `Sign`.
76+
77+
![Send batch](./images/4_b_1_pause_6.png)
78+
79+
> [!NOTE]
80+
> In the `call` field, you will see `fallback`.
81+
82+
15. Wait for the transaction to be executed. You can check the transaction status on the `Transactions` tab.
83+
84+
85+
## Propose transaction for Pause BatcherPaymentService
86+
87+
To propose the pause transaction you can follow the steps below:
88+
89+
1. Create the pause transaction on [Safe](https://app.safe.global/home)
90+
91+
2. Click on `New transaction` -> `Transaction Builder`
92+
93+
![New transaction](./images/4_b_1_pause_1.png)
94+
95+
![Transaction Builder](./images/4_b_1_pause_2.png)
96+
97+
3. . Get the `BatcherPaymentService` address:
98+
99+
```bash
100+
# SEPOLIA
101+
jq -r ".addresses.batcherPaymentService" contracts/script/output/sepolia/alignedlayer_deployment_output.json | pbcopy
102+
```
103+
104+
```bash
105+
# HOLESKY
106+
jq -r ".addresses.batcherPaymentService" contracts/script/output/holesky/alignedlayer_deployment_output.json | pbcopy
107+
```
108+
109+
```bash
110+
# MAINNET
111+
jq -r ".addresses.batcherPaymentService" contracts/script/output/mainnet/alignedlayer_deployment_output.json | pbcopy
112+
```
113+
114+
> [!NOTE]
115+
> Make sure to set the path to the correct deployment output file.
116+
117+
5. Paste the `BatcherPaymentService` address on `Enter Address or ENS Name`
118+
119+
![Enter Address](./images/4_b_1_pause_3.png)
120+
121+
6. As this is a Proxy contract, choose `Use Implementation ABI`
122+
123+
![Use Implementation ABI](./images/4_b_1_pause_7.png)
124+
125+
7. In `contract method selector` choose `pause()`
126+
127+
![Choose pause](./images/4_b_1_pause_8.png)
128+
129+
8. Then click on `+ Add new transaction`
130+
131+
You should see the new transaction to be executed. Then click on `Create batch` to create the transaction.
132+
133+
![Add new transaction](./images/4_b_1_pause_9.png)
134+
135+
9. Review and confirm you are interacting with the correct `BatcherPaymentService` contract and you are calling the `pause` function.
136+
137+
![Review transaction](./images/4_b_1_pause_10.png)
138+
139+
10. Simulate the transaction by clicking on `Simulate`
140+
141+
11. If everything is correct, click on `Send batch` to send the transaction.
142+
143+
12. Review the transaction and click on `Sign` to sign the transaction.
144+
145+
![Send batch](./images/4_b_1_pause_11.png)
146+
147+
13. If the transaction is correctly created, you have to wait until the required Multisig member signs the transaction to send it.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Approve the Pause Transaction
2+
3+
Once the transaction is proposed, the multisig owners must approve the transaction.
4+
5+
## Prerequisites
6+
7+
- One of the multisig owners must have proposed the pause transaction.
8+
9+
## Approve the Pause for AlignedLayerServiceManager
10+
11+
To approve the pause transaction, you can follow the steps below:
12+
13+
1. Go to [Safe](https://app.safe.global/home) and connect your wallet.
14+
15+
2. Go to the `Transactions` tab and find the transaction that was proposed.
16+
17+
3. Click on the transaction and validate the data is correct.
18+
19+
The called function must be `pauseAll()`.
20+
21+
Also check contract addresses are the ones you received from the deployment.
22+
23+
![Check details](images/4_b_2_approve_1.png)
24+
25+
[//]: # (TODO finish it has a bug)
26+
27+
## Approve the Pause for BatcherPaymentService
28+
29+
To approve the pause transaction, you can follow the steps below:
30+
31+
1. Go to [Safe](https://app.safe.global/home) and connect your wallet.
32+
33+
2. Go to the `Transactions` tab and find the transaction that was proposed.
34+
35+
3. Click on the transaction and validate the data is correct.
36+
37+
The called function must be `pause` and the contract address must be the `BatcherPaymentService` address.
38+
39+
![Check details](images/4_b_2_approve_2.png)
40+
41+
You can get the `BatcherPaymentService` address:
42+
43+
```bash
44+
# SEPOLIA
45+
jq -r ".addresses.batcherPaymentService" contracts/script/output/sepolia/alignedlayer_deployment_output.json | pbcopy
46+
```
47+
48+
```bash
49+
# HOLESKY
50+
jq -r ".addresses.batcherPaymentService" contracts/script/output/holesky/alignedlayer_deployment_output.json | pbcopy
51+
```
52+
53+
```bash
54+
# MAINNET
55+
jq -r ".addresses.batcherPaymentService" contracts/script/output/mainnet/alignedlayer_deployment_output.json | pbcopy
56+
```
57+
58+
> [!NOTE]
59+
> Make sure to set the path to the correct deployment output file.
60+
61+
4. If the data is correct, click on the `Confirm` button.
62+
63+
5. Simulate the transaction. If everything is correct, click on the `Sign` button.
64+
65+
![Sign transaction](images/4_b_2_approve_3.png)
66+
67+
6. Once the transaction is executed, the pause will be effective.
68+
69+
You can check the pause status on Etherscan by checking the `paused` variable of the contract.
70+
71+

docs/0_internal/4_b_3_propose_unpause.md

Whitespace-only changes.

docs/0_internal/4_b_4_approve_unpause.md

Whitespace-only changes.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Pause Contracts with a Multisig
2+
3+
> [!WARNING]
4+
> Safe Multisig Wallet is not currently supported in Holesky Testnet.
5+
> For this reason, we deployed EigenLayer contracts in Sepolia to test the upgrade on AlignedLayer Contracts.
6+
7+
> [!NOTE]
8+
> EigenLayer Sepolia contracts information is available in `contracts/script/output/sepolia/eigenlayer_deployment_output.json`.
9+
10+
> [!NOTE]
11+
> You can find a guide on how to Deploy the contracts [here](./2_deploy_contracts.md).
12+
13+
This guide is for pausing contracts deployed using a Multisig wallet. If you deployed the contract without a Multisig wallet, you can follow the [Pause Contracts](./4_a_pause_contracts.md) tutorial.
14+
15+
In this guide we pause and unpause the AlignedLayerServiceManager and BatcherPaymentService contracts using a multisig wallet.
16+
17+
## Prerequisites
18+
19+
- You need to have installed
20+
- git
21+
- make
22+
- [jq](https://jqlang.github.io/jq/download/)
23+
24+
- Clone the repository
25+
26+
```
27+
git clone https://github.com/yetanotherco/aligned_layer.git
28+
```
29+
30+
- Install foundry
31+
32+
```shell
33+
make install_foundry
34+
foundryup -v nightly-a428ba6ad8856611339a6319290aade3347d25d9
35+
```
36+
37+
## Steps for Pausing
38+
39+
1. Propose the transaction with the multisig following the [Propose Pause Guide](./4_b_1_propose_pause.md).
40+
41+
2. After the pause is proposed, multisig participants can approve the pause following the [Approve Pause Guide](./4_b_2_approve_pause.md).
42+
43+
## Steps for Unpausing
44+
45+
1. Propose the transaction with the multisig following the [Propose Unpause Guide](./4_b_3_propose_unpause.md).
46+
47+
2. After the unpause is proposed, multisig participants can approve the unpause following the [Approve Unpause Guide](./4_b_4_approve_unpause.md).
1.8 MB
Loading
52.1 KB
Loading
72.5 KB
Loading
1.72 MB
Loading

0 commit comments

Comments
 (0)