CHIP-2023-04 Adaptive Blocksize Limit Algorithm for Bitcoin Cash 比特现金的自适应区块大小限制算法 (I...
Still, the network participants have limited resources to devote to coming to agreement, let alone defending against social attacks. An algorithmic blocksize limit makes it so that the default response to larger mined blocks is a larger blocksize limit, and puts the burden of "doing something" on whoever wants to deviate from that.然而,网络参与者投入达成一致的资源有限,更不用说防御社交攻击了。算法化的区块大小限制使得对较大挖掘区块的默认响应是增加区块大小限制,并将“采取行动”的负担放在任何想要偏离这一默认响应的人身上。
Benefits好处:The proposed block size adjustment algorithm retains all of the benefits laid out in the "Why a limit at all?提出的区块大小调整算法保留了上述“为什么需要限制?
section above, and removes the need for coordinated changes to the blocksize in the future, reducing meta costs for the network significantly.一节中阐述的所有好处,并且消除了未来对区块大小进行协调更改的需求,显著减少了网络的元成本。
By implementing the current 32 MB limit as a floor value for the algorithm, we will still maintain a level of "stand-by" capacity even when the network is underused. This prevents the algorithm from introducing any changes to the incentive system. The exponential nature of the algorithm makes it mathematically elegant, and it exhibits no bad behavior at edge cases. By implementing asymmetry in the per-block response, we ensure stability even under extreme conditions. The change in the blocksize limit will always be predictable and smooth, across the full range of possible scenarios. By implementing an elastic buffer in the algorithm, we ensure that bursts of demand can be accommodated by responsive increases in the blocksize limit. Finally, implementing an algorithmic limit will signal Bitcoin Cash’s commitment to scaling the network to meet demand.通过将当前的32 MB限制作为算法的底线值,即使网络使用不足,我们仍将保持一定水平的“待命”容量。这避免了算法对激励体系引入任何变化。算法的指数特性使其在数学上优雅,并且在边缘情况下不表现出任何不良行为。通过在每个区块响应中实施不对称性,我们确保即使在极端条件下也能保持稳定。区块大小限制的变化将始终是可预测且平滑的,覆盖所有可能的场景。通过在算法中实施弹性缓冲区,我们确保需求的突增可以通过响应性增加的区块大小限制来容纳。最后,实施算法化的限制将表明比特币现金对于扩展网络以满足需求的承诺。
Technical技术描述
DescriptionThe main function driving the proposed algorithm belongs to the exponentially weighted moving average (EWMA) family. We will refer to this main function as the "control function". The output of the control function, referred to as "control block size", is incremented by an "elastic buffer size" value to obtain the block size limit. The input to the control function is scaled by a constant "asymmetry factor", and by a variable scaling factor determined by the elastic buffer size -- in case of positive adjustment response. The elastic buffer size is determined by the secondary "elastic buffer function", which is driven by rate of change of the control function. If the rate of change of control function is positive and big enough, then the elastic buffer size will grow to provide more headroom than the control function alone would. Unlike the control function, the buffer won't be reduced in response to smaller block sizes but it will decay with time -- for a while preserving "memory" of a past increase. If positive rate of change of control function is below a threshold value, then exponential decay will take over and work to reduce the buffer size. The buffer size to control block size ratio has an upper bound in case it grows enough so that exponential decay arrives at equilibrium with the maximum rate of increase. The full algorithm is defined as follows:驱动所提算法的主要功能属于指数加权移动平均(EWMA)系列。 我们将此主要功能称为“控制函数”。 控制函数的输出,称为“控制块大小”,通过增加“弹性缓冲区大小”值来获得块大小限制。 控制函数的输入由一个常量“不对称因子”和一个由弹性缓冲区大小决定的可变缩放因子(在正调整响应的情况下)缩放。 弹性缓冲区大小由次级“弹性缓冲函数”决定,该函数由控制函数的变化率驱动。 如果控制函数的变化率是正的且足够大,那么弹性缓冲区大小将增长,以提供比单独的控制函数更多的头寸。 与控制函数不同,缓冲区不会因较小的块大小而减少,但它会随时间衰减——一段时间内保留过去增加的“记忆”。 如果控制函数的正变化率低于阈值,则指数衰减将接管并起作用以减小缓冲区大小。 缓冲区大小与控制块大小的比率有一个上限,以防它增长足够多,使得指数衰减与增加的最大速率达到平衡。 完整的算法定义如下: