Repository navigation
Fail association of a block with sizes that are not storable. - #1110
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Block sizes are stored in 23 bits (schema::size less the flag), and are truncated when written. A compact block is associated by tx links before its block checks, so a block of 2^23 bytes or more is stored with its size modulo 2^23, and the deferred size and weight checks in
check_pooled_blockandaccept_pooled_blockread the truncated value. If any tx is not sufficiently pooled,get_wire_blockcannot write the block to that size and validation faults (validate2).The
mergeassertion tests only the flag bit, so it does not catch a size that leaves that bit clear.This adds
txs::is_storable(asheader::is_storable), asserts it inmerge, and returnstxs_sizefromset_txs, which all three writers use. Full blocks cannot reach it within the default request limit.Land with libbitcoin/libbitcoin-node#1293, as node otherwise faults on
txs_size.