Skip to content

Commit

Permalink
Post-merge fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
popzxc committed Nov 7, 2023
1 parent 66ac9f6 commit 2e9a975
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions core/lib/config/src/configs/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ impl ContractsConfig {
Self {
mailbox_facet_addr: Address::repeat_byte(0x01),
executor_facet_addr: Address::repeat_byte(0x02),
governance_facet_addr: Address::repeat_byte(0x03),
diamond_cut_facet_addr: Address::repeat_byte(0x04),
admin_facet_addr: Address::repeat_byte(0x03),
getters_facet_addr: Address::repeat_byte(0x05),
verifier_addr: Address::repeat_byte(0x06),
diamond_init_addr: Address::repeat_byte(0x07),
Expand All @@ -75,7 +74,8 @@ impl ContractsConfig {
fri_recursion_scheduler_level_vk_hash: H256::repeat_byte(0x06),
fri_recursion_node_level_vk_hash: H256::repeat_byte(0x07),
fri_recursion_leaf_level_vk_hash: H256::repeat_byte(0x08),
governance_addr: Some(Address::repeat_byte(0x13)),
governance_addr: Address::repeat_byte(0x13),
prover_at_genesis: ProverAtGenesis::Fri,
snark_wrapper_vk_hash: H256::repeat_byte(0x09),
}
}
Expand Down
12 changes: 7 additions & 5 deletions core/lib/env_config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ impl FromEnv for ContractsConfig {
mod tests {
use super::*;
use crate::test_utils::{addr, hash, EnvMutex};
use zksync_config::configs::contracts::ProverAtGenesis;

static MUTEX: EnvMutex = EnvMutex::new();

fn expected_config() -> ContractsConfig {
ContractsConfig {
governance_addr: addr("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"),
mailbox_facet_addr: addr("0f6Fa881EF414Fc6E818180657c2d5CD7Ac6cCAd"),
executor_facet_addr: addr("18B631537801963A964211C0E86645c1aBfbB2d3"),
governance_facet_addr: addr("1e12b20BE86bEc3A0aC95aA52ade345cB9AE7a32"),
diamond_cut_facet_addr: addr("8656770FA78c830456B00B4fFCeE6b1De0e1b888"),
admin_facet_addr: addr("1e12b20BE86bEc3A0aC95aA52ade345cB9AE7a32"),
getters_facet_addr: addr("8656770FA78c830456B00B4fFCeE6b1De0e1b888"),
verifier_addr: addr("34782eE00206EAB6478F2692caa800e4A581687b"),
diamond_init_addr: addr("FFC35A5e767BE36057c34586303498e3de7C62Ba"),
Expand Down Expand Up @@ -59,7 +60,7 @@ mod tests {
fri_recursion_leaf_level_vk_hash: hash(
"0x72167c43a46cf38875b267d67716edc4563861364a3c03ab7aee73498421e828",
),
governance_addr: None,
prover_at_genesis: ProverAtGenesis::Fri,
snark_wrapper_vk_hash: hash(
"0x4be443afd605a782b6e56d199df2460a025c81b3dea144e135bece83612563f2",
),
Expand All @@ -70,10 +71,10 @@ mod tests {
fn from_env() {
let mut lock = MUTEX.lock();
let config = r#"
CONTRACTS_GOVERNANCE_ADDR="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
CONTRACTS_MAILBOX_FACET_ADDR="0x0f6Fa881EF414Fc6E818180657c2d5CD7Ac6cCAd"
CONTRACTS_EXECUTOR_FACET_ADDR="0x18B631537801963A964211C0E86645c1aBfbB2d3"
CONTRACTS_GOVERNANCE_FACET_ADDR="0x1e12b20BE86bEc3A0aC95aA52ade345cB9AE7a32"
CONTRACTS_DIAMOND_CUT_FACET_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888"
CONTRACTS_ADMIN_FACET_ADDR="0x1e12b20BE86bEc3A0aC95aA52ade345cB9AE7a32"
CONTRACTS_GETTERS_FACET_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888"
CONTRACTS_VERIFIER_ADDR="0x34782eE00206EAB6478F2692caa800e4A581687b"
CONTRACTS_DIAMOND_INIT_ADDR="0xFFC35A5e767BE36057c34586303498e3de7C62Ba"
Expand All @@ -96,6 +97,7 @@ CONTRACTS_L1_MULTICALL3_ADDR="0xcA11bde05977b3631167028862bE2a173976CA11"
CONTRACTS_FRI_RECURSION_SCHEDULER_LEVEL_VK_HASH="0x201d4c7d8e781d51a3bbd451a43a8f45240bb765b565ae6ce69192d918c3563d"
CONTRACTS_FRI_RECURSION_NODE_LEVEL_VK_HASH="0x5a3ef282b21e12fe1f4438e5bb158fc5060b160559c5158c6389d62d9fe3d080"
CONTRACTS_FRI_RECURSION_LEAF_LEVEL_VK_HASH="0x72167c43a46cf38875b267d67716edc4563861364a3c03ab7aee73498421e828"
CONTRACTS_PROVER_AT_GENESIS="fri"
CONTRACTS_SNARK_WRAPPER_VK_HASH="0x4be443afd605a782b6e56d199df2460a025c81b3dea144e135bece83612563f2"
"#;
lock.set_env(config);
Expand Down
7 changes: 2 additions & 5 deletions core/lib/zksync_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use zksync_config::{
CircuitBreakerConfig, MempoolConfig, NetworkConfig, OperationsManagerConfig,
StateKeeperConfig,
},
contracts::ProverAtGenesis,
database::MerkleTreeMode,
},
ApiConfig, ContractsConfig, DBConfig, ETHSenderConfig,
Expand Down Expand Up @@ -587,11 +588,7 @@ pub async fn initialize_components(
.build()
.await
.context("failed to build eth_watch_pool")?;
let governance = contracts_config.governance_addr.map(|addr| {
let contract = governance_contract()
.expect("Governance contract must be present if governance_addr is set in config");
(contract, addr)
});
let governance = (governance_contract(), contracts_config.governance_addr);
let eth_watch_config = configs
.eth_watch_config
.clone()
Expand Down

0 comments on commit 2e9a975

Please sign in to comment.