test: use ipaddress in addr_to_hex #36416

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:switch_to_ipaddress changing 1 files +2 −23
  1. fanquake commented at 1:51 PM on October 2, 2026: member

    Replace our hand-rolled IPv4/IPv6 parser, with ipaddress.ip_address(addr).packed.hex().

    See https://docs.python.org/3/library/ipaddress.html.

  2. DrahtBot added the label Tests on Oct 2, 2026
  3. DrahtBot commented at 1:51 PM on October 2, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK sedited, winterrdog, StephenChi-hi
    Concept ACK sipa

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. sipa commented at 2:18 PM on October 2, 2026: member

    Concept ACK

  5. test: use ipaddress in addr_to_hex
    Replace our hand-rolled IPv4/IPv6 parser, with
    `ipaddress.ip_address(addr).packed.hex()`.
    0cd0789c86
  6. fanquake force-pushed on Oct 6, 2026
  7. winterrdog commented at 2:41 PM on October 7, 2026: contributor

    concept ACK

    replacing the naive parser with ipaddress is a clear improvement. IPv4-mapped IPv6 addresses (e.g. ::ffff:192.0.2.1) were always rejected by the old parser

  8. sedited approved
  9. sedited commented at 2:56 PM on October 7, 2026: contributor

    ACK 0cd0789c86b39ba0ae4670068d5be351cdcf92ae

  10. DrahtBot requested review from sipa on Oct 7, 2026
  11. DrahtBot requested review from winterrdog on Oct 7, 2026
  12. winterrdog commented at 9:54 PM on October 7, 2026: contributor

    tACK 0cd0789c86b39ba0ae4670068d5be351cdcf92ae

    successfully built and ran the entire functional test suite, via the test harness, with Python 3.12.3 on Linux (Pop!_OS 24.04 LTS). everything still works fine. also, the change LGTM

  13. StephenChi-hi commented at 6:51 AM on October 8, 2026: none

    tACK ​​ 0cd0789c86

    nice cleanup LGTM

    I also reviewed the code changes and ran the full functional test suite (test/functional/test_runner.py) locally with Python 3.14.7 on macOS, and everything passed.

  14. sedited merged this on Oct 8, 2026
  15. sedited closed this on Oct 8, 2026

  16. fanquake deleted the branch on Oct 8, 2026

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-10-24 00:51 UTC

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