{
 "number": 36475,
 "input_hash": "714ab4a9d8bd55a2",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-10-22T01:16:23+00:00",
 "result": {
  "summary": "Adds microbenchmarks for BIP-352 Silent Payments public key extraction (bip352::GetPubKeyFromInput) to bench_bitcoin. The suite tests standard input types\u2014P2PKH, P2SH-P2WPKH, P2WPKH, and P2TR script-path spend\u2014as well as a worst-case malleated P2PKH scriptSig designed to maximize hash iterations under consensus limits.",
  "problem": "Silent Payments input parsing and key extraction logic has seen bug fixes and ongoing adjustments without dedicated benchmarks to evaluate execution overhead or protect against performance regressions.",
  "card": "Adds microbenchmarks for BIP-352 Silent Payments public key extraction (bip352::GetPubKeyFromInput) to bench_bitcoin. The benchmarks evaluate standard spend types (P2PKH, P2SH-P2WPKH, P2WPKH, P2TR script-path) along with an adversarial worst-case malleated P2PKH scriptSig. Benchmark numbers in the description demonstrate a 23x performance penalty under worst-case inputs, establishing a baseline to track performance across related Silent Payments PRs like #36338 and #36417.",
  "evidence": [
   "The PR author notes ongoing updates to GetPubKeyFromInput in recently merged #36338 and open #36417.",
   "Benchmark figures from the description show that standard input extraction runs in ~2.8 to 3.0 \u00b5s, whereas the worst-case malleated P2PKH input takes ~69.9 \u00b5s (a ~23x slowdown)."
  ],
  "scope_notes": "Adds benchmark code only; introduces no production logic changes.",
  "changed_since_previous": "Updated the P2TR benchmark input from a key-path spend to a script-path spend to exercise control block checking and NUMS-H internal key comparisons.",
  "thread": {
   "last_event_at": "2026-10-21T07:37:23Z",
   "events": 5,
   "head_sha": "56c0f168d1a81b19e4cd71ef81e7ce2d9c1624e3",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [
   {
    "at": "2026-10-09",
    "id": "c:6073283486",
    "on": "author",
    "url": "https://github.com/bitcoin/bitcoin/pull/36475#issuecomment-6073283486",
    "what": "response to Yudis-bit's suggestion regarding hoisting pubkey_candidate"
   }
  ],
  "risk": {
   "level": "low",
   "touches": [
    "tests"
   ],
   "why": "Only introduces standalone microbenchmarks in bench_bitcoin and touches no node or consensus code."
  },
  "discussion": {
   "author_status": "last statement processed 2026-10-21",
   "open_concerns": [
    "Yudis-bit: hoist pubkey_candidate outside the while loop in GetPubKeyFromInput to save heap reallocations across dummy pushes"
   ],
   "resolved_concerns": [
    "Yudis-bit: add P2TR_ScriptPath and P2TR_ScriptPath_NUMS benchmarks for control-block validation and early rejection (accepted by Yudis-bit 2026-10-17)"
   ]
  },
  "reviewability": {
   "state": "Paused",
   "label": "Waiting on author",
   "reason": "Open objection from Yudis-bit with no author reply for 11 days; review would repeat what has been asked."
  },
  "agreement": {
   "state": "Strong",
   "summary": "Strong: substantive support, no open objection (Yudis-bit, Yudis-bit, fametrano)",
   "reason": "Added fametrano's Tested ACK (c:6310687100) with benchmark results on Apple M5 and independent verification using btclib-wallet.",
   "evidence": [
    "Yudis-bit (suggestion, approach, must be answered, open): hoist pubkey_candidate outside the while loop in GetPubKeyFromInput to save heap reallocations across dummy pushes",
    "w0xlt: Concept ACK",
    "Yudis-bit: Approach ACK \u2014 Numbers make sense given that `IsFullyValid()` point validation dominates the standard paths.",
    "Yudis-bit: Tested ACK \u2014 Tested benchmarks on Windows and agreed with sticking to a single P2TR case",
    "fametrano: Tested ACK \u2014 The five benchmarks build and run on Apple M5, and rebuilt input shapes independently verified against btclib-wallet"
   ],
   "objections": [
    {
     "reviewer": "Yudis-bit",
     "association": "NONE",
     "type": "suggestion",
     "kind": "approach",
     "harm": "",
     "request": "hoist pubkey_candidate outside the while loop in GetPubKeyFromInput to save heap reallocations across dummy pushes",
     "question": "",
     "text": "hoist pubkey_candidate outside the while loop in GetPubKeyFromInput to save heap reallocations across dummy pushes",
     "clears_with": "answer",
     "blocking": false,
     "status": "open",
     "status_note": "no author reply",
     "cleared": false,
     "author_replied": false,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [],
     "evidence": "2026-10-09: 'hoisting `pubkey_candidate` outside the while loop in `GetPubKeyFromInput` would save ~290 heap reallocations across the dummy pushes'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36475#issuecomment-6073283486",
     "id": "c:6073283486",
     "at": "2026-10-09",
     "status_at": null,
     "status_by": null,
     "resolution_evidence": "",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "Yudis-bit",
     "association": "NONE",
     "type": "suggestion",
     "kind": "scope",
     "harm": "",
     "request": "add P2TR_ScriptPath and P2TR_ScriptPath_NUMS benchmarks for control-block validation and early rejection",
     "question": "",
     "text": "add P2TR_ScriptPath and P2TR_ScriptPath_NUMS benchmarks for control-block validation and early rejection",
     "clears_with": "answer",
     "blocking": false,
     "status": "accepted",
     "status_note": "reviewer accepted author's rationale for sticking to a single representative P2TR benchmark",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "c:6100051112"
     ],
     "evidence": "2026-10-09: 'It might also be worth adding `P2TR_ScriptPath` and `P2TR_ScriptPath_NUMS` to benchmark the control-block validation and the early rejection path.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36475#issuecomment-6073283486",
     "id": "c:6073283486#2",
     "at": "2026-10-09",
     "status_at": "2026-10-17",
     "status_by": "Yudis-bit",
     "resolution_evidence": "2026-10-17: Yudis-bit: 'Makes sense to stick to one P2TR case.'",
     "pin": null,
     "from_schema": 2
    }
   ],
   "support": [
    {
     "reviewer": "w0xlt",
     "reason": "",
     "substantive": false,
     "verdict": "Concept ACK",
     "id": "c:6065831573",
     "url": "https://github.com/bitcoin/bitcoin/pull/36475#issuecomment-6065831573",
     "at": "2026-10-08",
     "association": "CONTRIBUTOR",
     "evidence": "none",
     "areas": []
    },
    {
     "reviewer": "Yudis-bit",
     "reason": "Numbers make sense given that `IsFullyValid()` point validation dominates the standard paths.",
     "substantive": true,
     "verdict": "Approach ACK",
     "id": "c:6073283486",
     "url": "https://github.com/bitcoin/bitcoin/pull/36475#issuecomment-6073283486",
     "at": "2026-10-09",
     "association": "NONE",
     "evidence": "read",
     "areas": []
    },
    {
     "reviewer": "Yudis-bit",
     "reason": "Tested benchmarks on Windows and agreed with sticking to a single P2TR case",
     "substantive": true,
     "verdict": "Tested ACK",
     "id": "c:6233551410",
     "url": "https://github.com/bitcoin/bitcoin/pull/36475#issuecomment-6233551410",
     "at": "2026-10-17",
     "association": "NONE",
     "evidence": "tested",
     "areas": []
    },
    {
     "reviewer": "fametrano",
     "reason": "The five benchmarks build and run on Apple M5, and rebuilt input shapes independently verified against btclib-wallet",
     "substantive": true,
     "verdict": "Tested ACK",
     "id": "c:6310687100",
     "url": "https://github.com/bitcoin/bitcoin/pull/36475#issuecomment-6310687100",
     "at": "2026-10-21",
     "association": "CONTRIBUTOR",
     "evidence": "both",
     "areas": []
    }
   ],
   "participants": [
    {
     "login": "w0xlt",
     "stance": "support",
     "note": "Concept ACK",
     "association": "CONTRIBUTOR",
     "comments": 1,
     "first": "2026-10-08",
     "last": "2026-10-08"
    },
    {
     "login": "Yudis-bit",
     "stance": "support",
     "note": "Approach ACK, then Tested ACK after author answered suggestion on P2TR benchmark scope",
     "association": "NONE",
     "comments": 2,
     "first": "2026-10-09",
     "last": "2026-10-17"
    },
    {
     "login": "fametrano",
     "stance": "support",
     "note": "Tested ACK with benchmark results on Apple M5 and independent verification of input shapes",
     "association": "CONTRIBUTOR",
     "comments": 1,
     "first": "2026-10-21",
     "last": "2026-10-21"
    }
   ],
   "derivation": "substantive support, no open objection (Yudis-bit, Yudis-bit, fametrano)",
   "model_state": null,
   "corrections": [],
   "notes": "Added fametrano's Tested ACK (c:6310687100) with benchmark results on Apple M5 and independent verification using btclib-wallet."
  },
  "dependencies": {
   "depends_on": [],
   "enables": []
  },
  "categories": [
   {
    "name": "tests",
    "member": true,
    "evidence": "Matches the Tests label and adds benchmark coverage in src/bench/bip352.cpp and src/bench/CMakeLists.txt, which is explicitly covered under test infrastructure.",
    "band": "P3",
    "reason_tag": "test coverage",
    "score": 0.35,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 1,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Adds microbenchmarks to track execution overhead and protect against performance regressions in BIP-352 input extraction logic. The benchmarks cover standard input parsing and highlight a worst-case malleated P2PKH path with ~23x slowdown during ongoing logic updates."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-10-22T01:16:23+00:00",
  "code": "2026-10-12T01:24:00+00:00",
  "judgments": 1
 }
}