test: use ipaddress in addr_to_hex #36416

Manually merged
fanquake merged 1 commit from switch_to_ipaddress into master 2026-10-08 13:21:06 +00:00 AGit
fanquake commented 2026-10-02 13:51:04 +00:00 (Migrated from github.com)

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

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

Replace our hand-rolled IPv4/IPv6 parser, with `ipaddress.ip_address(addr).packed.hex()`. See https://docs.python.org/3/library/ipaddress.html.
DrahtBot commented 2026-10-02 13:51:13 +00:00 (Migrated from github.com)

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

External sites

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 <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36416 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36416.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36416#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [sedited](https://github.com/bitcoin/bitcoin/pull/36416#pullrequestreview-5444222349), [winterrdog](https://github.com/bitcoin/bitcoin/pull/36416#pullrequestreview-5448844839), [StephenChi-hi](https://github.com/bitcoin/bitcoin/pull/36416#pullrequestreview-5452750713) | | Concept ACK | [sipa](https://github.com/bitcoin/bitcoin/pull/36416#issuecomment-5954480517) | 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-->
First-time contributor

Base: aef8a04966d7ab6c04edc5d19b733e78205405de
Head: 0cd0789c86b39ba0ae4670068d5be351cdcf92ae

I found no actionable issues in this static review.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> Base: `aef8a04966d7ab6c04edc5d19b733e78205405de` Head: `0cd0789c86b39ba0ae4670068d5be351cdcf92ae` I found no actionable issues in this static review. [Full review report](<https://review.fish.foo/traces/36416-0cd0789c86b39ba0ae4670068d5be351cdcf92ae-494-2.html>)
sipa commented 2026-10-02 14:18:08 +00:00 (Migrated from github.com)

Concept ACK

Concept ACK
winterrdog (Migrated from github.com) reviewed 2026-10-07 14:41:17 +00:00
winterrdog (Migrated from github.com) left a comment

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

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
sedited (Migrated from github.com) approved these changes 2026-10-07 14:56:46 +00:00
sedited (Migrated from github.com) left a comment
ACK 0cd0789c86b39ba0ae4670068d5be351cdcf92ae
winterrdog (Migrated from github.com) reviewed 2026-10-07 21:54:29 +00:00
winterrdog (Migrated from github.com) left a comment

tACK 0cd0789c86

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

tACK 0cd0789c86b39ba0ae4670068d5be351cdcf92ae successfully built and ran the entire functional test suite (via the test harness) with Python `3.12.3` on Linux. everything still works fine. also, the change LGTM
StephenChi-hi (Migrated from github.com) reviewed 2026-10-08 06:51:03 +00:00
StephenChi-hi (Migrated from github.com) left a comment

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.

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.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36416
No description provided.