Review report

core: PR #36628

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

Link

[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).


Link

[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.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.