diff --git a/blockchain/init-genesis.sh b/blockchain/init-genesis.sh index 46ecc7a..e542be0 100644 --- a/blockchain/init-genesis.sh +++ b/blockchain/init-genesis.sh @@ -111,6 +111,14 @@ sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/' "$CONFIG_TOML" # 实际出块时间可降到 500ms-800ms sed -i 's/skip_timeout_commit = false/skip_timeout_commit = true/' "$CONFIG_TOML" +# ============================================================ +# 空块控制 — 防止磁盘快速耗尽 +# ============================================================ +# create_empty_blocks = false: 没有待处理交易时不出空块 +# 有交易提交时立即触发出块,延迟不受影响 +# 避免 ~23块/秒 的空块堆积 (按44ms/块计算 ≈ 2-3 GB/天) +sed -i 's/create_empty_blocks = true/create_empty_blocks = false/' "$CONFIG_TOML" + # ============================================================ # Mempool 优化 — 提升交易吞吐 # ============================================================ @@ -136,4 +144,5 @@ echo " - Consensus timeouts: prevote/precommit 500ms (reduced from 1s)" echo " - IAVL cache: 2,000,000 nodes (up from 781,250)" echo " - Mempool size: 10,000 txs (up from 5,000)" echo " - Mempool cache: 20,000 (up from 10,000)" +echo " - Empty blocks: DISABLED (only produce blocks when txs pending)" echo "============================================================"