Skip to content

test: Check object hashes in wait_for_getdata - #18690

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
robot-visions:wait-for-getdata
Apr 23, 2020
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
robot-visions:wait-for-getdata

Conversation

@robot-visions

@robot-visions robot-visions commented Apr 17, 2020 •

Copy link
Copy Markdown
Contributor

Previously, wait_for_getdata only looked for the presence of a recent "getdata" message. Additionally checking the object hashes inside the message should make tests involving wait_for_getdata more robust.

p2p_sendheaders.py already overrides wait_for_getdata do this check; we can use the same approach consistently across all tests that call wait_for_getdata.

This PR is progress towards #18614 , but closing that issue would also involve some additional changes to wait_for_getheaders.

@DrahtBot DrahtBot added the Tests label Apr 17, 2020

@theStack theStack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Concept ACK
I think the two commits could be squashed into one

@robot-visions

Copy link
Copy Markdown
Contributor Author

Updated, thanks for the review!

@theStack

Copy link
Copy Markdown
Contributor

Could you rebase on master?
If was short before ACKing this but then I saw that for the PR branch itself the functional tests fail due to #18711

@robot-visions

Copy link
Copy Markdown
Contributor Author

@theStack Rebased!

@theStack theStack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK 9f5608c 🍻

@maflcko
maflcko merged commit 6413980 into bitcoin:master Apr 23, 2020
@robot-visions

Copy link
Copy Markdown
Contributor Author

Huge thanks @theStack @MarcoFalke for helping me to get my first PR merged :)

@robot-visions
robot-visions deleted the wait-for-getdata branch April 23, 2020 16:02
@theStack

Copy link
Copy Markdown
Contributor

@robot-visions: Congratulations! 🎉 Have fun going down further the rabbit hole, may many more PRs follow (WARNING: working on Bitcoin Core can be addictive ;-))

maflcko pushed a commit that referenced this pull request Apr 24, 2020
…ocks.py

c4027e7 refactor: test: use wait_for_getdata() in p2p_compactblocks.py (Sebastian Falbesoner)

Pull request description:

  The method `wait_for_getdata()` was recently changed to be more precise by waiting for a specified list of hashes, instead of only matching _any_ `getdata` message (see Issue #18614 and PR  #18690). This PR replaces the remaining occurences of manual inspection of `last_messages` with this call.

ACKs for top commit:
  robot-visions:
    ACK c4027e7

Tree-SHA512: e10b346742f235b6ee2ef1f32f7fd74406c1a277389f020fb9913a93e94cc9530e1e9414872b83c9d2ae652ebce2b09b2c8c8372260c1afb4e0e54fbf7a935b0
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 20, 2021
Summary:
> Previously, wait_for_getdata only looked for the presence of a recent "getdata" message. Additionally checking the object hashes inside the message should make tests involving wait_for_getdata more robust.
>
> p2p_sendheaders.py already overrides wait_for_getdata do this check; we can use the same approach consistently across all tests that call wait_for_getdata.

This is a backport of Core [[bitcoin/bitcoin#18690 | PR18690]]

Test Plan: `ninja check-functional`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8961
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 20, 2021
Summary:
> The method `wait_for_getdata()` was recently changed to be more precise by waiting for a specified list of hashes, instead of only matching any getdata message (see [[bitcoin/bitcoin#18690 | PR18690]]). This PR replaces the remaining occurences of manual inspection of last_messages with this call.

This is a backport of Core [[bitcoin/bitcoin#18756 | PR18756]]

Test Plan: test/functional/test_runner.py p2p_compactblocks

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8974
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants