Skip to content

Commit 1bc3be1

Browse files
ajtownsfanquake
authored andcommitted
p2p: Increase tx relay rate
In the presence of smaller transactions on the network, blocks can sustain a higher relay rate than 7tx/second. In this event, the per-peer inventory queues can grow too large. This commit bumps the rate up to 14 tx/s (for inbound peers), increasing the safety margin by a factor of 2. Outbound peers continue to receive relayed transactions at 2.5x the rate of inbound peers, for a rate of 35tx/second. Co-Authored-By: Suhas Daftuar <[email protected]> Github-Pull: #28592 Rebased-From: b81f370
1 parent 4b02bc1 commit 1bc3be1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static constexpr auto INBOUND_INVENTORY_BROADCAST_INTERVAL{5s};
167167
static constexpr auto OUTBOUND_INVENTORY_BROADCAST_INTERVAL{2s};
168168
/** Maximum rate of inventory items to send per second.
169169
* Limits the impact of low-fee transaction floods. */
170-
static constexpr unsigned int INVENTORY_BROADCAST_PER_SECOND = 7;
170+
static constexpr unsigned int INVENTORY_BROADCAST_PER_SECOND{14};
171171
/** Target number of tx inventory items to send per transmission. */
172172
static constexpr unsigned int INVENTORY_BROADCAST_TARGET = INVENTORY_BROADCAST_PER_SECOND * count_seconds(INBOUND_INVENTORY_BROADCAST_INTERVAL);
173173
/** Maximum number of inventory items to send per transmission. */

0 commit comments

Comments
 (0)