From a85977a18f96b949c8c96397cb63955f5246a452 Mon Sep 17 00:00:00 2001 From: Danil Date: Thu, 12 Sep 2024 15:47:47 +0200 Subject: [PATCH] fix(zk-toolbox): use chain admin for bridgehub (#2857) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ ## Why ❔ ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. --------- Signed-off-by: Danil --- contracts | 2 +- zk_toolbox/crates/config/src/contracts.rs | 1 + .../deploy_ecosystem/output.rs | 1 + .../src/commands/ecosystem/init.rs | 37 ++++++++++++++++++- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/contracts b/contracts index 73b20c4b972f..3a1b5d4b94ff 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit 73b20c4b972f575613b4054d238332f93f2685cc +Subproject commit 3a1b5d4b94ffb00f03d436a7db7e48589eb74d39 diff --git a/zk_toolbox/crates/config/src/contracts.rs b/zk_toolbox/crates/config/src/contracts.rs index 19d432909487..0d4b1c7b1f81 100644 --- a/zk_toolbox/crates/config/src/contracts.rs +++ b/zk_toolbox/crates/config/src/contracts.rs @@ -69,6 +69,7 @@ impl ContractsConfig { self.ecosystem_contracts .diamond_cut_data .clone_from(&deploy_l1_output.contracts_config.diamond_cut_data); + self.l1.chain_admin_addr = deploy_l1_output.deployed_addresses.chain_admin; } pub fn set_chain_contracts(&mut self, register_chain_output: &RegisterChainOutput) { diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs index bf9292e9ba30..7f35cf0357c2 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs @@ -44,6 +44,7 @@ pub struct DeployL1DeployedAddressesOutput { pub governance_addr: Address, pub transparent_proxy_admin_addr: Address, pub validator_timelock_addr: Address, + pub chain_admin: Address, pub bridgehub: L1BridgehubOutput, pub bridges: L1BridgesOutput, pub state_transition: L1StateTransitionOutput, diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs index 0862d1018d89..7d34437ef2d2 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs @@ -36,7 +36,7 @@ use super::{ setup_observability, }; use crate::{ - accept_ownership::accept_owner, + accept_ownership::{accept_admin, accept_owner}, commands::{ chain::{self, args::init::PortOffset}, ecosystem::create_configs::{ @@ -332,6 +332,17 @@ async fn deploy_ecosystem_inner( ) .await?; + accept_admin( + shell, + config, + contracts_config.l1.chain_admin_addr, + config.get_wallets()?.governor_private_key(), + contracts_config.ecosystem_contracts.bridgehub_proxy_addr, + &forge_args, + l1_rpc_url.clone(), + ) + .await?; + accept_owner( shell, config, @@ -343,6 +354,17 @@ async fn deploy_ecosystem_inner( ) .await?; + accept_admin( + shell, + config, + contracts_config.l1.chain_admin_addr, + config.get_wallets()?.governor_private_key(), + contracts_config.bridges.shared.l1_address, + &forge_args, + l1_rpc_url.clone(), + ) + .await?; + accept_owner( shell, config, @@ -356,6 +378,19 @@ async fn deploy_ecosystem_inner( ) .await?; + accept_admin( + shell, + config, + contracts_config.l1.chain_admin_addr, + config.get_wallets()?.governor_private_key(), + contracts_config + .ecosystem_contracts + .state_transition_proxy_addr, + &forge_args, + l1_rpc_url.clone(), + ) + .await?; + Ok(contracts_config) }