Skip to content

Commit b68b8a9

Browse files
committed
eth/protocols/eth: increase maxTxPacketSize from 100 KB to 1 MB for Polygon throughput
Polygon mainnet processes 120M gas/block at 2s block times. At high utilization (90-100% gas), blocks carry 430-520 KB of transaction data, with full blocks reaching ~520 KB. The previous 100 KB limit required 5+ sequential p2p messages per peer per full block. This affected both paths: - Direct broadcast (full txs to sqrt(peers)): many sequential messages - GetPooledTransactions responses: peers fetching txs after announcement could not receive a full block's worth in one response, increasing round trips for mempool convergence across the wider peer set 1 MB is chosen to: - Fit any block at current gas limits in a single message - Provide ~2x headroom over the current full-block maximum (~520 KB), absorbing a gas limit increase to ~200M without another bump - Stay at 6.3% of the 16 MB p2p message size limit - Remain well below the ~15 MB witness messages already exchanged on this network, keeping head-of-line blocking risk negligible Note: 512 KB was considered but rejected — full blocks already reach 520 KB, leaving essentially no margin.
1 parent 0d6ee4b commit b68b8a9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

eth/protocols/eth/broadcast.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ import (
2424
)
2525

2626
const (
27-
// This is the target size for the packs of transactions or announcements. A
28-
// pack can get larger than this if a single transactions exceeds this size.
29-
maxTxPacketSize = 100 * 1024
27+
// maxTxPacketSize is the target size for packs of transactions or announcements.
28+
// A pack can get larger than this if a single transaction exceeds this size.
29+
//
30+
// Increased from the go-ethereum default of 100 KB to 1 MB: at Polygon's
31+
// 120M gas/block, a single full block carries ~520 KB of transaction data,
32+
// so the default would require 5+ sequential packets per block per peer.
33+
maxTxPacketSize = 1024 * 1024
3034
)
3135

3236
// blockPropagation is a block propagation event, waiting for its turn in the

0 commit comments

Comments
 (0)