{
 "number": 36220,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36220",
 "title": "rpc: report background validation progress in getchainstates",
 "author": "arejula27",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-09-10T15:05:18Z",
 "updated_at": "2026-09-16T08:21:58Z",
 "age_days": 7,
 "draft": false,
 "labels": [
  "RPC/REST/ZMQ"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
 "head_ref": "rpc-getchainstates-background-progress",
 "head_repo": "arejula27/bitcoin",
 "head_history": [],
 "additions": 7,
 "deletions": 2,
 "changed_files": 2,
 "commit_count": 2,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "nervana21",
      "url": "https://github.com/bitcoin/bitcoin/pull/36220#issuecomment-5634829757"
     }
    ],
    "concept_ack": [
     {
      "login": "sedited",
      "url": "https://github.com/bitcoin/bitcoin/pull/36220#issuecomment-5621277255"
     },
     {
      "login": "vicjuma",
      "url": "https://github.com/bitcoin/bitcoin/pull/36220#pullrequestreview-5170591325"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "sedited": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-09-10T15:35:18Z",
   "stale": false
  },
  "vicjuma": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-09-10T17:59:43Z",
   "stale": false
  },
  "nervana21": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-09-10T22:47:23Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 3,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "nervana21",
   "sedited",
   "vicjuma"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-09-11T17:29:05Z",
  "last_reviewer_activity": "2026-09-11T17:36:20Z",
  "last_reviewer": "nervana21",
  "author_silent_days": 5,
  "waiting_on_author_days": 5,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [
   33259
  ],
  "depends_on": [
   33259
  ],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 33259,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-03-24",
    "title": "rpc, logging: add backgroundvalidation to getblockchaininfo"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "src/rpc/blockchain.cpp"
 ],
 "body": "After #33259, `getblockchaininfo` reports the progress of the background chainstate relative to the snapshot base block, but `getchainstates` still computes `verificationprogress` against the network tip for every chainstate, so the same node reports two different numbers for the same chainstate.\n\nThis PR modifies `verificationprogress` value to report the correct value, relative to the block the chainstate actually stops at.",
 "commits": [
  {
   "sha": "2e2deb8262f2297af61b152aa7646e3cabcc4f40",
   "date": "2026-09-10T14:56:09Z",
   "message": "rpc: report background validation progress in getchainstates"
  },
  {
   "sha": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
   "date": "2026-09-10T15:24:19Z",
   "message": "test: check background validation progress in getchainstates"
  }
 ],
 "timeline": [
  {
   "t": "2026-09-10T15:35:18Z",
   "kind": "comment",
   "who": "sedited",
   "assoc": "MEMBER",
   "text": "Concept ACK"
  },
  {
   "t": "2026-09-10T16:06:27Z",
   "kind": "comment",
   "who": "arejula27",
   "assoc": "CONTRIBUTOR",
   "text": "would be interesting to add a new field \"targetBlock\" to show until which block must validate the background chainstate?"
  },
  {
   "t": "2026-09-10T17:59:26Z",
   "kind": "review_comment",
   "who": "vicjuma",
   "assoc": "CONTRIBUTOR",
   "path": "src/rpc/blockchain.cpp",
   "commit": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
   "in_reply_to": null,
   "text": "I feel like this change better aligns the [assumeutxo.md](https://github.com/bitcoin/bitcoin/blob/master/doc/assumeutxo.md) documentation (accurate monitoring)\n\n[quoted text omitted]"
  },
  {
   "t": "2026-09-10T17:59:43Z",
   "kind": "review",
   "who": "vicjuma",
   "assoc": "CONTRIBUTOR",
   "state": "COMMENTED",
   "commit": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
   "text": "Concept ACK"
  },
  {
   "t": "2026-09-10T22:47:23Z",
   "kind": "comment",
   "who": "nervana21",
   "assoc": "CONTRIBUTOR",
   "text": "Concept ACK"
  },
  {
   "t": "2026-09-11T13:02:46Z",
   "kind": "review_comment",
   "who": "nervana21",
   "assoc": "CONTRIBUTOR",
   "path": "src/rpc/blockchain.cpp",
   "commit": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
   "in_reply_to": null,
   "text": "2e2deb8262f2297af61b152aa7646e3cabcc4f40: rpc: report background validation progress in getchainstates\n\n```suggestion\n        data.pushKV(\"verificationprogress\", cs.TargetBlock().has_value() ? chainman.GetBackgroundVerificationProgress(*tip)\n```\n\nnit"
  },
  {
   "t": "2026-09-11T13:03:28Z",
   "kind": "comment",
   "who": "nervana21",
   "assoc": "CONTRIBUTOR",
   "text": "tACK d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55"
  },
  {
   "t": "2026-09-11T17:29:05Z",
   "kind": "review_comment",
   "who": "arejula27",
   "assoc": "CONTRIBUTOR",
   "path": "src/rpc/blockchain.cpp",
   "commit": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
   "in_reply_to": 3989371855,
   "text": "Thanks for the review! `TargetBlock()` returns a `const CBlockIndex*` rather than a `std::optional`, so I don't think `.has_value()` would work here."
  },
  {
   "t": "2026-09-11T17:36:20Z",
   "kind": "review_comment",
   "who": "nervana21",
   "assoc": "CONTRIBUTOR",
   "path": "src/rpc/blockchain.cpp",
   "commit": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
   "in_reply_to": 3989371855,
   "text": "ahh, you're right. my mistake!"
  }
 ],
 "labels_log": [
  {
   "t": "2026-09-10T15:05:22Z",
   "action": "labeled",
   "label": "RPC/REST/ZMQ",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 1429,
 "text_tokens_estimate": 357,
 "changed_paths": [
  "src/rpc/blockchain.cpp",
  "test/functional/feature_assumeutxo.py"
 ],
 "files": [
  {
   "path": "src/rpc/blockchain.cpp",
   "add": 3,
   "del": 2
  },
  {
   "path": "test/functional/feature_assumeutxo.py",
   "add": 4,
   "del": 0
  }
 ],
 "test_lines": 4,
 "git": {
  "head": "d9638e49f6a7ef70dbe31cb85e809d9f81e3ce55",
  "head_matches_backup": true,
  "base": "4519933391dd23dbf1a4eceec6dd53d2e9e71cc3",
  "commits": [
   {
    "sha": "2e2deb8262",
    "subject": "rpc: report background validation progress in getchainstates",
    "files": 1,
    "add": 3,
    "del": 2
   },
   {
    "sha": "d9638e49f6",
    "subject": "test: check background validation progress in getchainstates",
    "files": 1,
    "add": 4,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "27c9bf4d3add43b4",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}