[tests] Test that nodes respond to getdata with notfound #14571

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1810-qaNotfound changing 4 files +109 −1
  1. MarcoFalke commented at 1:19 PM on October 25, 2018: member

    If a node has not announced a tx at all, then it should respond to getdata messages for that tx with notfound, to avoid leaking tx origination privacy.

    In the future this could be adjusted such that a node responds with notfound when a tx has not been announced to us, but that seems to be a more involved change. See e.g. https://github.com/jnewbery/bitcoin/commits/pr14220.1

  2. MarcoFalke added the label Tests on Oct 25, 2018
  3. MarcoFalke force-pushed on Oct 25, 2018
  4. jnewbery commented at 8:00 PM on October 25, 2018: member

    Concept ACK. Great test.

  5. in test/functional/test_framework/messages.py:1243 in fa33a6b7e5 outdated
    1238 | +
    1239 | +    def __init__(self, vec=None):
    1240 | +        if vec is None:
    1241 | +            self.vec = []
    1242 | +        else:
    1243 | +            self.vec = vec
    


    jamesob commented at 8:11 PM on October 25, 2018:

    nit: more concise (if not exactly equivalent) as self.vec = vec or []


    jnewbery commented at 8:30 PM on October 25, 2018:

    I think Marco's version is clearer.

  6. in test/functional/p2p_leak_tx.py:29 in fa33a6b7e5 outdated
      24 | +    def skip_test_if_missing_module(self):
      25 | +        self.skip_if_no_wallet()
      26 | +
      27 | +    def run_test(self):
      28 | +        gen_node = self.nodes[0]  # The block and tx generating node
      29 | +        gen_node.generate(1)
    


    sanket1729 commented at 8:15 PM on October 25, 2018:

    Should we use generate RPC in tests at all after #14299 ?


    jnewbery commented at 8:50 PM on October 25, 2018:

    generate() is now a method in TestNode() that aliases to the generatetoaddress RPC


    sanket1729 commented at 9:13 PM on October 25, 2018:

    Understood. That was a neat way to do things .

  7. in test/functional/p2p_leak_tx.py:30 in fa33a6b7e5 outdated
      25 | +        self.skip_if_no_wallet()
      26 | +
      27 | +    def run_test(self):
      28 | +        gen_node = self.nodes[0]  # The block and tx generating node
      29 | +        gen_node.generate(1)
      30 | +        self.sync_all()
    


    sanket1729 commented at 8:15 PM on October 25, 2018:

    I am new here, but is sync_all() necessary when there is only 1 node?


    jnewbery commented at 8:50 PM on October 25, 2018:

    Entirely correct! This can be removed

  8. MarcoFalke force-pushed on Oct 26, 2018
  9. [tests] Test that nodes respond to getdata with notfound
    If a node has not announced a tx at all, then it should respond to
    getdata messages for that tx with notfound, to avoid leaking tx
    origination privacy.
    fa78a2fc67
  10. in test/functional/test_framework/messages.py:1236 in fa57d644fb outdated
    1231 | @@ -1232,6 +1232,23 @@ def __repr__(self):
    1232 |          return "msg_mempool()"
    1233 |  
    1234 |  
    1235 | +class msg_notfound:
    1236 | +    __slots__ = ("vec")
    


    practicalswift commented at 7:14 AM on October 26, 2018:

    This should be __slots__ = ("vec",) to force tuple instead of str :-)


    MarcoFalke commented at 11:42 AM on October 26, 2018:

    Ugh, I always get this wrong. Thx

  11. MarcoFalke force-pushed on Oct 26, 2018
  12. jnewbery commented at 3:00 PM on October 26, 2018: member

    Tested ACK fa78a2fc670d7162d6ba6d432188da6d6e5288ac

  13. sanket1729 commented at 9:18 PM on October 26, 2018: contributor

    Tested ACK fa78a2fc670d7162d6ba6d432188da6d6e5288ac

  14. MarcoFalke merged this on Oct 27, 2018
  15. MarcoFalke closed this on Oct 27, 2018

  16. MarcoFalke referenced this in commit c70f9c0cfc on Oct 27, 2018
  17. MarcoFalke deleted the branch on Oct 27, 2018
  18. Munkybooty referenced this in commit b06d36b43b on Jul 21, 2021
  19. Munkybooty referenced this in commit 6ab72d4d11 on Jul 22, 2021
  20. Munkybooty referenced this in commit 817e35d103 on Jul 22, 2021
  21. Munkybooty referenced this in commit 94eb8342a2 on Jul 22, 2021
  22. Munkybooty referenced this in commit 433d13e8a7 on Jul 23, 2021
  23. Munkybooty referenced this in commit 26d889003e on Jul 23, 2021
  24. Munkybooty referenced this in commit 6e0fdc7321 on Jul 26, 2021
  25. DrahtBot locked this on Sep 8, 2021

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-17 06:15 UTC

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