[Bitcoin-segwit2x] MAX_BLOCK_WEIGHT increase?

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


Thinking about it some more, I don't think Greg was correct about legacy
transactions, because the witnesses aren't actually stripped from legacy
tx, are they?

2M bytes of legacy tx would simply result in a full block that is 2MB in
size, correct?

However, could his statement become true with 2,000,000 bytes of
non-witness data for a block with all SegWit transactions? Would the total
weight then be 8M and subsequently fail the weight limit test?

I know I've been talking to myself here, but I'm really trying to game
this. Any help would be much appreciated!

Oliver

On Jun 15, 2017 5:26 PM, "Oliver Petruzel" <opetruzel at gmail.com> wrote:

> 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/6f7ad305/attachment.html>


More information about the Bitcoin-segwit2x mailing list