{
 "number": 36480,
 "input_hash": "36169e4bf5b15e32",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-10-24T01:18:04+00:00",
 "result": {
  "summary": "Adapts txospenderindex to use the compact on-disk key format introduced for txindex in PR #35531. Key entries are shortened by replacing raw disk transaction positions with block sequence numbers and a 5-byte salted hash prefix of the spent outpoint. Common block-sequence tracking and sync locator logic are factored out into shared index utilities.",
  "problem": "Each txospenderindex entry consumes roughly 18 bytes on disk using 8-byte SipHash-2-4 keys and raw disk file positions (CDiskTxPos), leading to larger disk usage and preventing the index from easily referencing blocks instead of local files (a prerequisite for pruned-mode support).",
  "card": "Adopts the compact on-disk key scheme from txindex (#35531) for txospenderindex, reducing per-entry key size by approximately 33% (from 18 to 12 bytes). Replacing file-based disk positions with block sequence numbers also prepares txospenderindex to eventually support pruned mode. The change refactors shared block-sequencing helpers out of txindex, handles hash prefix collisions by filtering candidates against the active chain, and supports reading legacy index entries.",
  "evidence": [
   "PR description: 'Each entry is about 33% smaller (key bytes): before: 's' (1) + SipHash-2-4 of the outpoint (8) + CDiskTxPos, as varints nFile (2) + nPos (4) + nTxOffset (3) = 18 bytes; after: 'x' (1) + SipHash-1-3-UJ prefix (5) + block sequence varint (3) + tx offset (3) = 12 bytes'",
   "PR description: 'The motivation is to save space and to allow replicating what #36002 does for txindex, by referencing blocks instead of local files.'"
  ],
  "scope_notes": "Extracts block sequence and locator utilities out of txindex into new files src/index/block_seq.{h,cpp} and src/index/base.{h,cpp} before updating txospenderindex.",
  "changed_since_previous": "",
  "thread": {
   "last_event_at": "2026-10-23T17:25:24Z",
   "events": 7,
   "head_sha": "fadf210822d84dcf278c6d6897c67e189a3c0065",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [
   {
    "at": null,
    "id": "",
    "on": "nothing",
    "url": null,
    "what": "no items pending"
   }
  ],
  "risk": {
   "level": "medium",
   "touches": [
    "rpc_api",
    "other"
   ],
   "why": "Bugs in index migration, serialization, or active-chain filtering could cause gettxspendingprevout to return incorrect spending data or corrupt the spender index DB."
  },
  "discussion": {
   "author_status": "last statement processed 2026-10-23",
   "open_concerns": [],
   "resolved_concerns": [
    "andrewtoth: Enable pruning in txospenderindex in this PR alongside the key changes, similar to #36002. (accepted by andrewtoth 2026-10-08)"
   ]
  },
  "reviewability": {
   "state": "Ready",
   "label": "CI failing",
   "reason": "CI is red; check whether the failure is the PR's before a deep review."
  },
  "agreement": {
   "state": "Strong",
   "summary": "Strong: substantive support, no open objection (andrewtoth)",
   "reason": "Added Concept ACK from sedited.",
   "evidence": [
    "andrewtoth: Concept ACK \u2014 Previous experiments showed database size reduced from ~84GB to ~62GB and indexing time was much lower",
    "l0rinc: Concept ACK \u2014 supports pruning support and merging #36002 first",
    "w0xlt: Concept ACK",
    "sedited: Concept ACK"
   ],
   "objections": [
    {
     "reviewer": "andrewtoth",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "scope",
     "harm": "",
     "request": "Enable pruning in txospenderindex in this PR alongside the key changes, similar to #36002.",
     "question": "",
     "text": "Enable pruning in txospenderindex in this PR alongside the key changes, similar to #36002.",
     "clears_with": "answer",
     "blocking": false,
     "status": "accepted",
     "status_note": "andrewtoth withdrew the suggestion in favor of waiting for #36002 to merge first",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "c:6068891650"
     ],
     "evidence": "2026-10-08: 'Do we want to also enable pruning in one go like we are with #36002? I don't think it would be controversial so we could do it all in 1 PR.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36480#issuecomment-6068799412",
     "id": "c:6068799412",
     "at": "2026-10-08",
     "status_at": "2026-10-08",
     "status_by": "andrewtoth",
     "resolution_evidence": "2026-10-08: andrewtoth: 'On second thought, if we merge #36002 first we can reuse the TxLookupResult'",
     "pin": null,
     "from_schema": 2
    }
   ],
   "support": [
    {
     "reviewer": "andrewtoth",
     "reason": "Previous experiments showed database size reduced from ~84GB to ~62GB and indexing time was much lower",
     "substantive": true,
     "verdict": "Concept ACK",
     "id": "c:6068799412",
     "url": "https://github.com/bitcoin/bitcoin/pull/36480#issuecomment-6068799412",
     "at": "2026-10-08",
     "association": "MEMBER",
     "evidence": "tested",
     "areas": []
    },
    {
     "reviewer": "l0rinc",
     "reason": "supports pruning support and merging #36002 first",
     "substantive": false,
     "verdict": "Concept ACK",
     "id": "c:6075248071",
     "url": "https://github.com/bitcoin/bitcoin/pull/36480#issuecomment-6075248071",
     "at": "2026-10-09",
     "association": "MEMBER",
     "evidence": "none",
     "areas": []
    },
    {
     "reviewer": "w0xlt",
     "reason": "",
     "substantive": false,
     "verdict": "Concept ACK",
     "id": "c:6185688251",
     "url": "https://github.com/bitcoin/bitcoin/pull/36480#issuecomment-6185688251",
     "at": "2026-10-15",
     "association": "CONTRIBUTOR",
     "evidence": "none",
     "areas": []
    },
    {
     "reviewer": "sedited",
     "reason": "",
     "substantive": false,
     "verdict": "Concept ACK",
     "id": "c:6370740796",
     "url": "https://github.com/bitcoin/bitcoin/pull/36480#issuecomment-6370740796",
     "at": "2026-10-23",
     "association": "MEMBER",
     "evidence": "none",
     "areas": []
    }
   ],
   "participants": [
    {
     "login": "andrewtoth",
     "stance": "support",
     "note": "Concept ACK based on prior experiments; suggested bundling pruning before retracting the idea to wait for #36002",
     "association": "MEMBER",
     "comments": 2,
     "first": "2026-10-08",
     "last": "2026-10-08"
    },
    {
     "login": "l0rinc",
     "stance": "support",
     "note": "Concept ACK; favors pruning support and merging #36002 first",
     "association": "MEMBER",
     "comments": 1,
     "first": "2026-10-09",
     "last": "2026-10-09"
    },
    {
     "login": "w0xlt",
     "stance": "support",
     "note": "Concept ACK",
     "association": "CONTRIBUTOR",
     "comments": 1,
     "first": "2026-10-15",
     "last": "2026-10-15"
    },
    {
     "login": "sedited",
     "stance": "support",
     "note": "Concept ACK",
     "association": "MEMBER",
     "comments": 1,
     "first": "2026-10-23",
     "last": "2026-10-23"
    }
   ],
   "derivation": "substantive support, no open objection (andrewtoth)",
   "model_state": null,
   "corrections": [],
   "notes": "Added Concept ACK from sedited."
  },
  "dependencies": {
   "depends_on": [],
   "enables": [
    "#36002"
   ]
  },
  "categories": [
   {
    "name": "indexes",
    "member": true,
    "evidence": "Modifies src/index/txospenderindex.*, src/index/txindex.*, and introduces shared index sequence helpers in src/index/block_seq.*",
    "band": "P2",
    "reason_tag": "speedup",
    "score": 0.65,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 2,
     "security_stability": 0,
     "user_value": 2
    },
    "rationale": "Reduces txospenderindex entry sizes by 33%, dropping overall database size from ~84GB to ~62GB with noticeably faster indexing time. Reviewer notes confirm significant disk savings and performance improvements, while decoupling block indexing to facilitate pruned mode support."
   },
   {
    "name": "mempool",
    "member": false,
    "evidence": "Does not touch mempool data structures or transaction acceptance policy.",
    "band": "Unranked",
    "reason_tag": "",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 2,
     "security_stability": 0,
     "user_value": 1
    },
    "rationale": "The PR only modifies optional index code under src/index/."
   },
   {
    "name": "p2p",
    "member": false,
    "evidence": "Does not touch peer-to-peer networking or message handling.",
    "band": "Unranked",
    "reason_tag": "",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 2,
     "security_stability": 0,
     "user_value": 1
    },
    "rationale": "The PR only modifies optional index code under src/index/."
   },
   {
    "name": "rpc",
    "member": false,
    "evidence": "Touch to src/rpc/mempool.cpp is a minor internal adaptation to the updated index method signature rather than a change to RPC behavior or interface machinery.",
    "band": "Unranked",
    "reason_tag": "cleanup",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 2,
     "security_stability": 0,
     "user_value": 2
    },
    "rationale": "Not an RPC category change; the modification only adjusts an internal call to txospenderindex."
   },
   {
    "name": "tests",
    "member": false,
    "evidence": "Touch to test_runner.py merely registers the new txospenderindex functional test.",
    "band": "Unranked",
    "reason_tag": "test coverage",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 2,
     "security_stability": 0,
     "user_value": 2
    },
    "rationale": "The added tests validate txospenderindex compatibility specifically and do not alter the testing framework itself."
   },
   {
    "name": "utils",
    "member": false,
    "evidence": "Extracted utilities are index-specific (src/index/block_seq.h and BaseIndex::DB).",
    "band": "Unranked",
    "reason_tag": "",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 2,
     "security_stability": 0,
     "user_value": 1
    },
    "rationale": "The PR creates shared code specific to the index subsystem rather than shared general utilities across the node."
   },
   {
    "name": "validation",
    "member": false,
    "evidence": "Modifies optional indexes under src/index/, which are explicitly excluded from validation.",
    "band": "Unranked",
    "reason_tag": "",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 2,
     "security_stability": 0,
     "user_value": 1
    },
    "rationale": "The PR alters optional secondary indexes rather than core consensus, block storage, or UTXO database structures."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-10-24T01:18:04+00:00",
  "code": "2026-10-10T01:25:38+00:00",
  "judgments": 7
 }
}