{
 "number": 36618,
 "input_hash": "ea7b910235f40c94",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-11-02T01:11:29+00:00",
 "result": {
  "summary": "Updates the functional test framework to wait for all enabled background indices (such as txindex and blockfilterindex) to sync by default during node startup and when calling `sync_all()`. It cleans up redundant manual index-synchronization calls across multiple test files and removes the standalone `sync_txindex` helper.",
  "problem": "Functional tests relying on background indices can race against wallet or RPC operations if an index has not caught up to the chain tip, causing intermittent test flakes such as missing block filters during fast wallet rescans (#36564). Previously, tests had to remember to call manual `wait_until` index checks or helpers.",
  "card": "This pull request configures functional test node startup and sync helpers to automatically wait for background index synchronization, resolving intermittent test flakes caused by race conditions. It addresses issue #36564 where wallet rescans failed due to block filters lagging behind the chain tip. Redundant manual index sync logic across 18 test files is removed, with no changes to production node code.",
  "evidence": [
   "PR description links to failure report in issue #36564 and provides a reproduction snippet using a sleep in `TraceThread` that triggers `(WARNING: block filter not found!)`.",
   "Commit fa74dc72d9 notes: 'The tests already wait for the mempool and blocks after start and after mining, so they should wait for indexes as well to avoid intermittent test failures.'"
  ],
  "scope_notes": "Touches 18 test files, primarily replacing manual `wait_until` index checks with the centralized default wait in `BitcoinTestFramework` and `TestNode`.",
  "changed_since_previous": "None. The diff confirms the previous description.",
  "thread": {
   "last_event_at": "2026-11-01T18:02:57Z",
   "events": 11,
   "head_sha": "fa74dc72d942e1628cea3c143bb56eed1457bbce",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [
   {
    "at": "2026-11-01",
    "id": "c:6561772062",
    "on": "reviewer",
    "url": "https://github.com/bitcoin/bitcoin/pull/36618#issuecomment-6561772062",
    "what": "hebasto to evaluate author's explanation regarding keeping the first commit"
   }
  ],
  "risk": {
   "level": "low",
   "touches": [
    "tests"
   ],
   "why": "A mistake would only cause functional test timeouts or CI failures without impacting release binaries or consensus."
  },
  "discussion": {
   "author_status": "last statement processed 2026-11-01",
   "open_concerns": [],
   "resolved_concerns": [
    "ViniciusCestarii: feature_index_prune.py loses test coverage because it previously checked for absolute height and missing index (accepted by ViniciusCestarii 2026-10-30)",
    "hebasto: whether the reproducer is correct as all tests pass on Ubuntu 26.04 (accepted by hebasto 2026-10-31)",
    "hebasto: drop the first commit if the second commit already fixes all failures (answered by maflcko 2026-11-01)"
   ]
  },
  "reviewability": {
   "state": "Ready",
   "label": "Ready",
   "reason": "Nothing known that would invalidate a review now."
  },
  "agreement": {
   "state": "Strong",
   "summary": "Strong: substantive support, no open objection (ViniciusCestarii)",
   "reason": "Claim c:6545513372 moved to answered after author maflcko explained the purpose of the first commit in c:6561772062.",
   "evidence": [
    "ViniciusCestarii: Concept ACK \u2014 I like how cleaner it is. I also measured performance but saw no significant change.",
    "ViniciusCestarii: ACK"
   ],
   "objections": [
    {
     "reviewer": "ViniciusCestarii",
     "association": "CONTRIBUTOR",
     "type": "objection",
     "kind": "correctness",
     "harm": "feature_index_prune.py loses test coverage because it previously checked for absolute height and missing index",
     "request": "",
     "question": "",
     "text": "feature_index_prune.py loses test coverage because it previously checked for absolute height and missing index",
     "clears_with": "change",
     "blocking": true,
     "status": "accepted",
     "status_note": "author explained behavior does not change and reviewer accepted",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "rc:4422553940"
     ],
     "evidence": "2026-10-29: 'This changes test behavior. It used to check for absolute height and missing index.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36618#discussion_r4415070983",
     "id": "rc:4415070983",
     "at": "2026-10-29",
     "status_at": "2026-10-30",
     "status_by": "ViniciusCestarii",
     "resolution_evidence": "2026-10-30: ViniciusCestarii: 'thanks for explaining! Makes sense.'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "hebasto",
     "association": "MEMBER",
     "type": "question",
     "kind": "correctness",
     "harm": "",
     "request": "",
     "question": "whether the reproducer is correct as all tests pass on Ubuntu 26.04",
     "text": "whether the reproducer is correct as all tests pass on Ubuntu 26.04",
     "clears_with": "answer",
     "blocking": false,
     "status": "accepted",
     "status_note": "hebasto confirmed reproducing the issue with a longer delay on Fedora 44",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "c:6530030342",
      "c:6530160749"
     ],
     "evidence": "2026-10-30: 'I\u2019m not sure this is the right reproducer, as all the tests pass on my Ubuntu 26.04 machine.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36618#issuecomment-6522836404",
     "id": "c:6522836404",
     "at": "2026-10-30",
     "status_at": "2026-10-31",
     "status_by": "hebasto",
     "resolution_evidence": "2026-10-31: hebasto: 'I was able to reproduce the issue using a longer delay on another machine of mine, running Fedora 44.'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "hebasto",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "scope",
     "harm": "",
     "request": "drop the first commit if the second commit already fixes all failures",
     "question": "",
     "text": "drop the first commit if the second commit already fixes all failures",
     "clears_with": "answer",
     "blocking": false,
     "status": "answered",
     "status_note": "author explained the first commit was meant as a hardening refactor and also fixes other tests",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "c:6561772062"
     ],
     "evidence": "2026-10-31: 'The second commit fixes all of them. So is the first commit needed at all?'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36618#issuecomment-6545513372",
     "id": "c:6545513372",
     "at": "2026-10-31",
     "status_at": "2026-11-01",
     "status_by": "maflcko",
     "resolution_evidence": "2026-11-01: maflcko: 'it was meant as a hardening refactor'",
     "pin": null,
     "from_schema": 2
    }
   ],
   "support": [
    {
     "reviewer": "ViniciusCestarii",
     "reason": "I like how cleaner it is. I also measured performance but saw no significant change.",
     "substantive": true,
     "verdict": "Concept ACK",
     "id": "r:5701332641",
     "url": "https://github.com/bitcoin/bitcoin/pull/36618#pullrequestreview-5701332641",
     "at": "2026-10-29",
     "association": "CONTRIBUTOR",
     "evidence": "both",
     "areas": []
    },
    {
     "reviewer": "ViniciusCestarii",
     "reason": "",
     "substantive": false,
     "verdict": "ACK",
     "id": "r:5711794977",
     "url": "https://github.com/bitcoin/bitcoin/pull/36618#pullrequestreview-5711794977",
     "at": "2026-10-30",
     "association": "CONTRIBUTOR",
     "evidence": "none",
     "areas": []
    }
   ],
   "participants": [
    {
     "login": "ViniciusCestarii",
     "stance": "support",
     "note": "Concept ACK and full ACK after author clarified feature_index_prune test behavior",
     "association": "CONTRIBUTOR",
     "comments": 4,
     "first": "2026-10-29",
     "last": "2026-10-30"
    },
    {
     "login": "hebasto",
     "stance": "question",
     "note": "confirmed reproducer works and asked whether the first commit is needed",
     "association": "MEMBER",
     "comments": 2,
     "first": "2026-10-30",
     "last": "2026-10-31"
    }
   ],
   "derivation": "substantive support, no open objection (ViniciusCestarii)",
   "model_state": null,
   "corrections": [],
   "notes": "Claim c:6545513372 moved to answered after author maflcko explained the purpose of the first commit in c:6561772062."
  },
  "dependencies": {
   "depends_on": [],
   "enables": []
  },
  "categories": [
   {
    "name": "indexes",
    "member": false,
    "evidence": "Changes to index test scripts are mechanical deletions of manual wait helpers following from the test framework change.",
    "band": "Unranked",
    "reason_tag": "cleanup",
    "score": 0.0,
    "factors": {
     "bug_severity": 1,
     "leverage": 1,
     "performance": 0,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Does not touch `src/index/` or modify index functionality, only adjusting test framework synchronization defaults."
   },
   {
    "name": "mempool",
    "member": false,
    "evidence": "Touch to `mempool_accept.py` is a two-line deletion of redundant index sync calls following from the framework change.",
    "band": "Unranked",
    "reason_tag": "cleanup",
    "score": 0.0,
    "factors": {
     "bug_severity": 1,
     "leverage": 1,
     "performance": 0,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Does not alter mempool policy or mempool data structures."
   },
   {
    "name": "rpc",
    "member": false,
    "evidence": "Edits to various `rpc_*.py` files are mechanical removals of manual index wait calls.",
    "band": "Unranked",
    "reason_tag": "cleanup",
    "score": 0.0,
    "factors": {
     "bug_severity": 1,
     "leverage": 1,
     "performance": 0,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Does not change any RPC interfaces, behavior, or RPC subsystem code."
   },
   {
    "name": "tests",
    "member": true,
    "evidence": "Labeled 'Tests' and updates `test_framework.py` and `test_node.py` to wait for enabled background indices by default.",
    "band": "P2",
    "reason_tag": "bug fix",
    "score": 0.62,
    "factors": {
     "bug_severity": 1,
     "leverage": 1,
     "performance": 0,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Addresses intermittent test flakiness caused by races between background indices and test RPC/wallet operations (#36564). Centralizing index synchronization into `sync_all()` and node startup eliminates redundant boilerplate while directly targeting test harness reliability."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-11-02T01:11:29+00:00",
  "code": "2026-10-25T01:16:05+00:00",
  "judgments": 4
 }
}