Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog.d/parent-same-peer-wtxid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixed

- **A txid parent is requested after the same peer's wtxid window ends.**
Expiry matched the first announcement for that peer. When that row was
the waiting txid parent, the in-flight wtxid window stayed indexed and
no getdata followed.
19 changes: 19 additions & 0 deletions changelog.d/peer-resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Security

- Cap the parent-request tracker per peer and process-wide. A full
process-wide table skips the new announcement and does not disconnect
the peer. Only a peer at its own cap is disconnected. A wtxid
announcement is re-requested as a wtxid and does not change another
peer's txid parent. While that request is in flight, the same hash is
not asked again as a txid.
- Charge outbound getdata and tx announcements against the per-peer send
budget, and stop serving blocks once that budget is already over.
- The per-peer rate window keeps the previous second so a boundary does
not grant a second full budget.
- Count v2 decoy packets and unknown message types in the per-peer rate
window on tip-follow and IBD. One decoy that does not fit adds the
rate-limit score. The peer is disconnected at the same threshold as
other frames.
- Batch mempool transaction announcements into one inv per thousand,
still charged against the per-peer send budget.
- Findings write-ups: 053, 054, 055, 056, 057, 058, 059.
4 changes: 4 additions & 0 deletions crates/rbitcoin-net/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ pub const MAX_PROTOCOL_MESSAGE_LENGTH: usize = 4_000_000;
/// Bitcoin Core `MAX_INV_SZ` — max inventory items in inv/getdata/notfound.
pub const MAX_INV_SIZE: usize = 50_000;

/// Tx announcements per `inv`. Separate from [`MAX_INV_SIZE`]: one message
/// stays at a thousand even though the wire cap is fifty thousand.
pub const TX_INV_BATCH: usize = 1_000;

/// Bitcoin Core `MAX_HEADERS_RESULTS` — max headers in a `headers` message.
pub const MAX_HEADERS_RESULTS: usize = 2_000;

Expand Down
Loading
Loading