Repository navigation
Open
Description
Follow-ups from the review of #386 (head 362286cc88). None of them argues against merging it: it bounds a cost that is unbounded today, and it never disconnects a peer.
- Peers on older versions are charged for transactions that only the new policy rejects.
TX_NOT_STANDARDis charged (IsTxValidationTimeCharged). A v1.0.0 node accepts and relays a spend that v1.0.1 rejects under the policy: bound P2MR runtime stack bytes #263 stack-byte rule; the v1.0.1 node charges the first peer that delivers it (about 0.5 ms each in a regtest run with a v1.0.0 node as the relaying peer). At the default budget it takes many such transactions to throttle an established peer, and the peer stays connected, but while it is throttled its announcements are not requested from it. The PR body says such a peer is "at worst throttled". Options: do not charge failures of policy-only script flags that are new in the same release; or keep a throttled peer's announcements as low-priority candidates instead of dropping them. Either way the notes should say it in one sentence. - A new connection depends on the shared pool for its first 200 seconds. A peer can use its own credit only once it has reached the 100 ms cap (
CanUseOwnCredit,RefillAccount), which takes 200 s at the default rate. Until thenMayValidateis true only while the node-wide pool is above zero. While the pool is empty, the transactions of every such peer are dropped and its announcements ignored, even if it never sent a rejected transaction; after a restart that is every peer. Options: give a new connection a small initial credit; or let a peer with no charged time validate while the pool is empty. - Throttling is under-reported. While a peer is throttled the node mostly stops requesting from it, so
tx_dropped_while_throttledstays at or near zero while announcements are being ignored and due requests released (theLogDebugat the release is the only trace). The field's help text is accurate, but it is the only visible measure. Option: count ignored announcements and released requests, or say in the notes that throttling mainly works by not requesting. - No functional run under
DEBUG_LOCKORDERyet. In net: budget per-peer time spent validating rejected transactions #386's Full Validation the onlyDEBUG_LOCKORDERjob (no IPC, i686, DEBUG; job 130047108088) failed intest_qbit-qtbefore it reached the functional suite, on a Qt test timing bound that net: budget per-peer time spent validating rejected transactions #386 does not touch. The unit tests passed in that job (peerman_tests,tx_validation_budget_tests), butp2p_tx_validation_budget.pyhas not run there. Re-run that job before merging.
Found in the 2026-11-10 review of the v1.0.1 change set. Code references are to 1.x.x at 9fc25e0268 unless stated.
Metadata
Metadata
Assignees
Labels
No labels
Activity