Skip to content

Commit

Permalink
chore: remove old witness generator (matter-labs#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaVashchuk authored Dec 7, 2023
1 parent d84dd6f commit 6fefe62
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 4,635 deletions.
9 changes: 1 addition & 8 deletions core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,7 @@ async fn init_tasks(
.build()
.await
.context("failed to build a tree_pool")?;
// todo: PLA-335
// Note: This pool isn't actually used by the metadata calculator, but it has to be provided anyway.
let prover_tree_pool = ConnectionPool::singleton(&config.postgres.database_url)
.build()
.await
.context("failed to build a prover_tree_pool")?;
let tree_handle =
task::spawn(metadata_calculator.run(tree_pool, prover_tree_pool, tree_stop_receiver));
let tree_handle = task::spawn(metadata_calculator.run(tree_pool, tree_stop_receiver));

let consistency_checker_handle = tokio::spawn(consistency_checker.run(stop_receiver.clone()));

Expand Down
13 changes: 3 additions & 10 deletions core/bin/zksync_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct Cli {
/// Comma-separated list of components to launch.
#[arg(
long,
default_value = "api,tree,eth,data_fetcher,state_keeper,witness_generator,housekeeper,basic_witness_input_producer"
default_value = "api,tree,eth,data_fetcher,state_keeper,housekeeper,basic_witness_input_producer"
)]
components: ComponentsToRun,
}
Expand Down Expand Up @@ -151,16 +151,9 @@ async fn main() -> anyhow::Result<()> {
opt.components.0
};

// OneShotWitnessGenerator is the only component that is not expected to run indefinitely
// if this value is `false`, we expect all components to run indefinitely: we panic if any component returns.
let is_only_oneshot_witness_generator_task = matches!(
components.as_slice(),
[Component::WitnessGenerator(Some(_), _)]
);

// Run core actors.
let (core_task_handles, stop_sender, cb_receiver, health_check_handle) =
initialize_components(&configs, components, is_only_oneshot_witness_generator_task)
initialize_components(&configs, components)
.await
.context("Unable to start Core actors")?;

Expand All @@ -169,7 +162,7 @@ async fn main() -> anyhow::Result<()> {

let particular_crypto_alerts = None::<Vec<String>>;
let graceful_shutdown = None::<futures::future::Ready<()>>;
let tasks_allowed_to_finish = is_only_oneshot_witness_generator_task;
let tasks_allowed_to_finish = false;
tokio::select! {
_ = wait_for_tasks(core_task_handles, particular_crypto_alerts, graceful_shutdown, tasks_allowed_to_finish) => {},
_ = sigint_receiver => {
Expand Down
Loading

0 comments on commit 6fefe62

Please sign in to comment.