{
 "number": 36613,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36613",
 "title": "test: add getblockfilter test coverage for header-only blocks",
 "author": "aaron-leeb",
 "author_association": "FIRST_TIME_CONTRIBUTOR",
 "created_at": "2026-10-22T17:34:05Z",
 "updated_at": "2026-11-01T09:22:41Z",
 "description_hash": "d381c5af686271eb",
 "age_days": 10,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "64cf455b481d36182957bdcfcae7c411a7879897",
 "head_ref": "test/getblockfilter-header-only",
 "head_repo": "aaron-leeb/bitcoin",
 "head_history": [],
 "additions": 15,
 "deletions": 0,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "Zippo76",
      "url": "https://github.com/bitcoin/bitcoin/pull/36613#pullrequestreview-5727361525"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "Zippo76"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-22T16:13:33Z",
  "last_reviewer_activity": "2026-11-01T09:22:38Z",
  "last_reviewer": "Zippo76",
  "author_silent_days": 10,
  "waiting_on_author_days": 0,
  "days_since_update": 0
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Add functional coverage for the `getblockfilter` error raised when a node has a known block header, but the block has never been connected.\n\nThis gap in test coverage was identified by a coverage report generated while exploring BIP 157/158. The branch in `src/rpc/blockchain.cpp` was never executed in the measured tests:\nhttps://github.com/bitcoin/bitcoin/blob/64cf455b481d36182957bdcfcae7c411a7879897/src/rpc/blockchain.cpp#L3054-L3056\n\nThe existing `getblockfilter` functional test checks unknown block hashes and filter retrieval for active and stale blocks, but doesn\u2019t check a known header whose block has never been connected.\n\nThis change submits only the block header of a newly mined block to a node using `submitheader` and verifies that in this expected state, `getblockfilter` returns error `-5` with `\"Filter not found. Block was not connected to active chain.\"` This adds coverage for the RPC\u2019s distinction between an unknown block and a known block for which no filter has been constructed.\n\n`rpc_getblockfilter.py` passes, and changing the error message makes the new assertion fail as expected.",
 "commits": [
  {
   "sha": "64cf455b481d36182957bdcfcae7c411a7879897",
   "date": "2026-10-22T16:13:33Z",
   "message": "test: add getblockfilter test coverage for header-only blocks"
  }
 ],
 "timeline": [
  {
   "t": "2026-11-01T09:22:38Z",
   "kind": "review",
   "who": "Zippo76",
   "assoc": "NONE",
   "state": "COMMENTED",
   "commit": "64cf455b481d36182957bdcfcae7c411a7879897",
   "text": "tACK 64cf455b48\n\nTested on macOS 27.0.1 (Apple Silicon arm64).\nrpc_getblockfilter.py passes.\nReplacing if (!block_was_connected) with if (block_was_connected) in getblockfilter in src/rpc/blockchain.cpp makes the PR's test fail, while the test from master 6c01bd0b2d still passes with the same mutation:\n\nExpected: Filter not found. Block was not connected to active chain.\nActual:   Filter not found. This error is unexpected and indicates index corruption.\nThe code implies that the header-only block has not reached BLOCK_VALID_SCRIPTS on node 0, so the new assertion exercises the intended -5 error path.",
   "id": "r:5727361525",
   "url": "https://github.com/bitcoin/bitcoin/pull/36613#pullrequestreview-5727361525",
   "hash": "38d437144fde08bb",
   "edited": null
  }
 ],
 "labels_log": [
  {
   "t": "2026-10-22T17:34:10Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 1845,
 "text_tokens_estimate": 461,
 "changed_paths": [
  "test/functional/rpc_getblockfilter.py"
 ],
 "files": [
  {
   "path": "test/functional/rpc_getblockfilter.py",
   "add": 15,
   "del": 0
  }
 ],
 "test_lines": 15,
 "git": {
  "head": "64cf455b481d36182957bdcfcae7c411a7879897",
  "head_matches_backup": true,
  "base": "152a55397e451fed9c10041bddf01aa6839847d5",
  "patch_id": "f255727c1fd3825a",
  "commits": [
   {
    "sha": "64cf455b48",
    "subject": "test: add getblockfilter test coverage for header-only blocks",
    "files": 1,
    "add": 15,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "f255727c1fd3825a",
 "input_hash": "ff39a2d472fe4209",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}