Send tx relay flag with version message #2763

pull bitsofproof wants to merge 1 commits into bitcoin:master from bitsofproof:master changing 1 files +1 −1
  1. bitsofproof commented at 9:36 PM on June 11, 2013: none

    bitcoind parses but does not send tx relay flag in the version message, see #2534

    I believe the correct value to send is true, since bitcoind does not expect filter sets and wants to receive inv right after start.

  2. send tx relay flag with version c87f462b74
  3. jgarzik commented at 1:46 PM on June 12, 2013: contributor

    ACK code change. Administrivia:

    1. git commit message should include text such as "fixes #2534" or similar. Your pull request text included information that should be archived permanently inside the commit message. In general, commit messages should be more informative than this.

    2. We are currently deployed with a buggy BIP 37 interpretation. We should consider whether it warrants bumping the protocol version, along with this patch. Otherwise, you have two different behaviors in the field, with the same protocol version.

  4. BitcoinPullTester commented at 11:23 PM on June 12, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/c87f462b74fe94ddf7ac1018c399bb9772776e16 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  5. mikehearn commented at 11:59 AM on June 13, 2013: contributor

    It's not really a protocol change, is it? It's just a change in the reference client implementation.

  6. bitsofproof commented at 12:03 PM on June 13, 2013: none

    It is a bug fix but might answer the question if protocol > reference implementation :)

  7. sipa commented at 12:05 PM on June 13, 2013: member

    All fields in the version message except for the first ones are optional - clients need to be prepared for both missing fields or more fields than they know, as this is exchanged before the protocol version is negotiated. Because of that, it cannot be a protocol change, and it's not a bug fix either.

    I'm in favor of this however, it makes behaviour more consistent across clients.

  8. bitsofproof commented at 12:06 PM on June 13, 2013: none

    I doubt series of fields can be optional since they are not identified by the serialization. How to parse then if we add more?

  9. mikehearn commented at 12:08 PM on June 13, 2013: contributor

    LGTM

    It's in the code - you don't have to add the last field, but if you do, you have to add all the preceding fields too.

    Sipa is right, we should merge this, although it's a fairly minor thing.

  10. sipa commented at 12:10 PM on June 13, 2013: member

    This is how the reference client parses it: https://github.com/bitcoin/bitcoin/blob/v0.8.2/src/main.cpp#L3201

    Essentially by checking whether we're at the end of the message already. And yes it must be optional, as you're parsing/sending this before you know which version the peer supports.

  11. bitsofproof commented at 12:24 PM on June 13, 2013: none

    Since the version number is preceding this in the message, optionality is not mandatory but chosen. I think it would be more future proof and flexible to decide on the structure by version read and not by checking the length. I believe the current way of parsing is ugly, but agree is sustainable.

  12. sipa commented at 12:27 PM on June 13, 2013: member

    The version isn't acked by the peer yet, so you don't know whether they'll support it. But indeed that's just a problem in one direction, not both. And yes, it's ugly. For more complex extensions later a separate message may be more appropriate...

  13. sipa commented at 10:25 AM on June 14, 2013: member

    ACK

  14. mikehearn commented at 8:13 AM on June 17, 2013: contributor

    This has two ACKs so should be mergeable now.

  15. sipa referenced this in commit 5e6f7cc8ad on Jun 17, 2013
  16. sipa merged this on Jun 17, 2013
  17. sipa closed this on Jun 17, 2013

  18. jgarzik commented at 2:31 PM on June 17, 2013: contributor

    IRC user reports this change causes a remote node (ver 32200) over Tor to drop them (socket error 104, connection reset by peer). Reverting this change fixes the issue.

  19. mikehearn commented at 3:01 PM on June 17, 2013: contributor

    Ver 32200 has been/will be hard forked off, so I'm not sure why we should care?

  20. sipa commented at 3:19 PM on June 17, 2013: member

    Yes, that is true, but because of a reason completely unrelated to the P2P protocol, so we should at least find out why this results in not accepting these version messages - who knows which other versions are involved?

  21. bitsofproof commented at 3:23 PM on June 17, 2013: none

    It is wise to investigate, it however would mean that the flag would not be optional but must be absent to work.

  22. gmaxwell commented at 3:26 PM on June 17, 2013: contributor

    Or there is just some broken alternative implementation sending that version string which is intolerant of the flag.

  23. mikehearn commented at 3:29 PM on June 17, 2013: contributor

    That sounds like a more reasonable explanation.

  24. luke-jr referenced this in commit 4ca705ac04 on Feb 1, 2016
  25. Bushstar referenced this in commit 89d8f7a37d on Apr 8, 2020
  26. DrahtBot locked this on Feb 15, 2022

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: 2026-04-20 00:16 UTC

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