-
Notifications
You must be signed in to change notification settings - Fork 101
fix(l2): join verifier task #3781
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR restores a missing join()
operation for the verifier task that was accidentally removed in a previous change (#3635). The fix ensures proper task lifecycle management in the L2 sequencer by waiting for spawned tasks to complete and handling their results appropriately.
- Adds back the
task_set.join_next().await
call to wait for task completion - Implements proper error handling for task results with logging for both task errors and JoinSet errors
- Adds a fallback loop to keep the sequencer running when no tasks are spawned
Lines of code reportTotal lines added: Detailed view
|
crates/l2/sequencer/mod.rs
Outdated
if let Some(res) = task_set.join_next().await { | ||
// If a task finishes, the whole sequencer should stop | ||
match res { | ||
Ok(Ok(_)) => {} | ||
Ok(Err(err)) => { | ||
error!("Error starting Sequencer: {err}"); | ||
} | ||
Err(err) => { | ||
error!("JoinSet error: {err}"); | ||
} | ||
}; | ||
task_set.abort_all(); | ||
} else { | ||
// If no tasks were spawned, we let the sequencer run until it is cancelled | ||
loop { | ||
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably can omit the else, it is not needed anymore, also since there is only one task, the abort all does nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to make this change, then we could just spawn it directly instead of using the join set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done cff4abd!
crates/l2/sequencer/mod.rs
Outdated
@@ -174,5 +173,17 @@ pub async fn start_l2( | |||
.await?; | |||
} | |||
|
|||
if let Some(handle) = verifier_handle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use let else
to remove one indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 61b429e!
**Motivation** The `join()` of the verifier task was accidentally removed in lambdaclass#3635. **Description** This PR is a quick fix that restores the removed `join()`. The verifier task is being replaced by spawned in lambdaclass#3761. Closes None
Motivation
The
join()
of the verifier task was accidentally removed in #3635.Description
This PR is a quick fix that restores the removed
join()
. The verifier task is being replaced by spawned in #3761.Closes None