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

chore: remove old witness generator #619

Merged
merged 13 commits into from
Dec 7, 2023
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) => {},
EmilLuta marked this conversation as resolved.
Show resolved Hide resolved
_ = sigint_receiver => {
Expand Down
Loading