{
 "number": 36496,
 "input_hash": "dc4e59a75fbb87af",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-10-24T01:16:52+00:00",
 "result": {
  "summary": "Persists and reuses heap storage across blocks in CoinsViewOverlay during parallel prevout prefetching. It keeps the intra-block transaction ID hash set and worker task vector alive across blocks, skips inserting the final transaction ID into the filter, and caps dispatched worker tasks to the queued input count while skipping condition variable notification on empty task lists.",
  "problem": "CoinsViewOverlay::StartFetching reallocates and reseeds an unordered_set of transaction IDs and reallocates a task vector for every block connected. It also inserts the block's final transaction ID even though no subsequent transaction can spend it, and it schedules more worker tasks than available inputs when input queues are small.",
  "card": "Reduces per-block allocation overhead in CoinsViewOverlay during parallel prevout prefetching. It reuses the intra-block transaction ID filter and worker task vector across blocks, omits the block's final transaction ID from the filter, and caps worker tasks to the queued input count. No performance benchmarks are provided to measure the impact of the avoided allocations.",
  "evidence": [
   "No benchmark numbers or profiling traces are included in the PR description or commit messages to substantiate the performance impact of these allocation savings."
  ],
  "scope_notes": "",
  "changed_since_previous": "Replaced the previous modification of ThreadPool::Submit parameter types with moving the persistent task vector directly, and added a check in ThreadPool::Submit to skip condition variable notification when the submitted futures list is empty.",
  "thread": {
   "last_event_at": "2026-10-22T11:46:30Z",
   "events": 10,
   "head_sha": "0977948b35524130ac972efa1c8bf3c35d7d7b85",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [
   {
    "at": "2026-10-22",
    "id": "rc:4347916622",
    "on": "author",
    "url": "https://github.com/bitcoin/bitcoin/pull/36496#discussion_r4347916622",
    "what": "response to hodlinator's suggestion to check m_inputs.size() before logging warning"
   }
  ],
  "risk": {
   "level": "medium",
   "touches": [
    "validation"
   ],
   "why": "A mistake in tracking earlier intra-block transaction IDs or prefetch task execution could lead to missing or incorrect prevout prefetching during block connection."
  },
  "discussion": {
   "author_status": "last statement processed 2026-10-22",
   "open_concerns": [
    "hodlinator: Bring back the m_inputs.size() check to avoid logging a weird warning when m_tasks is empty"
   ],
   "resolved_concerns": [
    "hodlinator: Allow non-const l-values to be passed into ThreadPool::Submit() and remove std::move(m_tasks) (fixed by l0rinc 2026-10-15)",
    "hodlinator: Revert the suggestion allowing non-const l-values in ThreadPool::Submit and instead add an Assume on m_tasks capacity (accepted by hodlinator 2026-10-22)"
   ]
  },
  "reviewability": {
   "state": "Paused",
   "label": "Waiting on author",
   "reason": "Open objection from hodlinator with no author reply for 10 days; review would repeat what has been asked."
  },
  "agreement": {
   "state": "Positive",
   "summary": "Positive: support without stated reasons, no open objection (hodlinator, andrewtoth, andrewtoth)",
   "reason": "hodlinator suggested reverting their earlier ThreadPool modification and adding an Assume check; author reverted the ThreadPool changes and hodlinator dropped the Assume request. hodlinator also raised an open suggestion to check m_inputs.size() to avoid an odd warning message on empty tasks.",
   "evidence": [
    "hodlinator (suggestion, interface, must be answered, open): Bring back the m_inputs.size() check to avoid logging a weird warning when m_tasks is empty",
    "hodlinator: Concept ACK",
    "andrewtoth: ACK",
    "andrewtoth: ACK"
   ],
   "objections": [
    {
     "reviewer": "hodlinator",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "interface",
     "harm": "",
     "request": "Allow non-const l-values to be passed into ThreadPool::Submit() and remove std::move(m_tasks)",
     "question": "",
     "text": "Allow non-const l-values to be passed into ThreadPool::Submit() and remove std::move(m_tasks)",
     "clears_with": "answer",
     "blocking": false,
     "status": "fixed",
     "status_note": "author implemented the suggestion, credited hodlinator as co-author, and handled empty tasks internally",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": true,
     "replies": [
      "rc:4280049366"
     ],
     "evidence": "2026-10-13: 'It would probably be more honest/correct to allow non-const l-values to be passed into Submit() and remove the move() here.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36496#discussion_r4257097025",
     "id": "rc:4257097025",
     "at": "2026-10-13",
     "status_at": "2026-10-15",
     "status_by": "l0rinc",
     "resolution_evidence": "2026-10-15: l0rinc: 'Thanks, added you as coauthor and also handled the empty tasks internally'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "hodlinator",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "approach",
     "harm": "",
     "request": "Revert the suggestion allowing non-const l-values in ThreadPool::Submit and instead add an Assume on m_tasks capacity",
     "question": "",
     "text": "Revert the suggestion allowing non-const l-values in ThreadPool::Submit and instead add an Assume on m_tasks capacity",
     "clears_with": "answer",
     "blocking": false,
     "status": "accepted",
     "status_note": "author reverted the ThreadPool change and explained why the Assume was unnecessary; hodlinator dropped the request",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": true,
     "replies": [
      "rc:4347226109"
     ],
     "evidence": "2026-10-22: 'it may be safer to revert my suggestion and instead opt for adding `Assume(m_tasks.capacity() >= std::min(workers_count, m_inputs.size()))` with an explanatory comment'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36496#discussion_r4345793434",
     "id": "rc:4345793434",
     "at": "2026-10-22",
     "status_at": "2026-10-22",
     "status_by": "hodlinator",
     "resolution_evidence": "2026-10-22: hodlinator: 'Not going to insist again though.'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "hodlinator",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "interface",
     "harm": "",
     "request": "Bring back the m_inputs.size() check to avoid logging a weird warning when m_tasks is empty",
     "question": "",
     "text": "Bring back the m_inputs.size() check to avoid logging a weird warning when m_tasks is empty",
     "clears_with": "answer",
     "blocking": false,
     "status": "open",
     "status_note": "",
     "cleared": false,
     "author_replied": false,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [],
     "evidence": "2026-10-22: 'How about bringing the `m_inputs.size()` check back for that?'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36496#discussion_r4347916622",
     "id": "rc:4347916622",
     "at": "2026-10-22",
     "status_at": null,
     "status_by": null,
     "resolution_evidence": "",
     "pin": null,
     "from_schema": 2
    }
   ],
   "support": [
    {
     "reviewer": "hodlinator",
     "reason": "",
     "substantive": false,
     "verdict": "Concept ACK",
     "id": "r:5501669620",
     "url": "https://github.com/bitcoin/bitcoin/pull/36496#pullrequestreview-5501669620",
     "at": "2026-10-13",
     "association": "MEMBER",
     "evidence": "none",
     "areas": []
    },
    {
     "reviewer": "andrewtoth",
     "reason": "",
     "substantive": false,
     "verdict": "ACK",
     "id": "c:6184363683",
     "url": "https://github.com/bitcoin/bitcoin/pull/36496#issuecomment-6184363683",
     "at": "2026-10-15",
     "association": "MEMBER",
     "evidence": "none",
     "areas": []
    },
    {
     "reviewer": "andrewtoth",
     "reason": "",
     "substantive": false,
     "verdict": "ACK",
     "id": "r:5578945452",
     "url": "https://github.com/bitcoin/bitcoin/pull/36496#pullrequestreview-5578945452",
     "at": "2026-10-19",
     "association": "MEMBER",
     "evidence": "none",
     "areas": []
    }
   ],
   "participants": [
    {
     "login": "hodlinator",
     "stance": "support",
     "note": "Concept ACK; suggested reverting ThreadPool changes and suggested avoiding weird warning when m_tasks is empty",
     "association": "MEMBER",
     "comments": 6,
     "first": "2026-10-13",
     "last": "2026-10-22"
    },
    {
     "login": "andrewtoth",
     "stance": "support",
     "note": "ACKed earlier commit and reACKed latest commit",
     "association": "MEMBER",
     "comments": 2,
     "first": "2026-10-15",
     "last": "2026-10-19"
    }
   ],
   "derivation": "support without stated reasons, no open objection (hodlinator, andrewtoth, andrewtoth)",
   "model_state": null,
   "corrections": [],
   "notes": "hodlinator suggested reverting their earlier ThreadPool modification and adding an Assume check; author reverted the ThreadPool changes and hodlinator dropped the Assume request. hodlinator also raised an open suggestion to check m_inputs.size() to avoid an odd warning message on empty tasks."
  },
  "dependencies": {
   "depends_on": [],
   "enables": []
  },
  "categories": [
   {
    "name": "utils",
    "member": false,
    "evidence": "Touches src/util/threadpool.h for only one line incidental to the coins prefetching optimization.",
    "band": "Unranked",
    "reason_tag": "cleanup",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 0,
     "performance": 1,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Incidental one-line change to utility code following from changes in coins.cpp does not make it a member of utils."
   },
   {
    "name": "validation",
    "member": true,
    "evidence": "Labeled 'UTXO Db and Indexes' and modifies coins prefetching and cache management in src/coins.cpp and src/coins.h.",
    "band": "P4",
    "reason_tag": "speedup",
    "score": 0.15,
    "factors": {
     "bug_severity": 0,
     "leverage": 0,
     "performance": 1,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Avoids redundant heap allocations and task dispatches in CoinsViewOverlay across blocks during prevout prefetching. Per the description, 'no benchmark numbers or profiling traces are included in the PR description or commit messages to substantiate the performance impact', making it an unmeasured micro-optimization."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-10-24T01:16:52+00:00",
  "code": "2026-10-24T01:21:23+00:00",
  "judgments": 2
 }
}