fuzz: Check for addrv1 compatibility before using addrv1 serializer. Fuzz addrv2 serialization. #20247

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:fuzzers-netaddr-post-addrv2 changing 1 files +9 −5
  1. practicalswift commented at 4:32 PM on October 26, 2020: contributor

    Fuzz addrv2 address serialization.

    Check for addrv1 compatibility before using addrv1 serializer.

    Before this

    $ src/test/fuzz/netaddr_deserialize
    netaddr_deserialize: test/fuzz/deserialize.cpp:84: void 
        (anonymous namespace)::AssertEqualAfterSerializeDeserialize(const T &) [T = CNetAddr]:
        Assertion `Deserialize<T>(Serialize(obj)) == obj' failed.
    

    After this patch:

    $ src/test/fuzz/netaddr_deserialize
    …
    
  2. practicalswift renamed this:
    fuzz: Check for addrv1 compatibility before using addrv1 serializer. Fuzz addrv2 address serialization.
    fuzz: Check for addrv1 compatibility before using addrv1 serializer. Fuzz addrv2 serialization.
    on Oct 26, 2020
  3. fuzz: Check for addrv1 compatibility before using addrv1 serializer 903f3d0627
  4. practicalswift force-pushed on Oct 26, 2020
  5. MarcoFalke commented at 4:43 PM on October 26, 2020: member

    review ACK 903f3d06275312aa4000b765d2287339210c61c1

  6. DrahtBot added the label Tests on Oct 26, 2020
  7. in src/test/fuzz/deserialize.cpp:186 in 903f3d0627
     183 | @@ -183,7 +184,10 @@ void test_one_input(const std::vector<uint8_t>& buffer)
     184 |  #elif NETADDR_DESERIALIZE
     185 |          CNetAddr na;
     186 |          DeserializeFromFuzzingInput(buffer, na);
    


    sipa commented at 7:46 PM on October 26, 2020:

    The test would be more powerful if it permitted constructing the input using ADDRV2_FORMAT (or have the option for both), as no torv3/i2p/cjdns addresses will be construction currently.


    practicalswift commented at 8:49 PM on October 26, 2020:

    Note that the current version permits constructing the input using ADDRV2_FORMAT since the version is read from the input provided by the fuzzer:

    https://github.com/bitcoin/bitcoin/blob/903f3d06275312aa4000b765d2287339210c61c1/src/test/fuzz/deserialize.cpp#L64-L70

    In other words torv3/i2p/cjdns addresses can be construction currently :)


    sipa commented at 9:00 PM on October 26, 2020:

    Ooh, very good. Ignore me.

  8. MarcoFalke merged this on Oct 27, 2020
  9. MarcoFalke closed this on Oct 27, 2020

  10. sidhujag referenced this in commit e6bcd869c2 on Oct 27, 2020
  11. practicalswift commented at 7:23 AM on November 1, 2020: contributor

    @vasild The results you're describing below were from fuzzing a version of master prior to the merge of this PR, right? :)

    <vasild> hmm, it just occured to me (after staring at some fuzzing failure) that some CNetAddr objects do not ser+deser into the original. For example a torv3 address when serialized (as done by the fuzzer, ADDRV2_FORMAT is not set) end up with 16 zeroes.

  12. vasild commented at 1:54 PM on November 1, 2020: member

    Yes, prior to this PR. Thanks for fixing this!

    ACK 903f3d0

  13. MarcoFalke referenced this in commit 5174b534da on Nov 3, 2020
  14. sidhujag referenced this in commit ac6844bafc on Nov 3, 2020
  15. practicalswift deleted the branch on Apr 10, 2021
  16. PastaPastaPasta referenced this in commit 0e77bfd548 on Sep 17, 2021
  17. PastaPastaPasta referenced this in commit 95ecc8fb7d on Sep 19, 2021
  18. PastaPastaPasta referenced this in commit 2bf2fa8751 on Sep 21, 2021
  19. PastaPastaPasta referenced this in commit f5be380db7 on Sep 24, 2021
  20. kittywhiskers referenced this in commit 4d09e2cdd6 on Oct 12, 2021
  21. kittywhiskers referenced this in commit 66eb7a0065 on Feb 27, 2022
  22. kittywhiskers referenced this in commit 57cc92f866 on Feb 28, 2022
  23. kittywhiskers referenced this in commit e88778c5c0 on Feb 28, 2022
  24. kittywhiskers referenced this in commit d47fb4fda8 on Feb 28, 2022
  25. kittywhiskers referenced this in commit f645605c93 on Mar 13, 2022
  26. kittywhiskers referenced this in commit a68bf7df61 on Mar 17, 2022
  27. kittywhiskers referenced this in commit 3afe800e1e on Mar 17, 2022
  28. kittywhiskers referenced this in commit b0459e8a75 on Mar 17, 2022
  29. kittywhiskers referenced this in commit c982fc5d95 on Mar 17, 2022
  30. PastaPastaPasta referenced this in commit cce7bc603e on Mar 29, 2022
  31. DrahtBot locked this on Aug 18, 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-16 15:14 UTC

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