3 suggestions
Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.
Optional improvements
[suggestion] · Tx-inventory helper comments omit the required trickle-timer gate
The helpers rely on callers to enforce trickle timing and no-relay clearing; the sole current caller does so, but the docstrings do not state this requirement.
Location: src/net_processing.cpp:853 (head).
Details and suggested fix
In the base code, the BIP35 response and regular transaction-inventory selection ran only inside if (fSendTrickle). The extracted MaybeSendMempoolResponse() and MaybeSendTxInventory() do not check timing themselves. Their sole current caller invokes them only after ScheduleTxRelayTrickle() returns true, which also clears pending inventory when the peer has m_relay_txs == false. A caller that skips this gate could announce transactions outside the exponentially timed batch or to a peer that asked not to receive transaction relay. The timer helps prevent peers from inferring a transaction's origin. State in both docstrings that the helpers may be called only after ScheduleTxRelayTrickle() returns true, within the same m_tx_inventory_mutex scope.
[suggestion] · Early-return helpers can have their results ignored without a warning
The extracted timeout and sync helpers return plain bool values that callers must check; current callers check them, but a future omission would compile without warning.
Location: src/net_processing.cpp:882 (head).
Details and suggested fix
In the base code, the stall, block-download, ping, and headers-sync timeout checks returned early from SendMessages() directly. Now CheckBlockSyncTimeouts(), CheckBlockDownloadStall(), CheckBlockFlightTimeout(), and CheckHeadersSyncTimeout() return bool values that callers must test. If a caller stopped checking a result, SendMessages() could continue to ConsiderEviction() and MaybeSendGetData() for a peer already marked fDisconnect. Mark these helpers [[nodiscard]], as ScheduleTxRelayTrickle() is, so the compiler can flag ignored results. Apply the same annotation to ComputeSyncBlocksAndHeaders() if its result should also be checked. Update the CheckBlockSyncTimeouts() docstring to mention the ping-timeout check as well as stall and download timeouts.
[suggestion] · BIP35 helper comment overstates which transactions it queues
The helper filters transactions using the peer's fee and bloom filters, so the new comment incorrectly says it queues all mempool transactions.
Location: src/net_processing.cpp:849 (head).
Details and suggested fix
MaybeSendMempoolResponse() skips transactions below the peer's feefilter rate and, when a BIP37 filter is loaded, skips transactions rejected by IsRelevantAndUpdate(). The declaration comment says it queues “all mempool transactions,” which omits these filters. Describe it as queuing the mempool transactions that pass the peer's fee and bloom filters.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Declare the block-inventory lock exclusion
- [suggestion]: Describe the fallback as announcing a queued block