Skip to content

Commit 1c4485c

Browse files
authored
Merge 72e14fa into a3ac9cb
2 parents a3ac9cb + 72e14fa commit 1c4485c

19 files changed

+290
-0
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ unpause_batcher_payment_service:
117117
get_paused_state_batcher_payments_service:
118118
@echo "Getting paused state of Batcher Payments Service contract..."
119119
. contracts/scripts/get_paused_state_batcher_payments_service.sh
120+
120121
anvil_upgrade_initialize_disable_verifiers:
121122
@echo "Initializing disabled verifiers..."
122123
. contracts/scripts/anvil/upgrade_disabled_verifiers_in_service_manager.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
if [ -z "$BATCHER_PAYMENT_SERVICE" ]; then
4+
echo "BATCHER_PAYMENT_SERVICE env var is not set"
5+
exit 1
6+
fi
7+
8+
if [ -z "$RPC_URL" ]; then
9+
echo "RPC_URL env var is not set"
10+
exit 1
11+
fi
12+
13+
is_paused=$(cast call $BATCHER_PAYMENT_SERVICE "paused()(bool)" --rpc-url $RPC_URL)
14+
echo Batcher Payments Paused state: $is_paused
+75
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 under `contracts/scripts/.env`:
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
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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. Go to [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. . Get the `AlignedLayerServiceManager` 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```
22+
23+
4. Paste the `AlignedLayerServiceManager` address on `Enter Address or ENS Name`
24+
25+
![Enter Address](./images/4_b_1_pause_3.png)
26+
27+
5. As this is a Proxy contract, choose `Use Implementation ABI`
28+
29+
![Use Implementation ABI](./images/4_b_1_pause_4.png)
30+
31+
6. In `contract method selector` choose `pauseAll()`
32+
33+
![Choose pause](./images/4_b_1_pause_5.png)
34+
35+
7. Click on `+ Add new transaction`
36+
37+
You should see the new transaction to be executed
38+
39+
8. Click on `Create batch` to create the transaction.
40+
41+
9. Simulate the transaction by clicking on `Simulate`
42+
43+
10. If everything is correct, click on `Send batch` to send the transaction.
44+
45+
11. Simulate the transaction, and if everything is correct, click on `Sign`.
46+
47+
![Send batch](./images/4_b_1_pause_6.png)
48+
49+
> [!NOTE]
50+
> In the `call` field, you will see `fallback`.
51+
52+
12. Wait for the transaction to be executed. You can check the transaction status on the `Transactions` tab.
53+
54+
55+
## Propose transaction for Pause BatcherPaymentService
56+
57+
To propose the pause transaction you can follow the steps below:
58+
59+
1. Create the pause transaction on [Safe](https://app.safe.global/home)
60+
61+
2. Click on `New transaction` -> `Transaction Builder`
62+
63+
![New transaction](./images/4_b_1_pause_1.png)
64+
65+
![Transaction Builder](./images/4_b_1_pause_2.png)
66+
67+
3. Get the `BatcherPaymentService` 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```
68+
69+
4. Paste the `BatcherPaymentService` address on `Enter Address or ENS Name`
70+
71+
![Enter Address](./images/4_b_1_pause_3.png)
72+
73+
5. As this is a Proxy contract, choose `Use Implementation ABI`
74+
75+
![Use Implementation ABI](./images/4_b_1_pause_4.png)
76+
77+
6. In `contract method selector` choose `pause()`
78+
79+
![Choose pause](./images/4_b_1_pause_8.png)
80+
81+
7. Then click on `+ Add new transaction`
82+
83+
You should see the new transaction to be executed. Then click on `Create batch` to create the transaction.
84+
85+
![Add new transaction](./images/4_b_1_pause_9.png)
86+
87+
8. Review and confirm you are interacting with the correct `BatcherPaymentService` contract and you are calling the `pause` function.
88+
89+
![Review transaction](./images/4_b_1_pause_10.png)
90+
91+
9. Simulate the transaction by clicking on `Simulate`
92+
93+
10. If everything is correct, click on `Send batch` to send the transaction.
94+
95+
11. Review the transaction and click on `Sign` to sign the transaction.
96+
97+
![Send batch](./images/4_b_1_pause_11.png)
98+
99+
12. If the transaction is correctly created, you have to wait until the required Multisig member signs the transaction to send it. For this, you can follow [the following guide](./4_b_2_approve_pause.md)
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Approve the Pause Transaction
2+
3+
Once the transaction is proposed, the multisig owners must approve the transaction.
4+
5+
## Approve the Pause for AlignedLayerServiceManager
6+
7+
1. Go to [Safe](https://app.safe.global/home) and connect your wallet.
8+
9+
2. Go to the `Transactions` tab and find the transaction that was proposed.
10+
11+
3. Get the ```pauseAll()``` signature by running:
12+
13+
```bash
14+
cast calldata "pauseAll()"
15+
```
16+
17+
It must show you ```0x595c6a67```.
18+
19+
4. Click on the transaction, and then click on ```Advanced Details```.
20+
21+
![Check details](images/4_b_2_approve_1.png)
22+
23+
5. Copy the ```Raw Data```, paste it in a text editor and verify it is the same value as the one you got in step 3.
24+
25+
6. If the data is correct, click on the `Confirm` button.
26+
27+
7. Simulate the transaction. If everything is correct, click on the `Sign` button.
28+
29+
![Sign transaction](images/4_b_2_approve_3.png)
30+
31+
8. Once the transaction is executed, the pause will be effective.
32+
33+
## Approve the Pause for BatcherPaymentService
34+
35+
1. Go to [Safe](https://app.safe.global/home) and connect your wallet.
36+
37+
2. Go to the `Transactions` tab and find the transaction that was proposed.
38+
39+
3. Click on the transaction and validate the data is correct.
40+
41+
The called function must be `pause` and the contract address must be the `BatcherPaymentService` address.
42+
43+
![Check details](images/4_b_2_approve_2.png)
44+
45+
Get the `BatcherPaymentService` 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```
46+
47+
4. If the data is correct, click on the `Confirm` button.
48+
49+
5. Simulate the transaction. If everything is correct, click on the `Sign` button.
50+
51+
![Sign transaction](images/4_b_2_approve_3.png)
52+
53+
6. Once the transaction is executed, the pause will be effective.
54+
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
209 KB
Loading
32.7 KB
Loading
136 KB
Loading
114 KB
Loading
140 KB
Loading
34.3 KB
Loading
109 KB
Loading
76.5 KB
Loading
78.1 KB
Loading

0 commit comments

Comments
 (0)