- This PR attempts to fix the duplicate coinbase weight reservation issue we currently have.
- Fixes #21950
We reserve 4000 weight units for coinbase transaction in DEFAULT_BLOCK_MAX_WEIGHT
And also reserve additional 4000
weight units in the default BlockCreationOptions
struct.
Motivation
- This issue was first noticed during a review here #11100 (review))
- It was later reported in issue #21950.
- I also came across the bug while writing a test for building the block template. I could not create a block template above
3,992,000
in the block assembler, and this was not documented anywhere. It took me a while to realize that we were reserving space for the coinbase transaction weight twice.
At a minimum, if we donβt want to update this, we should reserve 8,000
weight units in src/policy/policy.h
so it will be clear that it is Bitcoin Core policy to reserve 8,000
weight units for the coinbase transaction.