Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(en): Revert "feat(en): Fix operator address assignment for ENs" #977

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/bin/external_node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ impl PostgresConfig {
}
}

fn read_operator_address() -> anyhow::Result<Address> {
Ok(std::env::var("EN_OPERATOR_ADDR")?.parse()?)
}

pub(crate) fn read_consensus_config() -> anyhow::Result<consensus::FetcherConfig> {
let path = std::env::var("EN_CONSENSUS_CONFIG_PATH")
.context("EN_CONSENSUS_CONFIG_PATH env variable is not set")?;
Expand All @@ -425,6 +429,7 @@ pub(crate) fn read_consensus_config() -> anyhow::Result<consensus::FetcherConfig
let node_key: node::SecretKey = consensus::config::read_secret("EN_CONSENSUS_NODE_KEY")?;
Ok(consensus::FetcherConfig {
executor: cfg.executor_config(node_key),
operator_address: read_operator_address().context("read_operator_address()")?,
})
}

Expand Down
5 changes: 1 addition & 4 deletions core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ async fn init_tasks(
let consistency_checker_handle = tokio::spawn(consistency_checker.run(stop_receiver.clone()));

let updater_handle = task::spawn(batch_status_updater.run(stop_receiver.clone()));
let fee_address_migration_handle =
task::spawn(state_keeper.run_fee_address_migration(connection_pool.clone()));
let sk_handle = task::spawn(state_keeper.run());
let fee_params_fetcher_handle =
tokio::spawn(fee_params_fetcher.clone().run(stop_receiver.clone()));
Expand Down Expand Up @@ -357,13 +355,12 @@ async fn init_tasks(
task_handles.extend(cache_update_handle);
task_handles.extend([
sk_handle,
fee_address_migration_handle,
fetcher_handle,
updater_handle,
tree_handle,
consistency_checker_handle,
fee_params_fetcher_handle,
]);
task_handles.push(consistency_checker_handle);

Ok((task_handles, stop_sender, healthcheck_handle, stop_receiver))
}
Expand Down
10 changes: 8 additions & 2 deletions core/bin/snapshots_creator/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ async fn create_miniblock(
hash: H256::from_low_u64_be(u64::from(miniblock_number.0)),
l1_tx_count: 0,
l2_tx_count: 0,
fee_account_address: Address::repeat_byte(1),
base_fee_per_gas: 0,
gas_per_pubdata_limit: 0,
batch_fee_input: Default::default(),
Expand All @@ -165,7 +164,14 @@ async fn create_l1_batch(
l1_batch_number: L1BatchNumber,
logs_for_initial_writes: &[StorageLog],
) {
let header = L1BatchHeader::new(l1_batch_number, 0, Default::default(), Default::default());
let mut header = L1BatchHeader::new(
l1_batch_number,
0,
Address::default(),
Default::default(),
Default::default(),
);
header.is_finished = true;
conn.blocks_dal()
.insert_mock_l1_batch(&header)
.await
Expand Down
6 changes: 6 additions & 0 deletions core/bin/zksync_server/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use anyhow::Context as _;
use zksync_consensus_roles::{node, validator};
use zksync_core::consensus;
use zksync_types::Address;

fn read_operator_address() -> anyhow::Result<Address> {
Ok(std::env::var("CHAIN_STATE_KEEPER_FEE_ACCOUNT_ADDR")?.parse()?)
}

pub(crate) fn read_consensus_config() -> anyhow::Result<consensus::MainNodeConfig> {
let path = std::env::var("CONSENSUS_CONFIG_PATH").context("CONSENSUS_CONFIG_PATH")?;
Expand All @@ -13,5 +18,6 @@ pub(crate) fn read_consensus_config() -> anyhow::Result<consensus::MainNodeConfi
Ok(consensus::MainNodeConfig {
executor: cfg.executor_config(node_key),
validator: cfg.validator_config(validator_key),
operator_address: read_operator_address().context("read_operator_address()")?,
})
}

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading