2 minor findings · 1 suggestion
Earlier concerns neither republished nor resolved: 2 minor findings · 3 suggestions. See the Run archive for their assessments.
Findings
[minor] · Fuzz eviction leaves the replacement transaction without an addition time
After an eviction, the fuzz harness's GetStale model can throw std::out_of_range or reuse an obsolete timestamp, causing a false fuzz failure.
Location: src/test/fuzz/private_broadcast.cpp:160 (head).
Details and suggested fix
The successful eviction branch inserts the replacement into transactions and planned_sends but does not set time_added[tx]. For example, with cap=1 and max_send_attempts=4, add A, pick its three initial sends, resolve it, and disconnect all three recipients. Adding a fresh B evicts A. A subsequent GetStale action reaches time_added.at(B) because B is unresolved, unconfirmed, and below the attempt limit, so the model throws without any clock advance. If B's bytes were tracked previously, the timestamp left behind by removal or eviction can instead cause a spurious stale-set mismatch. Set time_added[tx] = NodeClock::now() in this branch, preferably by sharing fresh-insertion bookkeeping with the non-full path.
[minor] · Resolved transactions overstate remaining send attempts
With -privatebroadcast enabled, an early echo can make getprivatebroadcastinfo report 999 remaining attempts even though only two already-planned sends remain.
Location: src/private_broadcast.cpp:193 (head).
Details and suggested fix
If a transaction is echoed after its first private send but before the other private connections finish their handshakes, IsPending() remains true and this branch reports the maximum budget minus one. However, TryGrantRetry() rejects resolved entries, so only the two unpicked initial sends remain possible. After those picks, the reported count drops directly to zero. Base hid resolved entries, so this PR newly exposes the mismatch with the RPC's documented number of additional attempts allowed. For resolved entries, report std::min(state.planned_sends, m_max_send_attempts) - state.send_statuses.size() and retain the current formula for unresolved entries. Check the intermediate count in complete_all_initial_sends and update the fuzz oracle, which currently repeats the incorrect formula.
Optional improvements
[suggestion] · Eviction tests do not check oldest-first ordering
The current unit and fuzz assertions do not distinguish oldest-first eviction from choosing an arbitrary finished entry.
Location: src/test/fuzz/private_broadcast.cpp:141 (head).
Details and suggested fix
The production min_element implements oldest-first eviction, but the fuzz target discovers the victim from production output and checks only that it was finished before removing it from the model. rejection_at_cap never picks or resolves its entries, so it covers rejection rather than victim ordering. Add a small-capacity unit test with FakeNodeClock, two finished entries added at distinct times, and an older unfinished entry. After adding a replacement, assert that only the older finished entry disappeared. Once the fuzz timestamp bookkeeping is corrected, the oracle can also compare the victim's timestamp with every other finished entry, allowing ties. Related metadata coverage is also missing: the functional test checks only received_by_us key presence, while the unit tests and private_broadcast fuzz target omit receive addresses. Add checks for first-echo address/time retention and clearing on reset.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Remove the unused structured-binding element
- [minor]: Explicit re-add can succeed without restarting an exhausted broadcast
- [minor]:
received_by_us.timerecords processing time, not receipt time - [suggestion]: Test the values and first-echo behavior of
received_by_us - [suggestion]: Update comments that say exhausted transactions stay tracked (earlier report)