Skip to content

Commit

Permalink
Remove block proposer
Browse files Browse the repository at this point in the history
Signed-off-by: deniallugo <[email protected]>
  • Loading branch information
Deniallugo committed Mar 11, 2022
1 parent 795385c commit 84a93e2
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 229 deletions.
29 changes: 0 additions & 29 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ members = [
# Test infrastructure
"core/tests/flamegraph_target",
"core/tests/test_account",
"core/tests/testkit",
# "core/tests/testkit",
"core/tests/loadnext",

# SDK section
Expand Down
132 changes: 0 additions & 132 deletions core/bin/zksync_core/src/block_proposer.rs

This file was deleted.

22 changes: 6 additions & 16 deletions core/bin/zksync_core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::register_factory_handler::run_register_factory_handler;
use crate::state_keeper::ZkSyncStateInitParams;
use crate::{
block_proposer::run_block_proposer_task,
committer::run_committer,
eth_watch::start_eth_watch,
mempool::run_mempool_tasks,
Expand All @@ -18,7 +17,6 @@ use zksync_types::{tokens::get_genesis_token_list, Token, TokenId, TokenKind};

const DEFAULT_CHANNEL_CAPACITY: usize = 32_768;

pub mod block_proposer;
pub mod committer;
pub mod eth_watch;
pub mod mempool;
Expand Down Expand Up @@ -98,8 +96,6 @@ pub async fn run_core(
) -> anyhow::Result<Vec<JoinHandle<()>>> {
let (proposed_blocks_sender, proposed_blocks_receiver) =
mpsc::channel(DEFAULT_CHANNEL_CAPACITY);
let (state_keeper_req_sender, state_keeper_req_receiver) =
mpsc::channel(DEFAULT_CHANNEL_CAPACITY);
let (eth_watch_req_sender, eth_watch_req_receiver) = mpsc::channel(DEFAULT_CHANNEL_CAPACITY);
let (mempool_tx_request_sender, mempool_tx_request_receiver) =
mpsc::channel(DEFAULT_CHANNEL_CAPACITY);
Expand Down Expand Up @@ -133,18 +129,21 @@ pub async fn run_core(
let (mut state_keeper, root_hash_calculator) = ZkSyncStateKeeper::new(
state_keeper_init,
config.chain.state_keeper.fee_account_addr,
state_keeper_req_receiver,
proposed_blocks_sender,
mempool_block_request_sender,
config.chain.state_keeper.block_chunk_sizes.clone(),
config.chain.state_keeper.miniblock_iterations as usize,
config.chain.state_keeper.fast_block_miniblock_iterations as usize,
processed_tx_events_sender,
);
let root_hash_queue = state_keeper.root_hash_queue();

// Execute reverted blocks before start
state_keeper.execute_reverted_blocks().await;

let state_keeper_task = start_state_keeper(state_keeper);
let state_keeper_task = start_state_keeper(
state_keeper,
config.chain.state_keeper.miniblock_iteration_interval(),
);
let root_hash_calculator_task = start_root_hash_calculator(root_hash_calculator);

// Start committer.
Expand Down Expand Up @@ -184,14 +183,6 @@ pub async fn run_core(
processed_tx_events_receiver,
);

// Start block proposer.
let proposer_task = run_block_proposer_task(
config,
mempool_block_request_sender.clone(),
state_keeper_req_sender.clone(),
root_hash_queue,
);

// Start private API.
let private_api_task =
start_private_core_api(mempool_tx_request_sender, config.api.private.clone());
Expand All @@ -202,7 +193,6 @@ pub async fn run_core(
root_hash_calculator_task,
committer_task,
mempool_task,
proposer_task,
token_handler_task,
register_factory_task,
tx_event_emitter_task,
Expand Down
1 change: 1 addition & 0 deletions core/bin/zksync_core/src/mempool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ impl MempoolBlocksHandler {
let start = std::time::Instant::now();
// Try to exhaust the reverted transactions queue. Most of the time it
// will be empty unless the server is restarted after reverting blocks.
// TODO remove it. We use another approach how to correctly revert blocks
let (chunks_left, reverted_block) = self
.select_reverted_operations(current_unprocessed_priority_op)
.await;
Expand Down
Loading

0 comments on commit 84a93e2

Please sign in to comment.