Skip to content

test(dash-spv): pass bans to admit in a filter test - #1537

Merged
ZocoLini merged 1 commit into
devfrom
fix/admit-bans-in-test
Nov 26, 2026
Merged

ZocoLini merged 1 commit into
devfrom
fix/admit-bans-in-test

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

#1483 added a Bans parameter to PeerSet::admit, and #1532 added a test that calls admit without it. Both merged into dev in parallel, so the dash-spv test target no longer compiles there and every PR's dash-spv CI fails.

This passes &net.state.bans in that test.

PR Hygiene · 63e3eb6

  • Bots — coderabbitai ✓
  • Self-review — post /self-reviewed
  • Reviewer requests paused — your 5 review slots are occupied; this PR is excluded from reviewers' queues. Required approvals still count without a slot.
  • Build running
  • Approvals
    • dash-spv (dash-spv/src/network/manager.rs) — QuantumExplorer or xdustinface

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

#1483 added a `Bans` parameter to `PeerSet::admit` while #1532 added a test calling it without one. Both merged, so the `dash-spv` test target does not compile on `dev`.
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2fdb2d1 and 63e3eb6.

Files selected for processing: 1

  • dash-spv/src/network/manager.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@manki-review

manki-review Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Review complete in 3m 39s

Planner (5s)
    fix · 7 lines · 2 agents
    judge effort: medium

Review (behavior · full): 2 findings
    ✅ Claude Opus 5.5 · high: 0 findings (20s)
    ✅ GPT 6.2 Sol · high: 2 findings (1m 33s)
    ✅ Related checks and claim checks: 5 of 5 done (30s)
    ✅ Second reads: 1 of 1 done (9s)

Judge (1m 12s)
    graded 2 findings: 1 kept · 1 dropped
    dropped, as the finders filed them: 1 blocker
    refuter: 1 checked · 1 confirmed
    sweeps: 1 of 1 done (4s)

Posted: 1 finding
    1 blocker

Review metadata

Config:

  • Models: reviewer=claude-opus-5-5, judge=claude-opus-5-5
  • Triage: trivial=false, subtle=true, paired=true (planner)
  • Team: Claude Opus 5.5 · high, GPT 6.2 Sol · high
  • Memory: enabled (central)

Account limits:

  • Claude subscription: weekly 26% (resets 2026-12-02 17:00 UTC)
  • ChatGPT subscription: weekly 3% (resets 2026-12-02 01:49 UTC)

Judge decisions:

  • Kept: "Peer messages can exhaust memory in the inbound and subscriber queues" (blocker): "warning. Both queues are unbounded: dash-spv/src/network/manager.rs:266 and :399 create them, and peer.rs:794 and peer.rs:820 push decoded payloads with no backpressure. A flooding peer could therefore grow memory. Two premises stay open: whether ledger.settle or another check limits unsolicited traffic, and whether a subscriber realistically falls behind. This exhaustion class is held down while those doubts are open. The PR changes only an argument in a unit test, so the defect sits in unchanged code and is marked pre-existing.
    Refutation confirmed: A peer's reader task decodes every frame and pushes it into the unbounded inbound queue with no throttle; ledger.settle only does bookkeeping for replies it was waiting for. The pump then forwards unsolicited inv, headers and cfilter messages to unbounded per-manager queues. Each manager drains its queue one message at a time and awaits the handler for each, so no part of the path drops, limits or bans a peer that floods. Rule checked: A tokio mpsc unbounded_channel never applies backpressure: send() always succeeds and holds the value until the receiver takes it, so a producer faster than its consumer grows memory without limit.
  • Premise "A peer's reader task at dash-spv/src/network/peer.rs:820 forwards unsolicited messages into inbound with no limit, and ledger.settle at dash-spv/src/network/peer.rs:776 does not throttle or disconnect a peer that sends faster than the pump and subscribers drain" confirmed. The reader loop sends every payload into the unbounded inbound queue with no limit. Ledger.settle only matches a message against awaited replies and returns early when it is not one, without throttling or disconnecting the peer.
  • Premise "Messages a peer sends without being asked, such as inv or headers, reach a subscriber channel created at dash-spv/src/network/manager.rs:399 whose consumer can stall, for example while awaiting store_and_match_batches at dash-spv/src/sync/filters/sync_manager.rs:155" confirmed. The pump forwards any inv, headers or cfilter to its subscriber queues without checking whether it was requested. Each manager's run loop takes one message at a time and awaits handle_message before taking the next; for the filter manager that includes store_and_match_batches.
    Pair refutation confirmed: The reader queues decoded messages even when they match no outstanding request. The pump forwards them by message type without waiting for the subscriber to drain them. This confirms memory growth with backlog size, not that an out-of-memory exit was observed; the shown test-only change did not introduce the defect. Rule checked: An unbounded queue retains each unread payload without waiting for its consumer, so a per-message size limit does not bound total backlog memory.
  • Premise "A peer's reader task at dash-spv/src/network/peer.rs:820 forwards unsolicited messages into inbound with no limit, and ledger.settle at dash-spv/src/network/peer.rs:776 does not throttle or disconnect a peer that sends faster than the pump and subscribers drain" confirmed. Settlement returns normally when there is no matching reply, and the reader then enqueues the decoded payload without a queue-depth check or a wait for capacity.
  • Premise "Messages a peer sends without being asked, such as inv or headers, reach a subscriber channel created at dash-spv/src/network/manager.rs:399 whose consumer can stall, for example while awaiting store_and_match_batches at dash-spv/src/sync/filters/sync_manager.rs:155" confirmed. The pump routes unsolicited inventory to the block-header subscriber by type alone, and that subscriber can pause receives during header storage; the cited filter-storage await is a separate example for compact-filter traffic."
  • Dropped: "Peer address churn grows the ban table and receive counters without a limit" (ignore): "ignore. dash-spv/src/network/bans.rs and the recv_by_peer code are not in this diff, which changes only one test call. The growth is also slow: one small entry per distinct dialed address, and dials are rate limited by the backoff in bans.rs:57. No consequence anyone would notice is shown, so at most this would be a cost-only note, and a note resting on unchanged code is dropped."

Timing:

  • Parse: 4.1s
  • Review agents: 142.9s
  • Judge: 72.3s
  • Total: 219.3s

Last reviewed 63e3eb6 · head 63e3eb6 · up to date

  • Pause automatic reviews
  • Review again
  • Deeper review

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 26, 2026
manki-review[bot]
manki-review Bot previously requested changes Nov 26, 2026

@manki-review manki-review Bot 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 requested: 1 blocker.

What blocks: A connected peer can send messages faster than the pump or a sync manager can process them. Both queues retain decoded payloads, so the memory used by the backlog grows even when every individual message fits the wire size limit.

About this review
  • Reviewed 63e3eb6, round 1
  • 7 changed lines read in 3m 39s
  • Found by claude-opus-5-5 and gpt-6.2-sol, judged by claude-opus-5-5
  • Tokens: 1.9M in (1.4M from cache) · 19k out · about $2.46 at API prices
  • Runner: self-hosted · started after 8s · peak memory 2.6 GiB of 30.0 GiB
  • How Manki reviews

Comment thread dash-spv/src/network/manager.rs Resolved
@ZocoLini

Copy link
Copy Markdown
Collaborator Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor
Action performed

Comments resolved and changes approved.

@manki-review manki-review Bot 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.

✅ Approved. All blocking threads are resolved.

Findings dismissed by the PR author @ZocoLini (maintain role):

@manki-review
manki-review Bot dismissed their stale review November 26, 2026 19:03

Superseded by new review

@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 26, 2026
@ZocoLini
ZocoLini merged commit 05a3643 into dev Nov 26, 2026
38 of 42 checks passed
@ZocoLini
ZocoLini deleted the fix/admit-bans-in-test branch November 26, 2026 19:04
manki-review Bot added a commit to manki-review/review-memory that referenced this pull request Nov 26, 2026
@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.69%. Comparing base (2fdb2d1) to head (63e3eb6).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1537      +/-   ##
==========================================
+ Coverage   83.37%   87.69%   +4.32%     
==========================================
  Files         170      270     +100     
  Lines       45815    72143   +26328     
==========================================
+ Hits        38198    63267   +25069     
- Misses       7617     8876    +1259     
Flag Coverage Δ
core 83.37% <ø> (ø)
rpc 83.37% <ø> (ø)
spv 95.21% <100.00%> (?)
wallet 83.37% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/network/manager.rs 97.50% <100.00%> (ø)

... and 99 files with indirect coverage changes

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

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant