Provider refusals
write_verifier: Provider declined the request because of a cybersecurity restriction. Experiments remain incomplete; static verification can continue.
2 major findings · 6 suggestions
Findings
[major] · Reconciliation retries can starve anti-eclipse connections
With -txreconciliation and allocated reconciliation slots, promptly refused probes can keep the slot count below target and prevent stale-tip recovery, rotating block-relay peers, feelers, and extra-network connections.
Location: src/net.cpp:2823 (head).
Details and suggested fix
Once the ordinary outbound budgets are full, ThreadOpenConnections prioritizes replenishing reconciliation slots over every maintenance branch. Candidates that do not negotiate reconciliation are disconnected at VERACK. If those probes are reaped quickly enough to keep nOutboundFullRecon below its target, each selection attempts another reconciliation connection instead of the pending maintenance work. Pending and disconnecting probes also count, so overlapping probes can temporarily allow maintenance through; this is not unconditional starvation or a measured probe rate. Move reconciliation replenishment below the maintenance branches, and add a regression case where candidates repeatedly refuse negotiation while stale-tip and periodic connection attempts remain due.
[major] · Peer-chosen sketch capacities impose large synchronous decodes
On an opted-in node with a nonempty local reconciliation set, a selected outbound peer can force large quadratic decodes that delay all peers on the message-handler thread; the latency has not been independently measured.
Location: src/node/txreconciliation_impl.cpp:289 (head).
Details and suggested fix
HandleInitialSketch accepts capacity 8192 regardless of the advertised set size. After a failed initial decode, HandleSketchExtension accepts total capacity 16384 even if the initial sketch was small, rather than requiring exactly twice its capacity. This lets a malicious outbound reconciliation responder supply roughly 64 KiB of sketch data and trigger large construction and decoding work under m_txreconciliation_mutex. Processing other peers waits for that synchronous call. Decode failure merely completes the round with RECONCILDIFF(false), so the peer can repeat this in later populated rounds, nominally scheduled every 30 seconds. The TODOs quote approximately 3 seconds and 12 seconds at these limits, but those are hardware-dependent source estimates, not measurements from this review.
Enforce a benchmarked processing budget on both received capacities and fall back to fanout above it. Also require an extension to double the stored initial capacity, matching the responder's serialization.
Optional improvements
[suggestion] · Idle registered inbound peers can exhaust reconciliation offers
Thirty registered inbound peers can consume every reconciliation offer without initiating rounds, until disconnection or ordinary inbound eviction; whether this materially increases eclipse exposure is unestablished.
Location: src/net_processing.cpp:4058 (head).
Details and suggested fix
The listener reserves an offer at VERSION and releases it on failed negotiation or finalization. Once registration succeeds, the node waits for the inbound peer to initiate, with no reconciliation-specific inactivity handling. Completing the handshake and answering pings therefore suffices to retain an offer without ever sending REQTXRCNCL. Further inbound peers receive no offer even when ordinary inbound capacity remains, and their outbound reconciliation connections are consequently disconnected at VERACK. Add a bounded rotation policy for negotiated peers that never start a round, and document how the fixed cap relates to the connection budget. Counting only completed registrations would not solve this and would require separate admission control for outstanding offers.
[suggestion] · Initiator extension processing has no regression coverage
No existing unit or functional test feeds an extension back to an initiator, leaving sketch reassembly, snapshot decoding, and completion of an extended round without regression coverage.
Location: src/test/txreconciliation_tests.cpp:890 (head).
Details and suggested fix
HandleSketchTest stops after the initial decode requests an extension and another initiation returns WRONG_PHASE. The responder-side tests construct extension bytes but never pass them into HandleSketch in EXT_REQUESTED. A serialization/reassembly mismatch could therefore leave these assertions passing. Add a paired-tracker round trip using the responder's actual extension bytes, covering successful decoding and extended failure with full announcement. Interleave additions and removals, then check announcement filtering and preservation of new transactions for the next round. This coverage is needed only if extensions remain in the implementation.
[suggestion] · Responder sketch construction unnecessarily holds cs_main
Populated responder rounds add avoidable cs_main hold time even though sketch construction uses only tracker-owned state.
Location: src/net_processing.cpp:6754 (head).
Details and suggested fix
ShouldRespondToReconciliationRequest constructs and serializes the base or extended sketch inside the large SendMessages cs_main scope. A round can include 3000 elements at roughly 3001 capacity, doubled for an extension. This is bounded work, not a demonstrated stall, but other threads needing cs_main must wait for it unnecessarily. Move the reconciliation response and initiation blocks after that scope closes, retaining their ordering after trickle announcements so newly queued transactions still enter the round.
[suggestion] · Responder unit tests silently pass zero instead of formatted Q
Tracker unit tests convert Q to zero, so their ordinary responder rounds omit the weighted capacity term despite functional coverage using the correct wire value.
Location: src/test/txreconciliation_tests.cpp:509 (head).
Details and suggested fix
HandleReconciliationRequest takes the formatted uint16_t wire value, not a floating-point coefficient. Passing Q = 0.25 truncates it to zero before the receiver divides by Q_PRECISION. Equal-size rounds consequently exercise smaller capacities than normal traffic; for example, the five-element extension-consistency case never exercises the weighted term. Define a typed test constant using static_cast<uint16_t>(std::ceil(Q * Q_PRECISION)), use it for ordinary rounds, and assert the expected capacity for a representative equal-size case. Keep explicit zero inputs where testing that valid boundary is intentional.
[suggestion] · Wallet guard unnecessarily skips reconciliation functional tests
The wallet guard skips MiniWallet-based reconciliation tests in wallet-disabled builds; the only wallet-RPC helper has no callers, and no wallet-disabled test run was performed.
Location: test/functional/test_framework/p2p_txrecon.py:276 (head).
Details and suggested fix
p2p_txrecon_initiator.py and p2p_txrecon_responder.py inherit skip_if_no_wallet(), but construct transactions locally with MiniWallet, mine through generatetodescriptor, and submit over P2P. Remove the inherited wallet skip so those assertions also run without the wallet module. Delete the unused generate_transaction helper as well: it is the only wallet-RPC path and calls the nonexistent CTransaction.rehash() method.
[suggestion] · REQTXRCNCL documentation doubles the field widths
The wire-format comment describes an eight-byte payload, but the sender and receiver use two uint16_t fields, totaling four bytes.
Location: src/protocol.h:272 (head).
Details and suggested fix
ReconCoefficients and the REQTXRCNCL handler agree on a two-byte set size followed by a two-byte formatted q. The comment instead specifies four bytes for each field, describing a different message encoding. Change it to two two-byte fields; the implemented wire format does not need to change.