2.1 KiB
- Node and Mining
-
PR #31384 fixed an issue where block reserved weight for fixed-size block header, transactions count, and coinbase transaction was done in two separate places. Before this pull request, the policy default for the maximum block weight was
3,996,000WU, calculated by subtracting4,000 WUfrom the4,000,000 WUconsensus limit to account for the fixed-size block header, transactions count, and coinbase transaction. During block assembly, Bitcoin Core clamped custom-blockmaxweightvalue to not be more than the policy default.Additionally, the mining code added another
4,000 WUto the initial reservation, reducing the effective block template size to3,992,000 WU.Due to this issue, the total reserved weight was always
8,000 WU, meaning that even when specifying a-blockmaxweighthigher than the policy default, the actual block size never exceeded3,992,000 WU.The fix consolidates the reservation into a single place and introduces a new startup option,
-blockreservedweight(default:8,000 WU). This startup option specifies the reserved weight for the fixed-size block header, transactions count, and coinbase transaction. The default value of-blockreservedweightwas chosen to preserve the previous behavior.Upgrade Note: The default
-blockreservedweightensures backward compatibility for users who relied on the previous behavior.Users who manually set
-blockmaxweightto its maximum value of4,000,000 WUshould be aware that this value previously had no effect since it was clamped to3,996,000 WU.Users lowering
-blockreservedweightshould ensure that the total weight (for the block header, transaction count, and coinbase transaction) does not exceed the reduced value.As a safety check, Bitcoin core will fail to start when
-blockreservedweightinit parameter value is lower than2000weight units.Bitcoin Core will also fail to start if the
-blockmaxweightor-blockreservedweightinit parameter exceeds consensus limit of4,000,000weight units.