gasLimit 随着时间的推移减少

gasLimit decrease over time

我正在 Ubuntu 服务器上部署以太坊。我使用自定义 genesis.json 参数启动区块链,包括 gasLimit 和难度级别。

随着时间的推移,我注意到难度不断通过在每个生成的块上增加和减少来自我调整。至于 gasLimit,它从我设置的值开始,并在每个块上不断减少,直到达到默认值 4,712,388,这低于我的交易成本并导致我出现问题。

创世块中的gasLimit仅用作起点。随着区块被添加到链中,区块 gas 限制将根据矿工处理网络上的交易而随时间变化。为了保持更高的区块 gas 限制,您需要覆盖节点客户端中的默认配置。

对于Parity

--gas-floor-target=[GAS]
    Amount of gas per block to target when sealing a new block.
    (default: 4700000)

--gas-cap=[GAS]
    A cap on how large we will raise the gas limit per block
    due to transaction volume. (default: 6283184)

对于Geth

--targetgaslimit value    
    Target gas limit sets the artificial target gas floor for the blocks to mine (default: 4712388)