Skip to content

Fix p2p_segwit.py test #797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2019
Merged

Fix p2p_segwit.py test #797

merged 2 commits into from
Mar 18, 2019

Conversation

Gnappuraz
Copy link
Member

@Gnappuraz Gnappuraz commented Mar 18, 2019

Since there is tail update in additional_bytes, if additional_bytes % 55 = 0, it will not add the +1 byte needed to pass assert_equal(vsize, MAX_BLOCK_BASE_SIZE + 1).
The algorithm needs to do one last pass, that will happen if additional_bytes % 55 = 0, where it will add min(0+1, 55) extra_bytes. If additional_bytes % 55 > 0, after the update additional_bytes will be < 0 and skip the last pass.
This has been discovered because the coinbase scriptSig changed from 71 to 72 bytes (due to changed coinbase reward in #794), causing the total block size to be % 55 with no remainder.

@Gnappuraz Gnappuraz added the backport Feature should be contributed to bitcoin label Mar 18, 2019
@Gnappuraz Gnappuraz self-assigned this Mar 18, 2019
scravy
scravy previously approved these changes Mar 18, 2019
Copy link

@castarco castarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 7133b3a

Copy link
Member

@Ruteri Ruteri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 7133b3a

@scravy scravy dismissed their stale review March 18, 2019 14:05

looked at it in more detail

Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
@scravy
Copy link
Member

scravy commented Mar 18, 2019

utACK 1ac84d0

@Gnappuraz Gnappuraz added the tests Automated tests label Mar 18, 2019
@Gnappuraz Gnappuraz merged commit b8f6747 into dtr-org:master Mar 18, 2019
@Gnappuraz Gnappuraz deleted the fix-p2p-segwit-test branch April 2, 2019 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Feature should be contributed to bitcoin tests Automated tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants