Skip to content

A full pending queue no longer blocks peers the auto-accept rules would take - #45

Merged
TeoSlayer merged 1 commit into
mainfrom
fix/pending-full-skips-auto-accept
Oct 7, 2026
Merged

TeoSlayer merged 1 commit into
mainfrom
fix/pending-full-skips-auto-accept

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Summary

When the pending-handshake queue was full (256 entries, or 16 from one source), handleRequest and processRelayedRequest dropped every new peer before the auto-accept rules ran. A node with trust-auto-approve on, a mutual request outstanding, a shared network or an allow-listed peer refused handshakes it would have accepted without queueing anything.

The early check existed to keep over-cap spam from reaching the control hook. The hook was removed in #44; the check stayed.

Changes

  • Remove the early "pending queue full" return from both handlers. The already-trusted fast path is unchanged.
  • The caps are still enforced where a request is actually queued, at the end of each handler, so a request with nothing to auto-accept is still neither queued nor trusted once the queue is full.

Test Plan

  • go build ./..., go vet ./..., go test ./... -count=1
  • New TestFullPendingQueueDoesNotBlockAutoAccept: auto-approve (direct and relayed) and a mutual relayed request are trusted with the queue full; with no auto-accept rule the peer is still not queued. The first three subtests fail on main.
  • Existing over-cap tests (TestPreChecksHandleAlreadyTrustedAndOverCap, TestHandleRequestPendingQueueFullRejects, the per-source flood test) pass unchanged.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…ld take

handleRequest and processRelayedRequest dropped any new peer when the
pending queue was full, before the mutual / shared-network / trusted-agent /
trust-auto-approve rules ran. The check was there to keep over-cap spam away
from the control hook; the hook is gone (#44) and the check is not: a node
with trust-auto-approve on, or with a mutual request outstanding, refused
peers it would have trusted without queueing them.

The caps are still enforced where a request is actually queued, so over-cap
spam with nothing to auto-accept is neither queued nor trusted, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TeoSlayer
TeoSlayer force-pushed the fix/pending-full-skips-auto-accept branch from 73c5a2e to 7522138 Compare October 7, 2026 13:06
@TeoSlayer
TeoSlayer merged commit 7d2839d into main Oct 7, 2026
4 checks passed
@TeoSlayer
TeoSlayer deleted the fix/pending-full-skips-auto-accept branch October 7, 2026 13:46
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.

1 participant