{
 "number": 36249,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36249",
 "title": "net, rpc: Asmap version improvements/follow-ups",
 "author": "fjahr",
 "author_association": "MEMBER",
 "created_at": "2026-09-14T11:46:59Z",
 "updated_at": "2026-09-16T13:04:48Z",
 "age_days": 3,
 "draft": false,
 "labels": [
  "Needs Backport (32.x)"
 ],
 "milestone": "32.0",
 "base": "master",
 "head_sha": "0b353a9e872e81b900a543d7fedf668be3afec2c",
 "head_ref": "2026-09-asmap-ver-followup",
 "head_repo": "fjahr/bitcoin",
 "head_history": [
  {
   "t": "2026-09-14T12:35:24Z",
   "sha": "c1e9d15406fb7b46cff1cf385607a3e47fdd1bfb"
  }
 ],
 "additions": 53,
 "deletions": 23,
 "changed_files": 6,
 "commit_count": 6,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "sedited",
      "url": "https://github.com/bitcoin/bitcoin/pull/36249#pullrequestreview-5222696755"
     }
    ],
    "stale_ack": [
     {
      "login": "jurraca",
      "url": "https://github.com/bitcoin/bitcoin/pull/36249#pullrequestreview-5208593763"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "sedited": {
   "kind": "ack",
   "hash": "0b353a9e872e81b900a543d7fedf668be3afec2c",
   "t": "2026-09-16T12:35:58Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 1,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 3,
  "changes_requested": 0,
  "distinct_reviewers": [
   "jurraca",
   "sedited"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-09-16T12:27:25Z",
  "last_reviewer_activity": "2026-09-16T12:35:58Z",
  "last_reviewer": "sedited",
  "author_silent_days": 1,
  "waiting_on_author_days": 1,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [
   36215
  ],
  "depends_on": [
   36215
  ],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 36215,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-09-10",
    "title": "asmap: Make version match externally computed hashes"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "src/rpc/net.cpp"
 ],
 "body": "This is a follow-up to #36215. I noticed the possible improvement in `exportasmap` and went through everything to see where else we could make changes where we can use this as an advantage.\n\n- `rpc: Reuse AsmapVersion in exportasmap`: `exportasmap` hashed the file by hand to show the hash, instead we can use `AsmapVersion()` which is the same value.\n- `init: Log asmap version from NetGroupManager`: Drop the version variable in init and log the version by getting it from `NetGroupManager` instead\n- `test: Check embedded asmap version log and addrman re-bucketing`: We didn't cover rebucketing behavior in the functional test yet. Also gets rid of stale comment.\n- `rpc: Add asmap_version to getnetworkinfo`: Getting access to the asmap version from the logs may be a bit tedious for some users and now it may be even more interesting for them to compare the version to the hash attested to in `asmap-data`. So let them get it via `getnetworkinfo`.\n- `doc: Describe how to verify the asmap in use`: Just mention the latest changes from above and the opportunity to compare the version to the hash in seen in `asmap-data`.",
 "commits": [
  {
   "sha": "fdfd196908e1fce930ed0554d8a75d4be3cf5cec",
   "date": "2026-09-14T11:41:53Z",
   "message": "rpc: Reuse AsmapVersion in exportasmap"
  },
  {
   "sha": "0bc87365cac1ef8586a28d69eca95d8080512454",
   "date": "2026-09-14T11:41:55Z",
   "message": "init: Log asmap version from NetGroupManager"
  },
  {
   "sha": "dd5a8a63b2232279e2ea46e4360434d36f379774",
   "date": "2026-09-14T12:01:14Z",
   "message": "test: Check embedded asmap version log and addrman re-bucketing"
  },
  {
   "sha": "87ce88c1b53c0a954a53b5a1856ef0d20850f3d5",
   "date": "2026-09-14T12:01:15Z",
   "message": "rpc: Add asmap_version to getnetworkinfo"
  },
  {
   "sha": "c1e9d15406fb7b46cff1cf385607a3e47fdd1bfb",
   "date": "2026-09-14T12:01:15Z",
   "message": "doc: Describe how to verify the asmap in use"
  },
  {
   "sha": "0b353a9e872e81b900a543d7fedf668be3afec2c",
   "date": "2026-09-16T12:03:41Z",
   "message": "netgroup: Cache asmap version"
  }
 ],
 "timeline": [
  {
   "t": "2026-09-14T12:35:24Z",
   "kind": "force_push",
   "who": "fjahr",
   "commit": "c1e9d15406fb7b46cff1cf385607a3e47fdd1bfb"
  },
  {
   "t": "2026-09-15T10:19:24Z",
   "kind": "review",
   "who": "jurraca",
   "assoc": "MEMBER",
   "state": "APPROVED",
   "commit": "c1e9d15406fb7b46cff1cf385607a3e47fdd1bfb",
   "text": "tACK https://github.com/bitcoin/bitcoin/pull/36249/commits/c1e9d15406fb7b46cff1cf385607a3e47fdd1bfb"
  },
  {
   "t": "2026-09-16T11:31:48Z",
   "kind": "review",
   "who": "sedited",
   "assoc": "MEMBER",
   "state": "APPROVED",
   "commit": "c1e9d15406fb7b46cff1cf385607a3e47fdd1bfb",
   "text": "ACK c1e9d15406fb7b46cff1cf385607a3e47fdd1bfb"
  },
  {
   "t": "2026-09-16T11:45:35Z",
   "kind": "review_comment",
   "who": "sedited",
   "assoc": "MEMBER",
   "path": "src/rpc/net.cpp",
   "commit": "0b353a9e872e81b900a543d7fedf668be3afec2c",
   "in_reply_to": null,
   "text": "This is fine, but it seems a bit wasteful to re-hash the map on every call. Maybe netgroupman can cache it?"
  },
  {
   "t": "2026-09-16T11:51:09Z",
   "kind": "review_comment",
   "who": "fjahr",
   "assoc": "MEMBER",
   "path": "src/rpc/net.cpp",
   "commit": "0b353a9e872e81b900a543d7fedf668be3afec2c",
   "in_reply_to": 4025614149,
   "text": "Sure, I actually had considered caching it early on but thought it wasn't necessary but that was before I added it to the RPC. It makes more sense to add it when taking all the latest changes into account, let me add it."
  },
  {
   "t": "2026-09-16T12:27:25Z",
   "kind": "comment",
   "who": "fjahr",
   "assoc": "MEMBER",
   "text": "Pushed caching the asmap version in netgroupman as a separate commit. The constructor is moved to `netgroup.cpp` to avoid importing `util/asmap.h` into the netgroup header file."
  },
  {
   "t": "2026-09-16T12:35:58Z",
   "kind": "review",
   "who": "sedited",
   "assoc": "MEMBER",
   "state": "APPROVED",
   "commit": "0b353a9e872e81b900a543d7fedf668be3afec2c",
   "text": "Re-ACK 0b353a9e872e81b900a543d7fedf668be3afec2c"
  }
 ],
 "labels_log": [
  {
   "t": "2026-09-14T12:35:52Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-14T13:27:57Z",
   "action": "labeled",
   "label": "Needs Backport (32.x)",
   "who": "sedited"
  },
  {
   "t": "2026-09-14T13:38:13Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-09-16T11:02:07Z",
   "kind": "milestoned",
   "who": "sedited"
  }
 ],
 "text_chars": 2137,
 "text_tokens_estimate": 534,
 "changed_paths": [
  "doc/asmap-data.md",
  "src/init.cpp",
  "src/netgroup.cpp",
  "src/netgroup.h",
  "src/rpc/net.cpp",
  "test/functional/feature_asmap.py"
 ],
 "files": [
  {
   "path": "doc/asmap-data.md",
   "add": 13,
   "del": 1
  },
  {
   "path": "src/init.cpp",
   "add": 1,
   "del": 4
  },
  {
   "path": "src/netgroup.cpp",
   "add": 11,
   "del": 1
  },
  {
   "path": "src/netgroup.h",
   "add": 2,
   "del": 6
  },
  {
   "path": "src/rpc/net.cpp",
   "add": 8,
   "del": 5
  },
  {
   "path": "test/functional/feature_asmap.py",
   "add": 18,
   "del": 6
  }
 ],
 "test_lines": 24,
 "git": {
  "head": "0b353a9e872e81b900a543d7fedf668be3afec2c",
  "head_matches_backup": true,
  "base": "adca0a97406d8f8b1f85ce5bb8aa5c354b96b893",
  "commits": [
   {
    "sha": "fdfd196908",
    "subject": "rpc: Reuse AsmapVersion in exportasmap",
    "files": 1,
    "add": 2,
    "del": 5
   },
   {
    "sha": "0bc87365ca",
    "subject": "init: Log asmap version from NetGroupManager",
    "files": 1,
    "add": 1,
    "del": 4
   },
   {
    "sha": "dd5a8a63b2",
    "subject": "test: Check embedded asmap version log and addrman re-bucketing",
    "files": 1,
    "add": 15,
    "del": 6
   },
   {
    "sha": "87ce88c1b5",
    "subject": "rpc: Add asmap_version to getnetworkinfo",
    "files": 2,
    "add": 10,
    "del": 1
   },
   {
    "sha": "c1e9d15406",
    "subject": "doc: Describe how to verify the asmap in use",
    "files": 1,
    "add": 13,
    "del": 1
   },
   {
    "sha": "0b353a9e87",
    "subject": "netgroup: Cache asmap version",
    "files": 2,
    "add": 13,
    "del": 7
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "ee2e8305c37d9994",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}