{
 "number": 36696,
 "input_hash": "579f7b7b08ccb53f",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-10-31T01:18:28+00:00",
 "result": {
  "summary": "Adds a constructor to CTransaction that accepts input ranges of CTxIn and CTxOut, and extends CTxIn constructors with an optional script witness parameter. It introduces RangeOf and ToVector helpers in util/vector.h, and demonstrates declarative transaction construction in sigopcount_tests.",
  "problem": "Creating an immutable CTransaction currently requires initializing and modifying an intermediate CMutableTransaction, which adds boilerplate code when constructing test fixtures.",
  "card": "CTransaction gains a constructor taking generic ranges of inputs and outputs directly, and CTxIn constructors gain an optional script witness parameter. This allows declarative construction of immutable transactions without round-tripping through CMutableTransaction. The change is part of tracking issue #36692 and provides constructor primitives used by test cleanups like #36694.",
  "evidence": [
   "Part of #36692 (Declarative construction of test data) and referenced by #36694 (test, bench: construct mempool inputs/outputs declaratively)"
  ],
  "scope_notes": "",
  "changed_since_previous": "Diff is now available, showing changes isolated to transaction primitives, vector utility helpers, and sigopcount_tests.",
  "thread": {
   "last_event_at": "2026-10-30T09:27:20Z",
   "events": 10,
   "head_sha": "705d5d573774033b7cff5f45f602fdb40850866b",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [
   {
    "at": "2026-10-30",
    "id": "c:6518387886",
    "on": "reviewer",
    "url": "https://github.com/bitcoin/bitcoin/pull/36696#issuecomment-6518387886",
    "what": "review of the pushed fix and updated example commits"
   }
  ],
  "risk": {
   "level": "medium",
   "touches": [
    "consensus"
   ],
   "why": "Touches core transaction primitive constructors and hash computations; flawed construction logic or invariant breakage could corrupt transaction data or hashing."
  },
  "discussion": {
   "author_status": "last statement processed 2026-10-30",
   "open_concerns": [],
   "resolved_concerns": [
    "maflcko: Prefer simpler C++11 std::vector over generic ranges (accepted by maflcko 2026-10-30)",
    "alexanderwiederin: Copy instead of moving elements for views so std::span does not move elements out (fixed by purpleKarrot 2026-10-30)",
    "alexanderwiederin: Should the CTransaction constructor taking inputs and outputs be marked explicit? (answered by purpleKarrot 2026-10-29)"
   ]
  },
  "reviewability": {
   "state": "Ready",
   "label": "Ready",
   "reason": "Nothing known that would invalidate a review now."
  },
  "agreement": {
   "state": "Strong",
   "summary": "Strong: substantive support, no open objection (alexanderwiederin)",
   "reason": "purpleKarrot pushed a fix for alexanderwiederin's objection to avoid moving elements out of spans, moving only when the range yields rvalues. maflcko expanded on init-list formatting but reiterated leaving the decision to other reviewers.",
   "evidence": [
    "alexanderwiederin: support \u2014 The CTxIn witness argument is a nice addition that removes workarounds needed in #36606 and #36694"
   ],
   "objections": [
    {
     "reviewer": "maflcko",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "approach",
     "harm": "",
     "request": "Prefer simpler C++11 std::vector over generic ranges",
     "question": "",
     "text": "Prefer simpler C++11 std::vector over generic ranges",
     "clears_with": "answer",
     "blocking": false,
     "status": "accepted",
     "status_note": "maflcko discussed init-list formatting but reiterated leaving the decision to other reviewers",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "rc:4416531182"
     ],
     "evidence": "2026-10-29: 'nit: I'd still prefer the easier C++11 std::vector here (https://github.com/bitcoin/bitcoin/issues/36692#issuecomment-6501722895) but I'll leave it to other reviewers to decide.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36696#discussion_r4415029088",
     "id": "rc:4415029088",
     "at": "2026-10-29",
     "status_at": "2026-10-30",
     "status_by": "maflcko",
     "resolution_evidence": "2026-10-30: maflcko: 'But again, up to other reviewers to pick the side here :sweat_smile:'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "alexanderwiederin",
     "association": "MEMBER",
     "type": "objection",
     "kind": "correctness",
     "harm": "Copy instead of moving elements for views so std::span does not move elements out",
     "request": "",
     "question": "",
     "text": "Copy instead of moving elements for views so std::span does not move elements out",
     "clears_with": "change",
     "blocking": true,
     "status": "fixed",
     "status_note": "author pushed a fix moving only when range yields rvalues",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": true,
     "replies": [
      "rc:4416890613",
      "rc:4421462027"
     ],
     "evidence": "2026-10-29: 'I think std::span{inputs} would still move the elements out of inputs. Copying for views avoids that. What do you think?'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36696#discussion_r4416451512",
     "id": "rc:4416451512",
     "at": "2026-10-29",
     "status_at": "2026-10-30",
     "status_by": "purpleKarrot",
     "resolution_evidence": "2026-10-30: purpleKarrot: 'Fixed it. Instead of moving when `R` is an rvalue, we want to move when R *yields* rvalues.'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "alexanderwiederin",
     "association": "MEMBER",
     "type": "question",
     "kind": "interface",
     "harm": "",
     "request": "",
     "question": "Should the CTransaction constructor taking inputs and outputs be marked explicit?",
     "text": "Should the CTransaction constructor taking inputs and outputs be marked explicit?",
     "clears_with": "answer",
     "blocking": false,
     "status": "answered",
     "status_note": "purpleKarrot explained that implicit conversion cannot happen with two required arguments",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "rc:4416898958"
     ],
     "evidence": "2026-10-29: 'Should this be explicit like the existing ones?'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36696#discussion_r4416488577",
     "id": "rc:4416488577",
     "at": "2026-10-29",
     "status_at": "2026-10-29",
     "status_by": "purpleKarrot",
     "resolution_evidence": "2026-10-29: purpleKarrot: 'Implicit conversion cannot happen because the constructor requires at least two arguments.'",
     "pin": null,
     "from_schema": 2
    }
   ],
   "support": [
    {
     "reviewer": "alexanderwiederin",
     "reason": "The CTxIn witness argument is a nice addition that removes workarounds needed in #36606 and #36694",
     "substantive": true,
     "verdict": "",
     "id": "r:5703110328",
     "url": "https://github.com/bitcoin/bitcoin/pull/36696#pullrequestreview-5703110328",
     "at": "2026-10-29",
     "association": "MEMBER",
     "evidence": "read",
     "areas": [
      "CTxIn"
     ]
    }
   ],
   "participants": [
    {
     "login": "alexanderwiederin",
     "stance": "objection",
     "note": "supported CTxIn witness addition, asked if constructor should be explicit, and objected that passing span moves elements out of inputs",
     "association": "MEMBER",
     "comments": 3,
     "first": "2026-10-29",
     "last": "2026-10-29"
    },
    {
     "login": "maflcko",
     "stance": "neutral",
     "note": "suggested C++11 std::vector over ranges but left decision to other reviewers",
     "association": "MEMBER",
     "comments": 2,
     "first": "2026-10-29",
     "last": "2026-10-30"
    }
   ],
   "derivation": "substantive support, no open objection (alexanderwiederin)",
   "model_state": null,
   "corrections": [],
   "notes": "purpleKarrot pushed a fix for alexanderwiederin's objection to avoid moving elements out of spans, moving only when the range yields rvalues. maflcko expanded on init-list formatting but reiterated leaving the decision to other reviewers."
  },
  "dependencies": {
   "depends_on": [],
   "enables": [
    "#36694"
   ]
  },
  "categories": [
   {
    "name": "utils",
    "member": true,
    "evidence": "Adds general-purpose RangeOf and ToVector range-handling helper templates in src/util/vector.h.",
    "band": "P4",
    "reason_tag": "cleanup",
    "score": 0.2,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 0,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "The PR adds small container conversion helpers to support declarative construction of transactions. It cleans up minor boilerplate without addressing any broader architectural burden or safety issue in the utilities library."
   },
   {
    "name": "validation",
    "member": false,
    "evidence": "Changes src/primitives/transaction.{h,cpp} to add convenience constructors, without altering validation logic or consensus rules.",
    "band": "Unranked",
    "reason_tag": "cleanup",
    "score": 0.0,
    "factors": {
     "bug_severity": 0,
     "leverage": 1,
     "performance": 0,
     "security_stability": 0,
     "user_value": 0
    },
    "rationale": "Adding convenience constructors to transaction primitive structs does not alter validation rules, invariants, or chainstate behavior."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-10-31T01:18:28+00:00",
  "code": "2026-10-31T01:19:59+00:00",
  "judgments": 2
 }
}