Replace parking_lot Mutex with tokio Mutex to align with kona-node async primitives#433
Open
Replace parking_lot Mutex with tokio Mutex to align with kona-node async primitives#433
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
avalonche
approved these changes
Nov 6, 2025
theochap
reviewed
Nov 7, 2025
| use http::Uri; | ||
| use jsonrpsee::core::client::ClientT; | ||
| use parking_lot::Mutex; | ||
| use std::sync::Mutex; |
Contributor
There was a problem hiding this comment.
nit: We should tokio mutexes here.
Suggested change
| use std::sync::Mutex; | |
| use tokio::sync::Mutex; |
theochap
reviewed
Nov 7, 2025
| use std::net::TcpListener; | ||
| use std::path::PathBuf; | ||
| use std::str::FromStr; | ||
| use std::sync::Mutex; |
Contributor
There was a problem hiding this comment.
We should use tokio mutexes here
Suggested change
| use std::sync::Mutex; | |
| use tokio::sync::Mutex; |
0xForerunner
requested changes
Dec 17, 2025
Collaborator
0xForerunner
left a comment
There was a problem hiding this comment.
parking_lot::Mutex is incompatible with certain concurrency primitives used by kona-node.
I'm not convinced that this is necessary. From tokios own documentation:
Contrary to popular belief, it is ok and often preferred to use the ordinary Mutex from the standard library in asynchronous code.
Maybe you could provide some more detailed information on why you think this is required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Change summary
lock().awaitand adjust signatures to be async where necessary.std::sync::Mutex.Scope
server,health,probe,debug_api(runtime paths) now usetokio::sync::Mutex.std::sync::Mutex..awaitinside non-async contexts.Incidental behavior adjustments (in service of the migration)
Testing and verification
std::sync::Mutexfor mock state.Risk and rollout
Follow-ups
flashblocks/inbound.rs) for any lingeringparking_lot::Mutexon async paths and migrate totokio::sync::Mutexwhere applicable.