test: Remove redundant verack check #30252

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2406-test-connect-sync changing 1 files +7 −11
  1. maflcko commented at 11:02 am on June 9, 2024: member

    Currently the sync in connect_nodes mentions the version and verack message types, but only checks the verack. Neither check is required, as the pong check implies both. In case of failure, the debug log will have to be consulted anyway, so the redundant check doesn’t add value.

    Also clarify in the comments that the goal is to check the flag fSuccessfullyConnected indirectly.

  2. DrahtBot commented at 11:02 am on June 9, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK furszy, brunoerg, tdb3

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Tests on Jun 9, 2024
  4. in test/functional/test_framework/test_framework.py:648 in fa4f453281 outdated
    653-
    654-        # The message bytes are counted before processing the message, so make
    655-        # sure it was fully processed by waiting for a ping.
    656+        # Poll until version handshake (fSuccessfullyConnected) is complete to
    657+        # avoid race conditions. As the flag fSuccessfullyConnected is not
    658+        # exposed, check it by waiting for a ping, which can only happen after
    


    tdb3 commented at 2:29 pm on June 9, 2024:
    nit:
    check it by waiting for a ping The code waits for successful pongs rather than pings.

    maflcko commented at 3:17 pm on June 9, 2024:
    Thanks, fixed.
  5. tdb3 approved
  6. tdb3 commented at 2:33 pm on June 9, 2024: contributor

    ACK fa4f453281e1b38ec4bc87eadbfcfee11d6ea530 Makes sense. Version handshake occurs before ping/pong.

    As a sanity check, ran functional tests to see the tests continue to function properly (all passed). Also viewed node traffic between two regtest nodes, and saw ping/pong occur after version/verack exchange.

  7. maflcko force-pushed on Jun 9, 2024
  8. tdb3 approved
  9. tdb3 commented at 3:22 pm on June 9, 2024: contributor
    ACK fa6627706580ea213fc5df23fe990f1feedec11d
  10. in test/functional/test_framework/test_framework.py:647 in fa66277065 outdated
    652-        self.wait_until(lambda: check_bytesrecv(find_conn(to_connection, from_connection_subver, inbound=True), 'verack', 21))
    653-
    654-        # The message bytes are counted before processing the message, so make
    655-        # sure it was fully processed by waiting for a ping.
    656+        # Poll until version handshake (fSuccessfullyConnected) is complete to
    657+        # avoid race conditions. As the flag fSuccessfullyConnected is not
    


    furszy commented at 9:51 pm on June 9, 2024:
    It would be nice to be explicit about the race conditions rather than keeping this vague. Maybe could add something like: “The node will ignore all messages received during the version handshake window”.

    maflcko commented at 5:58 am on June 10, 2024:

    I think the name fSuccessfullyConnected==false implies that the connection may not be successfully used (yet), so I think I’ll leave it as-is for now.

    Also, I think “Will ignore all messges received” isn’t true, because the node will accept some message types.

    What about: “Some message types are blocked from being sent or received before fSuccessfullyConnected.”? (Edit: Pushed this)

  11. furszy commented at 9:54 pm on June 9, 2024: member
    Code ACK fa6627706580ea with a comment.
  12. test: Remove redundant verack check 0000276b31
  13. maflcko force-pushed on Jun 10, 2024
  14. furszy commented at 12:53 pm on June 10, 2024: member
    utACK 0000276b31ce
  15. DrahtBot requested review from tdb3 on Jun 10, 2024
  16. brunoerg approved
  17. brunoerg commented at 2:24 pm on June 10, 2024: contributor
    ACK 0000276b31cea5e443a59d94a98c569293ada951
  18. tdb3 approved
  19. tdb3 commented at 4:04 pm on June 10, 2024: contributor
    ACK 0000276b31cea5e443a59d94a98c569293ada951
  20. fanquake merged this on Jun 11, 2024
  21. fanquake closed this on Jun 11, 2024

  22. maflcko deleted the branch on Jun 12, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me