Skip to content

Commit

Permalink
Merge branch 'staging' into 515-chore-add-multisig-support-to-upgrade…
Browse files Browse the repository at this point in the history
…-servicemanager
  • Loading branch information
MauroToscano committed Nov 6, 2024
2 parents 0c04cad + a70179d commit c6c6ace
Show file tree
Hide file tree
Showing 22 changed files with 2,954 additions and 2,137 deletions.
35 changes: 33 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,29 @@ anvil_upgrade_add_aggregator:
@echo "Adding Aggregator to Aligned Contracts..."
. contracts/scripts/anvil/upgrade_add_aggregator_to_service_manager.sh

pause_all_aligned_service_manager:
@echo "Pausing all contracts..."
. contracts/scripts/pause_aligned_service_manager.sh all

unpause_all_aligned_service_manager:
@echo "Pausing all contracts..."
. contracts/scripts/unpause_aligned_service_manager.sh all

get_paused_state_aligned_service_manager:
@echo "Getting paused state of Aligned Service Manager contract..."
. contracts/scripts/get_paused_state_aligned_service_manager.sh

pause_batcher_payment_service:
@echo "Pausing BatcherPayments contract..."
. contracts/scripts/pause_batcher_payment_service.sh

unpause_batcher_payment_service:
@echo "Unpausing BatcherPayments contract..."
. contracts/scripts/unpause_batcher_payment_service.sh

get_paused_state_batcher_payments_service:
@echo "Getting paused state of Batcher Payments Service contract..."
. contracts/scripts/get_paused_state_batcher_payments_service.sh
anvil_upgrade_initialize_disable_verifiers:
@echo "Initializing disabled verifiers..."
. contracts/scripts/anvil/upgrade_disabled_verifiers_in_service_manager.sh
Expand Down Expand Up @@ -453,10 +476,18 @@ deploy_aligned_contracts: ## Deploy Aligned Contracts
@echo "Deploying Aligned Contracts..."
@. contracts/scripts/.env && . contracts/scripts/deploy_aligned_contracts.sh

deploy_pauser_registry: ## Deploy Pauser Registry
@echo "Deploying Pauser Registry..."
@. contracts/scripts/.env && . contracts/scripts/deploy_pauser_registry.sh

upgrade_aligned_contracts: ## Upgrade Aligned Contracts
@echo "Upgrading Aligned Contracts..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_aligned_contracts.sh

upgrade_pauser_aligned_contracts: ## Upgrade Aligned Contracts with Pauser initialization
@echo "Upgrading Aligned Contracts with Pauser initialization..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_pausable_to_service_manager.sh

upgrade_registry_coordinator: ## Upgrade Registry Coordinator
@echo "Upgrading Registry Coordinator..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_registry_coordinator.sh
Expand Down Expand Up @@ -977,11 +1008,11 @@ open_telemetry_prod_start: ## Run open telemetry services with Cassandra using t
# Elixir API
telemetry_start: telemetry_run_db telemetry_ecto_migrate ## Run Telemetry API
@cd telemetry_api && \
./start.sh
./start.sh

telemetry_ecto_migrate: ##
@cd telemetry_api && \
./ecto_setup_db.sh
./ecto_setup_db.sh

telemetry_build_db:
@cd telemetry_api && \
Expand Down
2 changes: 1 addition & 1 deletion batcher/aligned-sdk/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ pub async fn submit_multiple(

pub fn get_payment_service_address(network: Network) -> ethers::types::H160 {
match network {
Network::Devnet => H160::from_str("0x7969c5eD335650692Bc04293B07F5BF2e7A673C0").unwrap(),
Network::Devnet => H160::from_str("0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650").unwrap(),
Network::Holesky => H160::from_str("0x815aeCA64a974297942D2Bbf034ABEe22a38A003").unwrap(),
Network::HoleskyStage => {
H160::from_str("0x7577Ec4ccC1E6C529162ec8019A49C13F6DAd98b").unwrap()
Expand Down
72 changes: 57 additions & 15 deletions contracts/script/deploy/AlignedLayerDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
ProxyAdmin public alignedLayerProxyAdmin;
address public alignedLayerOwner;
address public alignedLayerUpgrader;
address public pauser;
address public alignedLayerPauser;
uint256 public initalPausedStatus;
address public deployer;
address public alignedLayerAggregator;
Expand All @@ -43,6 +43,7 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
StakeRegistry public stakeRegistry;
OperatorStateRetriever public operatorStateRetriever;
ServiceManagerRouter public serviceManagerRouter;
PauserRegistry public pauserRegistry;

BLSApkRegistry public apkRegistryImplementation;
AlignedLayerServiceManager public alignedLayerServiceManagerImplementation;
Expand Down Expand Up @@ -87,7 +88,10 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
".permissions.initalPausedStatus"
);

pauser = address(eigenLayerPauserReg);
alignedLayerPauser = stdJson.readAddress(
config_data,
".permissions.pauser"
);

deployer = stdJson.readAddress(config_data, ".permissions.deployer");
require(
Expand All @@ -106,6 +110,13 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
// deploy proxy admin for ability to upgrade proxy contracts
alignedLayerProxyAdmin = new ProxyAdmin();

//deploy pauser registry
{
address[] memory pausers = new address[](1);
pausers[0] = alignedLayerPauser;
pauserRegistry = new PauserRegistry(pausers, alignedLayerPauser); // (pausers, unpauser)
}

//deploy service manager router
serviceManagerRouter = new ServiceManagerRouter();

Expand Down Expand Up @@ -222,7 +233,7 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
alignedLayerOwner,
churner,
ejector,
IPauserRegistry(pauser),
pauserRegistry,
initalPausedStatus,
operatorSetParams,
minimumStakeForQuourm,
Expand All @@ -249,7 +260,9 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
AlignedLayerServiceManager.initialize.selector,
deployer,
deployer,
alignedLayerAggregator
alignedLayerAggregator,
pauserRegistry,
initalPausedStatus
)
);

Expand Down Expand Up @@ -320,19 +333,28 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
config_data,
".permissions.upgrader"
);
alignedLayerPauser = stdJson.readAddress(
config_data,
".permissions.pauser"
);
initalPausedStatus = stdJson.readUint(
config_data,
".permissions.initalPausedStatus"
);

pauser = address(eigenLayerPauserReg);

deployer = stdJson.readAddress(config_data, ".permissions.deployer");
vm.startPrank(deployer);

// deploy proxy admin for ability to upgrade proxy contracts
alignedLayerProxyAdmin = new ProxyAdmin();

//deploy pauser registry
{
address[] memory pausers = new address[](1);
pausers[0] = alignedLayerPauser;
pauserRegistry = new PauserRegistry(pausers, alignedLayerPauser); // (pausers, unpauser)
}

//deploy service manager router
serviceManagerRouter = new ServiceManagerRouter();

Expand Down Expand Up @@ -449,7 +471,7 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
alignedLayerOwner,
churner,
ejector,
IPauserRegistry(pauser),
pauserRegistry,
initalPausedStatus,
operatorSetParams,
minimumStakeForQuourm,
Expand All @@ -475,7 +497,9 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
abi.encodeWithSelector(
AlignedLayerServiceManager.initialize.selector,
deployer,
deployer
deployer,
pauserRegistry,
initalPausedStatus
)
);

Expand Down Expand Up @@ -632,8 +656,16 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
alignedLayerServiceManager.owner() == alignedLayerOwner,
"alignedLayerServiceManager.owner() != alignedLayerOwner"
);
// require(alignedLayerServiceManager.pauserRegistry() == IPauserRegistry(pauser), "alignedLayerServiceManager: pauser registry not set correctly");
// require(alignedLayerServiceManager.paused() == initalPausedStatus, "alignedLayerServiceManager: init paused status set incorrectly");

require(
alignedLayerServiceManager.pauserRegistry() == IPauserRegistry(pauserRegistry),
"alignedLayerServiceManager: pauser registry not set correctly"
);
require(
alignedLayerServiceManager.paused() == initalPausedStatus,
"alignedLayerServiceManager: init paused status set incorrectly"
);


require(
registryCoordinator.owner() == alignedLayerOwner,
Expand All @@ -648,7 +680,7 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
"registryCoordinator.ejector() != ejector"
);
require(
registryCoordinator.pauserRegistry() == IPauserRegistry(pauser),
registryCoordinator.pauserRegistry() == pauserRegistry,
"registryCoordinator: pauser registry not set correctly"
);
require(
Expand Down Expand Up @@ -777,6 +809,11 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
"serviceManagerRouter",
address(serviceManagerRouter)
);
vm.serializeAddress(
deployed_addresses,
"pauserRegistry",
address(pauserRegistry)
);
string memory deployed_addresses_output = vm.serializeAddress(
deployed_addresses,
"stakeRegistryImplementation",
Expand All @@ -799,10 +836,17 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
config_data,
".permissions.ejector"
);
address alignedLayerAggregator = stdJson.readAddress(

alignedLayerAggregator = stdJson.readAddress(
config_data,
".permissions.aggregator"
);

address pauserAddress = stdJson.readAddress(
config_data,
".permissions.pauser"
);

string memory permissions = "permissions";
vm.serializeAddress(
permissions,
Expand All @@ -815,9 +859,7 @@ contract AlignedLayerDeployer is ExistingDeploymentParser {
alignedLayerUpgrader
);
vm.serializeAddress(permissions, "alignedLayerChurner", churner);

vm.serializeAddress(permissions, "pauserRegistry", pauser);

vm.serializeAddress(permissions, "alignedLayerPauser", pauserAddress);
vm.serializeAddress(permissions, "alignedLayerAggregator", alignedLayerAggregator);

string memory permissions_output = vm.serializeAddress(
Expand Down
73 changes: 73 additions & 0 deletions contracts/script/deploy/PauserRegistryDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;

import {PauserRegistry} from "eigenlayer-core/contracts/permissions/PauserRegistry.sol";

import "script/deploy/utils/ExistingDeploymentParser.sol";
import "forge-std/Test.sol";
import "forge-std/Script.sol";
import "forge-std/StdJson.sol";

// This script is only for deploying the PauserRegistry contract
// In order to avoid redeploying previously deployed contracts, we will use the deployed contract addresses
contract PauserRegistryDeployer is ExistingDeploymentParser {
address public pauser;
uint256 public initalPausedStatus;
address public deployer;

PauserRegistry public pauserRegistry;

function run(
string memory existingDeploymentInfoPath,
string memory deployConfigPath,
string memory outputPath
) external returns (address, address) {
// get info on all the already-deployed contracts
_parseDeployedContracts(existingDeploymentInfoPath);

// READ JSON CONFIG DATA
string memory config_data = vm.readFile(deployConfigPath);

// check that the chainID matches the one in the config
uint256 currentChainId = block.chainid;
uint256 configChainId = stdJson.readUint(
config_data,
".chainInfo.chainId"
);
emit log_named_uint("You are deploying on ChainID", currentChainId);
require(
configChainId == currentChainId,
"You are on the wrong chain for this config"
);

initalPausedStatus = stdJson.readUint(
config_data,
".permissions.initalPausedStatus"
);
pauser = stdJson.readAddress(
config_data,
".permissions.pauser"
);

deployer = stdJson.readAddress(config_data, ".permissions.deployer");
require(
deployer == tx.origin,
"Deployer address must be the same as the tx.origin"
);
emit log_named_address("You are deploying from", deployer);

vm.startBroadcast();

//deploy pauser registry
{
address[] memory pausers = new address[](1);
pausers[0] = pauser;
pauserRegistry = new PauserRegistry(pausers, pauser); // (pausers, unpauser)
}

vm.stopPrank();

//write output
return(address(pauserRegistry), address(pauser));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"churner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"ejector": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"deployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"pauser": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"initalPausedStatus": 0
},
"minimumStakes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"address": {
"batcherWallet": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"batcherPrivateKey": "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba",
"alignedLayerServiceManager": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8"
"alignedLayerServiceManager": "0x851356ae760d987E095750cCeb3bC6014560891C"
},
"amounts": {
"gasForAggregator": "300000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"churner": "<churner_address>",
"ejector": "<ejector_address>",
"deployer": "<deployer_address>",
"pauser": "<pauser_address>",
"initalPausedStatus": 0
},
"minimumStakes": [
Expand Down
Loading

0 comments on commit c6c6ace

Please sign in to comment.