Skip to content

Commit 47cbee4

Browse files
committed
feat: multisig on all other contract upgrades
1 parent 9c3bb2a commit 47cbee4

10 files changed

+90
-24
lines changed

contracts/script/upgrade/AlignedLayerUpgrader.s.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ contract AlignedLayerUpgrader is Script {
8080
)
8181
);
8282

83+
// Not link the new implementation to the proxy
84+
// Because this must be executed in the multisig
85+
8386
return (
8487
address(alignedLayerServiceManager),
8588
address(alignedLayerServiceManagerImplementation)

contracts/script/upgrade/BLSApkRegistryUpgrader.s.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@ contract BLSApkRegistryUpgrader is Script {
5757
);
5858
vm.stopBroadcast();
5959

60-
vm.startBroadcast();
61-
alignedLayerProxyAdmin.upgrade(
62-
blsApkRegistry,
63-
address(blsApkRegistryImplementation)
64-
);
65-
vm.stopBroadcast();
60+
// Not link the new implementation to the proxy
61+
// Because this must be executed in the multisig
6662

6763
return (
6864
address(blsApkRegistry),

contracts/script/upgrade/BatcherPaymentServiceUpgrader.s.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ contract BatcherPaymentServiceUpgrader is Script {
2525

2626
BatcherPaymentService newBatcherPaymentServiceImplementation = new BatcherPaymentService();
2727

28+
// Not link the new implementation to the proxy
29+
// Because this must be executed in the multisig
30+
2831
vm.stopBroadcast();
2932

3033
return (address(BatcherPaymentServiceProxy), address(newBatcherPaymentServiceImplementation));

contracts/script/upgrade/IndexRegistryUpgrader.s.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,8 @@ contract IndexRegistryUpgrader is Script {
5353
);
5454
vm.stopBroadcast();
5555

56-
vm.startBroadcast();
57-
alignedLayerProxyAdmin.upgrade(
58-
indexRegistry,
59-
address(indexRegistryImplementation)
60-
);
61-
vm.stopBroadcast();
56+
// Not link the new implementation to the proxy
57+
// Because this must be executed in the multisig
6258

6359
return (
6460
address(indexRegistry),

contracts/script/upgrade/RegistryCoordinatorUpgrader.s.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,8 @@ contract RegistryCoordinatorUpgrader is Script {
8282
);
8383
vm.stopBroadcast();
8484

85-
vm.startBroadcast();
86-
alignedLayerProxyAdmin.upgrade(
87-
registryCoordinator,
88-
address(registryCoordinatorImplementation)
89-
);
90-
vm.stopBroadcast();
85+
// Not link the new implementation to the proxy
86+
// Because this must be executed in the multisig
9187

9288
return (
9389
address(registryCoordinator),

contracts/script/upgrade/StakeRegistryUpgrader.s.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,8 @@ contract StakeRegistryUpgrader is Script {
6464
);
6565
vm.stopBroadcast();
6666

67-
vm.startBroadcast();
68-
alignedLayerProxyAdmin.upgrade(
69-
stakeRegistry,
70-
address(stakeRegistryImplementation)
71-
);
72-
vm.stopBroadcast();
67+
// Not link the new implementation to the proxy
68+
// Because this must be executed in the multisig
7369

7470
return (
7571
address(stakeRegistry),

contracts/scripts/upgrade_bls_apk_registry.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
if [ -z "$MULTISIG" ]; then
4+
echo "Missing MULTISIG env variable"
5+
exit 1
6+
fi
7+
38
# cd to the directory of this script so that this can be run from anywhere
49
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
510

@@ -19,6 +24,7 @@ forge_output=$(forge script script/upgrade/BLSApkRegistryUpgrader.s.sol \
1924
echo "$forge_output"
2025

2126
# Extract the alignedLayerServiceManagerImplementation value from the output
27+
blsApkRegistry=$(echo "$forge_output" | awk '/0: address/ {print $3}')
2228
new_bls_apk_registry_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
2329

2430
# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file
@@ -29,3 +35,16 @@ mv "script/output/holesky/alignedlayer_deployment_output.temp.json" "script/outp
2935

3036
# Delete the temporary file
3137
rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"
38+
39+
data=$(cast calldata "upgrade(address, address)" $blsApkRegistry $new_bls_apk_registry_implementation)
40+
41+
if [ "$MULTISIG" = false ]; then
42+
echo "Executing upgrade transaction"
43+
proxy_admin=$(jq -r '.addresses.alignedLayerProxyAdmin' $OUTPUT_PATH)
44+
cast send $proxy_admin $data \
45+
--rpc-url $RPC_URL \
46+
--private-key $PRIVATE_KEY
47+
else
48+
echo "You can propose the upgrade transaction with the multisig using this calldata"
49+
echo $data
50+
fi

contracts/scripts/upgrade_index_registry.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
if [ -z "$MULTISIG" ]; then
4+
echo "Missing MULTISIG env variable"
5+
exit 1
6+
fi
7+
38
# cd to the directory of this script so that this can be run from anywhere
49
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
510

@@ -19,6 +24,7 @@ forge_output=$(forge script script/upgrade/IndexRegistryUpgrader.s.sol \
1924
echo "$forge_output"
2025

2126
# Extract the alignedLayerServiceManagerImplementation value from the output
27+
index_registry=$(echo "$forge_output" | awk '/0: address/ {print $3}')
2228
new_index_registry_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
2329

2430
# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file
@@ -29,3 +35,16 @@ mv "script/output/holesky/alignedlayer_deployment_output.temp.json" "script/outp
2935

3036
# Delete the temporary file
3137
rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"
38+
39+
data=$(cast calldata "upgrade(address, address)" $index_registry $new_index_registry_implementation)
40+
41+
if [ "$MULTISIG" = false ]; then
42+
echo "Executing upgrade transaction"
43+
proxy_admin=$(jq -r '.addresses.alignedLayerProxyAdmin' $OUTPUT_PATH)
44+
cast send $proxy_admin $data \
45+
--rpc-url $RPC_URL \
46+
--private-key $PRIVATE_KEY
47+
else
48+
echo "You can propose the upgrade transaction with the multisig using this calldata"
49+
echo $data
50+
fi

contracts/scripts/upgrade_registry_coordinator.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
if [ -z "$MULTISIG" ]; then
4+
echo "Missing MULTISIG env variable"
5+
exit 1
6+
fi
7+
38
# cd to the directory of this script so that this can be run from anywhere
49
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
510

@@ -21,6 +26,7 @@ forge_output=$(forge script script/upgrade/RegistryCoordinatorUpgrader.s.sol \
2126
echo "$forge_output"
2227

2328
# Extract the alignedLayerServiceManagerImplementation value from the output
29+
registry_coordinator=$(echo "$forge_output" | awk '/0: address/ {print $3}')
2430
new_registry_coordinator_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
2531

2632
# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file
@@ -31,3 +37,16 @@ mv "script/output/holesky/alignedlayer_deployment_output.temp.json" $OUTPUT_PATH
3137

3238
# Delete the temporary file
3339
rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"
40+
41+
data=$(cast calldata "upgrade(address, address)" $registry_coordinator $new_registry_coordinator_implementation)
42+
43+
if [ "$MULTISIG" = false ]; then
44+
echo "Executing upgrade transaction"
45+
proxy_admin=$(jq -r '.addresses.alignedLayerProxyAdmin' $OUTPUT_PATH)
46+
cast send $batcher_payment_service_proxy $data \
47+
--rpc-url $RPC_URL \
48+
--private-key $PRIVATE_KEY
49+
else
50+
echo "You can propose the upgrade transaction with the multisig using this calldata"
51+
echo $data
52+
fi

contracts/scripts/upgrade_stake_registry.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
if [ -z "$MULTISIG" ]; then
4+
echo "Missing MULTISIG env variable"
5+
exit 1
6+
fi
7+
38
# cd to the directory of this script so that this can be run from anywhere
49
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
510

@@ -19,6 +24,7 @@ forge_output=$(forge script script/upgrade/StakeRegistryUpgrader.s.sol \
1924
echo "$forge_output"
2025

2126
# Extract the alignedLayerServiceManagerImplementation value from the output
27+
stakeRegistry=$(echo "$forge_output" | awk '/0: address/ {print $3}')
2228
new_stake_registry_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
2329

2430
# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file
@@ -29,3 +35,16 @@ mv "script/output/holesky/alignedlayer_deployment_output.temp.json" "script/outp
2935

3036
# Delete the temporary file
3137
rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"
38+
39+
data=$(cast calldata "upgrade(address, address)" $stakeRegistry $new_stake_registry_implementation)
40+
41+
if [ "$MULTISIG" = false ]; then
42+
echo "Executing upgrade transaction"
43+
proxy_admin=$(jq -r '.addresses.alignedLayerProxyAdmin' $OUTPUT_PATH)
44+
cast send $batcher_payment_service_proxy $data \
45+
--rpc-url $RPC_URL \
46+
--private-key $PRIVATE_KEY
47+
else
48+
echo "You can propose the upgrade transaction with the multisig using this calldata"
49+
echo $data
50+
fi

0 commit comments

Comments
 (0)