Merged
Conversation
Collaborator
Author
|
Gemini loves it This is an excellent PR! 🎉 I've checked out the code and reviewed the changes. Everything compiles perfectly and the logic is very sound. Here is my review of the changes: 🌟 The Good Stuff
💡 ConclusionThe code is completely solid, minimal, and fully adheres to Rust's concurrency guarantees (the compiler perfectly proves that the |
Collaborator
Author
|
GPT and Grok also love it |
illuzen
approved these changes
Mar 4, 2026
Contributor
illuzen
left a comment
There was a problem hiding this comment.
I think the fact that only one thread needs it also means that blocking would not make much of a difference, but I like the simplicity
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.
Remove blocking executor and unnecessary mutex from mining submission
The mining loop (
qpow-mining) runs as an async task on the tokio thread pool. Block submission previously usedfutures::executor::block_on(worker_handle.submit(seal)), which parked the tokio worker thread for the duration of the block import. This was a workaround becauseparking_lot::MutexGuardis!Send, making thesubmit()future incompatible with.awaitin a tokio context.The underlying issue was that
block_importwas wrapped in aparking_lot::Mutexdespite not needing one --BlockImport::import_blocktakes&self, andsubmit()is only ever called from the single mining loop. There is no concurrent access to synchronize.Changes:
Mutexaroundblock_importinMiningHandle, replacingArc<Mutex<BoxBlockImport>>withArc<BoxBlockImport>futures::executor::block_on(worker_handle.submit(seal))with.awaitat both call sitessubmit_mined_blockasync#[allow(clippy::await_holding_lock)]