[Bitcoin-segwit2x] MAX_BLOCK_WEIGHT increase?

Oliver Petruzel opetruzel at gmail.com
Thu Jun 15 21:26:17 UTC 2017


Ok, on a related note, I had a chance to dig into the latest *consensus.h*
and *validation.cpp *some more.

If the *MAX_BLOCK_WEIGHT* is not increased in the hardfork, will we
encounter any issues with the test at line 3096 in *validation.cpp*?

Where exactly is the code that hard limits all blocks to less than 4M
bytes? (the static value of MAX_BLOCK_WEIGHT both before and after the
hardfork).

Greg Maxwell had this to say about it:

*"A block with 2,000,000 bytes of legacy transactions would have a weight
of 8,000,000 (weight = 3x witness-stripped-size + size). So it would have
too much weight and will fail the weight test, regardless of what other
tests have been added"*

Is he correct? Or, is there a hard limit enforcement somewhere in the new
code that I missed?

*Relevant code from validation.cpp, beginning at line 3096*:

*if (GetBlockWeight(block) > MAX_BLOCK_WEIGHT) {*
*        return state.DoS(100, false, REJECT_INVALID, "bad-blk-weight",
false, strprintf("%s : weight limit failed", __func__));*
*    }*
*return true;*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-segwit2x/attachments/20170615/aaae946d/attachment.html>


More information about the Bitcoin-segwit2x mailing list