HomePhabricator

Merge #14700: qa: Avoid race in p2p_invalid_block by waiting for the block…

Description

Merge #14700: qa: Avoid race in p2p_invalid_block by waiting for the block request

Summary:
fa21568208 qa: Avoid race in p2p_invalid_block by waiting for the block request (MarcoFalke)
6c787d340c tests: Make feature_block pass on centos (MarcoFalke)

Pull request description:

This hopefully fixes #14661, which I believe is caused by a race in `send_blocks_and_test`. By setting `request_block=False` we only effectively check `node.getbestblockhash() != blocks[-1].hash` before returning and checking the debug.log. By setting `request_block=True` (the default) we make sure that we send the block, then sync with a ping before asserting on the debug.log.

Even if this patch doesn't fix the issue, it is good cleanup: There is no reason to not wait for the blocks to be requested, since in all these cases the header gives no indication that the block is consensus invalid. So this patch makes the test also a bit stricter and more useful.

Unrelated to this, I also include a fix that makes the tests pass on latest CentOS.

Tree-SHA512: c7abee3b7dc790a8af6c289159a7751bd962f6fa16c1537e7e21a0a0ef05b9596d1f4eb75319614603c05cb803e021314fa3596508ba443edd03046b25527e0f

Backport of Core PR14700

Test Plan:

./test_runner.py feature_block p2p_invalid_block

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, majcosta

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D6525

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Nov 13 2018, 15:24
nakihitoCommitted on Jun 13 2020, 00:26
nakihitoPushed on Jun 13 2020, 00:26
Reviewer
Restricted Owners Package
Differential Revision
D6525: Merge #14700: qa: Avoid race in p2p_invalid_block by waiting for the block request
Parents
rABCf14a55dc9e1b: [backport#16026] Ensure that uncompressed public keys in a multisig always…
Branches
Unknown
Tags
Unknown