2 suggestions
Earlier concerns neither republished nor resolved: 1 major finding · 3 minor findings · 9 suggestions. See the Run archive for their assessments.
Optional improvements
[suggestion] · Assign() seed and query-set rules lack regression tests
Regressions in endpoint deduplication or in distributing first attempts across seeds and query sets would not be caught by the tests in this PR.
Location: src/test/privbcast_plan_tests.cpp:17 (head).
Details and suggested fix
The unit test checks only the mainnet seed count. The functional tests configure at most two DNS seeds, fewer than SLOTS, and the fuzz target exercises Attempt, not Assign(). As a result, the tests do not cover R5b's limit of one first attempt per seed or R5c's query-set preference with enough seeds to exercise those rules. Add deterministic, table-driven unit tests that build a Plan with a fixed FastRandomContext and use synthetic DiscoveryResults. Cover duplicate endpoints across seeds and query sets, a seed with no answers, and fewer candidates than opportunities. Assert endpoint uniqueness (R4), that all first opportunities are filled before backups (R5a), that no seed receives a second first attempt while another seed has a candidate (R5b), and that slot j uses query set j mod 4 when available (R5c).
[suggestion] · StartPolicy::Decide rules lack unit tests, and a comment refers to absent coverage
The tests in this PR do not cover start spacing, discovery overlap, clock step-back, the job cap, or dropping queued work without a proxy.
Location: src/test/privbcast_queue_tests.cpp:16 (head).
Details and suggested fix
StartPolicy::Decide is a pure function of a snapshot, two clocks, and a spacing value, and PrivbcastQueue accepts an injectable JobRunner. Yet privbcast_queue_tests checks only FileDescriptorBudget arithmetic. No test asserts that starts are at least START_SPACING_MIN apart (N3), that no job starts while a running job's discovery remains open (N4), or that the clock step-back, JOB_CAP, and drop_queued rules work. The functional test advances the clock by START_SPACING_MAX_S to start jobs, while its comment says unit tests check the bound; no such unit test is present here. The friend struct PrivbcastQueueTest declaration also has no definition. Add table-driven Decide tests for these rules. If they are deferred, remove the unused friend declaration and correct the functional-test comment.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Progress publication can stall the job loop on the queue mutex
- [minor]: A due slot can dial after its grace period using a stale clock
- [suggestion]: A delayed first step can forfeit the remaining discovery window
- [suggestion]: Make the queue-cap test independent of the running job's real-time limit (earlier report)
- [suggestion]: Make private-broadcast refusal causes distinguishable to RPC clients (earlier report)
- [major]: Preserve the previous info response during deprecation (earlier report)
- [suggestion]: Check the
-privatebroadcastrefusal message (earlier report) - [minor]: Track removals before recording delayed mempool-add notifications (earlier report)
- [suggestion]: The not-Tor proxy test relies on four exchanges finishing within 240 ms (earlier report)
- [minor]: The descriptor check rejects private broadcast on select() builds with
FD_SETSIZE256 (earlier report) - [suggestion]: The design overstates the bound on first attempts per exit (earlier report)
- [suggestion]: A valid IPv4-only configuration can be rejected despite having a Tor proxy (earlier report)
- [suggestion]: SOCKS5 handshake failures are silently dropped for all functional tests (earlier report)