asmap: Make version match externally computed hashes #36215

pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2026/09/asmap_ver_s256 changing 3 files +3 −3
  1. hodlinator commented at 9:50 AM on September 10, 2026: contributor

    Problem

    Running CLI utilities such as sha256sum on the encoded asmap blob, and then grepping for the outputted hash in the bitcoind debug.log was unsuccessful.

    Solution

    • Change the version computation from double to single SHA256 Note: This invalidates serialized AddrMan data which forces re-bucketing.
    • Avoid reversing byte order when logging the version

    Inspired by #36201 (comment) + #36201#pullrequestreview-5158109401

  2. DrahtBot commented at 9:50 AM on September 10, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36215.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  3. sedited requested review from fjahr on Sep 10, 2026
  4. fjahr commented at 10:08 AM on September 10, 2026: contributor

    The functional test needs an update, you should squash this into one commit so it doesn't have to be changed twice.

  5. in src/init.cpp:1704 in 99911107d4
    1700 | @@ -1701,7 +1701,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
    1701 |                      return false;
    1702 |                  #endif
    1703 |              }
    1704 | -            LogInfo("Using asmap version %s for IP bucketing", asmap_version.ToString());
    1705 | +            LogInfo("Using asmap version %s for IP bucketing", HexStr(std::span{asmap_version.data(), asmap_version.size()}));
    


    fjahr commented at 10:18 AM on September 10, 2026:

    Does the span really need to be explicitly constructed here? HexStr(asmap_version) should just work afaict.

  6. hodlinator marked this as a draft on Sep 10, 2026
  7. asmap: Make outputted ASMap version match externally computed hashes
    * Change version from double to single SHA256
      This invalidates serialized AddrMan data which forces re-bucketing.
    
    * Avoid reversing byte order for ASMap version in log
      Makes it easier to match it with externally computed hashes of the encoded file.
    7ee94bf4b0
  8. hodlinator force-pushed on Sep 10, 2026
  9. DrahtBot added the label CI failed on Sep 10, 2026
  10. hodlinator marked this as ready for review on Sep 10, 2026
  11. DrahtBot removed the label CI failed on Sep 10, 2026
  12. hodlinator commented at 12:46 PM on September 10, 2026: contributor

    Sorry for the incomplete initial state, latest push addresses the issues so far.

  13. fanquake commented at 1:03 PM on September 10, 2026: member

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-09-10 14:51 UTC

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