Skip to content

Conversation

@eroderust
Copy link

Motivation

Replaced the periodic polling loop in Consensus::start_handlers with a notification-based approach to improve efficiency.
The transaction pool is now processed only when triggered by relevant events:

  • When Primary successfully proposes a batch (freeing up worker capacity).
  • When Consensus advances to a new block (clearing the mempool).

This eliminates unnecessary wake-ups and addresses the TODO to synchronize transaction processing with BFT layer activity.

Test Plan

If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!

Documentation

If this PR adds or changes functionality, consider clarifying which docs need to be updated, e.g. on AleoNet/welcome.

Backwards compatibility

Please review backwards compatibility. Does any functionality need to be guarded by an existing or new ConsensusVersion?

Signed-off-by: eroderust <eroderust@outlook.com>
@vicsn vicsn requested a review from kaimast December 5, 2025 11:33
@vicsn
Copy link
Collaborator

vicsn commented Dec 5, 2025

Thank you for your contribution.

addresses the TODO to synchronize transaction processing with BFT layer activity.

Can you more clearly reference an existing issue or remove an existing TODO from the code?

@eroderust
Copy link
Author

Thank you for your contribution.

addresses the TODO to synchronize transaction processing with BFT layer activity.

Can you more clearly reference an existing issue or remove an existing TODO from the code?

@vicsn Thank you for your reply. I'm trying to improve this TODO item.

https://github.com/ProvableHQ/snarkOS/blob/staging/node/consensus/src/lib.rs#L577


// Process the unconfirmed transactions in the memory pool.
//
// TODO (kaimast): This shouldn't happen periodically but only when new batches/blocks are accepted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this TODO.

@kaimast
Copy link
Contributor

kaimast commented Dec 5, 2025

This looks great!

Can you check why the unit tests for snarkos-node-bft are failing? It looks like a simple compilation error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants