diff options
author | glozow <gloriajzhao@gmail.com> | 2024-02-06 10:48:36 +0000 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2024-02-06 10:52:35 +0000 |
commit | 4572f48fd5a864311a4f3f09043506d59ad9bda0 (patch) | |
tree | 7e758f404aedbed81c3b180476a7532401bc90fe /src/qt | |
parent | 9eeee7caa3f95ee17a645e12d330261f8e3c2dbf (diff) | |
parent | c340503b67585b631909584f1acaa327f5af25d3 (diff) |
Merge bitcoin/bitcoin#29353: test: p2p: adhere to typical VERSION message protocol flow
c340503b67585b631909584f1acaa327f5af25d3 test: p2p: adhere to typical VERSION message protocol flow (Sebastian Falbesoner)
7ddfc28309e6b70c273112a93f01e518409ceaa0 test: p2p: process post-v2-handshake data immediately (Sebastian Falbesoner)
b198b9c2ce28463f7c6a2b4cf08d64138c8509ee test: p2p: introduce helper for sending prepared VERSION message (Sebastian Falbesoner)
Pull request description:
This PR addresses a quirk in the test framework's p2p implementation regarding the version handshake protocol:
Currently, the VERSION message is sent immediately after an inbound connection (i.e. TestNode outbound connection) is made. This doesn't follow the usual protocol flow where the initiator sends a version first, the responder processes that and only then responds with its own version message. Change that accordingly by only sending immediate VERSION message for outbound connections (or after v2 handshake for v2 connections, respectively), and sending out VERSION message as response for incoming VERSION messages (i.e. in the function `on_version`) for inbound connections.
I first stumbled upon this issue through reading comment https://mirror.b10c.me/bitcoin-bitcoin/24748/#discussion_r1465420112 (see last paragraph) and recently again in the course of working on a v2-followup for #29279, where this causes issues for TestNode outbound connections that disconnect *before* sending out their own version message.
Note that these changes lead to slightly more code in some functional tests that override the `on_version` method, as the version reply has to be sent explicitly now, but I think is less confusing and reflects better what is actually happening.
ACKs for top commit:
epiccurious:
utACK c340503b67585b631909584f1acaa327f5af25d3
stratospher:
tested ACK c340503b67585b631909584f1acaa327f5af25d3. very useful to have since we'd want real node behaviour!
mzumsande:
ACK c340503b67585b631909584f1acaa327f5af25d3
sr-gi:
tACK https://github.com/bitcoin/bitcoin/commit/c340503b67585b631909584f1acaa327f5af25d3
Tree-SHA512: 63eac287d3e1c87a01852bfd9f0530363354bbb642280298673b9c8817056356373adf348955c4e92af95c7c6efa8cc515cee2892e9f077bfbe1bce8e97ad082
Diffstat (limited to 'src/qt')
0 files changed, 0 insertions, 0 deletions