Skip to content

Fix dissemination queue comparison operator - #86

Merged
asonnino merged 2 commits into
asonnino:mainfrom
Zaltad:wrong-comparison
Nov 1, 2026
Merged

asonnino merged 2 commits into
asonnino:mainfrom
Zaltad:wrong-comparison

Conversation

@Zaltad

@Zaltad Zaltad commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

I think comparison operator is inverted here and pending never has elements pushed to it (given that pending_counter = 0; is initialized).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A stalled quorum wait prevents queued cleanup futures from being polled, leaving earlier batches’ 500 ms deadlines unenforced and their transmission handles alive indefinitely.

1 open issue
What changed in this PR

Corrects the mempool’s dissemination queue check so batches can retain transmission handles briefly after reaching quorum, giving slower peers time to receive them.

Changes:

  • Enqueues pending dissemination work while the queue is below its limit, rather than only when it is already full.
File Description
mempool/​src/​quorum_waiter.rs Reverses the queue-capacity comparison to allow pending dissemination work.

Review effort: Balanced

// immediately dropping the handles.
// TODO: We should allocate resource per peer (not in total).
if pending_counter >= DISSEMINATION_QUEUE_MAX {
if pending_counter < DISSEMINATION_QUEUE_MAX {

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the change to the mempool’s dissemination queue capacity check.

1 open issue

Review effort: Balanced

@asonnino
asonnino merged commit 082d36d into asonnino:main Nov 1, 2026
1 check passed
@Zaltad
Zaltad deleted the wrong-comparison branch November 9, 2026 19:05
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