Skip to content
Merged
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
23 changes: 18 additions & 5 deletions crates/l2/sequencer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use l1_watcher::L1Watcher;
#[cfg(feature = "metrics")]
use metrics::MetricsGatherer;
use proof_coordinator::ProofCoordinator;
use tokio::task::JoinSet;
use tokio_util::sync::CancellationToken;
use tracing::{error, info};
use utils::get_needed_proof_types;
Expand Down Expand Up @@ -58,7 +57,7 @@ pub async fn start_l2(
cfg.l1_committer.on_chain_proposer_address,
)
.await
.inspect_err(|e| error!("Error starting Proposer: {e}")) else {
.inspect_err(|e| error!("Error starting Sequencer: {e}")) else {
return Ok(());
};

Expand Down Expand Up @@ -130,13 +129,13 @@ pub async fn start_l2(
.inspect_err(|err| {
error!("Error starting Block Producer: {err}");
});
let mut verifier_handle = None;

let mut task_set: JoinSet<Result<(), errors::SequencerError>> = JoinSet::new();
if needed_proof_types.contains(&ProverType::Aligned) {
task_set.spawn(l1_proof_verifier::start_l1_proof_verifier(
verifier_handle = Some(tokio::spawn(l1_proof_verifier::start_l1_proof_verifier(
cfg.clone(),
rollup_store.clone(),
));
)));
}
if cfg.based.based {
let _ = StateUpdater::spawn(
Expand Down Expand Up @@ -174,5 +173,19 @@ pub async fn start_l2(
.await?;
}

let Some(handle) = verifier_handle else {
return Ok(());
};

match handle.await {
Ok(Ok(_)) => {}
Ok(Err(err)) => {
error!("Error running verifier: {err}");
}
Err(err) => {
error!("Task error: {err}");
}
};

Ok(())
}