#36249 net, rpc: Asmap version improvements/follow-ups
https://github.com/bitcoin/bitcoin/pull/36249 · · +53/-23 in 6 files, 6 commits · labels: Needs Backport (32.x)
Goal
- Let node operators and tooling inspect the active ASMap hash via RPC to verify it against attestations
- Avoid forcing operators to parse debug logs to confirm which ASMap version is loaded
Follow-up to #36215 that exposes the SHA256 hash of the loaded ASMap via the asmap_version field in getnetworkinfo and reuses AsmapVersion in exportasmap. It also caches the hash inside NetGroupManager, simplifies logging in init.cpp, adds functional test coverage for addrman rebucketing, and documents ASMap verification against community attestations.
Problem: Node operators and external tooling lacked a convenient programmatic way to inspect and verify the active ASMap hash against published attestations in asmap-data, previously requiring inspection of debug log output.
Category: P2P (#58 of 65)
P4 · cleanup
- P4 because the change only adds internal caching of the ASMap version hash
- Does not alter network behavior or peer bucketing logic
The change in p2p code is purely internal caching of the ASMap version hash and does not modify network behavior or peer bucketing.
Membership: Modifies NetGroupManager in src/netgroup.cpp and src/netgroup.h, which governs peer address bucketing.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0
Category: RPC / REST / ZMQ (#33 of 52)
P3 · new feature
- P3 because it exposes a convenient field to verify active ASMap data against attestations
- Benefit is modest and deferrable since operators could previously check logs
Adding asmap_version to getnetworkinfo provides a straightforward RPC field for users verifying their active ASMap against public attestations, though the need is minor and reasonably deferrable.
Membership: Adds asmap_version to getnetworkinfo and refactors exportasmap in src/rpc/net.cpp.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 0
Reviewability: Ready
- Ready to review
- Small PR with passing CI and author addressed review feedback
The PR is small, CI is green, and the author addressed the only review suggestion with an updated commit that received a re-ACK.
Author status: active
Resolved concerns:
- sedited suggested caching the version in NetGroupManager instead of hashing on every RPC call, which fjahr implemented in 0b353a9e87.
Agreement: Strong
- Strong support across all reviewers
- Verified by testing (jurraca)
- Approved after author implemented suggested hash caching (sedited)
Strong approval with tACK from jurraca and re-ACK from sedited after caching was added.
Reviewers tested and approved the changes, with constructive feedback on caching promptly adopted and re-ACKed.
- jurraca provided a tACK on commit c1e9d15406
- sedited suggested caching the hash on RPC calls, then re-ACKed commit 0b353a9e87
Review verdicts (DrahtBot): 1 (+1)
Files
24 lines under test/bench/ci.
- test/functional/feature_asmap.py +18/-6
- doc/asmap-data.md +13/-1
- src/rpc/net.cpp +8/-5
- src/netgroup.cpp +11/-1
- src/netgroup.h +2/-6
- src/init.cpp +1/-4
Card
This PR adds the active ASMap SHA256 hash to getnetworkinfo, reuses AsmapVersion in exportasmap, and caches the hash in NetGroupManager. It solves the inconvenience of having to inspect debug log files to verify that the active ASMap matches community-attested hashes in asmap-data. Review is active and positive, with a tested ACK from jurraca and an ACK from sedited following an accepted suggestion to cache the hash.