Skip to content

Commit c97bd2f

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 c97bd2f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

eth/protocols/eth/broadcast.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,20 @@ 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+
// Bor-specific: increased from the go-ethereum default of 100 KB to 1 MB.
31+
// Polygon mainnet runs at 120M gas/block with 2s block times. At high
32+
// utilization (90–100% gas), blocks carry 430–520 KB of transaction data.
33+
// At 100 KB, a full block requires 5+ sequential messages per peer. 512 KB
34+
// is insufficient: full blocks (100% utilization) already reach ~520 KB.
35+
// 1 MB ensures any block at current gas limits fits in a single message and
36+
// provides ~2x headroom for a gas limit increase to ~200M gas without
37+
// requiring another bump. This value is 6.3% of the 16 MB p2p message size
38+
// limit and well below the ~15 MB witness messages already exchanged on
39+
// this network.
40+
maxTxPacketSize = 1024 * 1024
3041
)
3142

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

0 commit comments

Comments
 (0)