{
 "number": 36184,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36184",
 "title": "test: fix TaprootSignatureMsg default codeseparator_pos",
 "author": "fametrano",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-09-07T18:06:42Z",
 "updated_at": "2026-09-17T08:05:13Z",
 "age_days": 9,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8",
 "head_ref": "test-tapsig-codesep-default",
 "head_repo": "fametrano/bitcoin",
 "head_history": [
  {
   "t": "2026-09-12T12:31:12Z",
   "sha": "ee3368976667aa58c68278ab7dcdd50cbe329424"
  },
  {
   "t": "2026-09-16T06:51:02Z",
   "sha": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8"
  }
 ],
 "additions": 1,
 "deletions": 1,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": []
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "maflcko"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-09-16T18:48:18Z",
  "last_reviewer_activity": "2026-09-17T08:05:12Z",
  "last_reviewer": "maflcko",
  "author_silent_days": 0,
  "waiting_on_author_days": 0,
  "days_since_update": 0
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "test/functional/test_framework/script.py"
 ],
 "body": "`TaprootSignatureMsg` defaults `codeseparator_pos` to `-1` and serializes it with `.to_bytes(4, \"little\", signed=False)`, so any `scriptpath=True` call that relies on the default raises `OverflowError`.\n\nThe unsigned encoding was added so callers could pass `0xfffffffe`/`0xffffffff`, and the call sites in `feature_taproot.py` were updated to default to `0xffffffff`; this default was left at `-1`. The only in-tree scriptpath caller passes `codeseparator_pos` explicitly, so CI does not hit it.\n\nSet the default to `0xFFFFFFFF`: the value `feature_taproot.py` uses for \"no codeseparator\", and the bytes the previous signed encoding produced for `-1`.",
 "commits": [
  {
   "sha": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8",
   "date": "2026-09-16T06:49:40Z",
   "message": "test: fix TaprootSignatureMsg default codeseparator_pos\n\nTaprootSignatureMsg defaults codeseparator_pos to -1 and serializes it\nwith .to_bytes(4, \"little\", signed=False), so any scriptpath=True call\nthat relies on the default raises OverflowError.\n\nThe unsigned encoding was added so callers could pass 0xfffffffe and\n0xffffffff, and the call sites in feature_taproot.py were updated to\ndefault to 0xffffffff, but this default was left at -1. Set it to\n0xFFFFFFFF: the same value feature_taproot.py uses for \"no\ncodeseparator\", and the bytes the previous signed encoding produced."
  }
 ],
 "timeline": [
  {
   "t": "2026-09-12T12:31:12Z",
   "kind": "force_push",
   "who": "fametrano",
   "commit": "ee3368976667aa58c68278ab7dcdd50cbe329424"
  },
  {
   "t": "2026-09-16T06:51:02Z",
   "kind": "force_push",
   "who": "fametrano",
   "commit": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8"
  },
  {
   "t": "2026-09-16T07:39:21Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "test/functional/test_framework/script.py",
   "commit": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8",
   "in_reply_to": null,
   "text": "Could be set to None, like leaf_script?"
  },
  {
   "t": "2026-09-16T18:48:18Z",
   "kind": "review_comment",
   "who": "fametrano",
   "assoc": "CONTRIBUTOR",
   "path": "test/functional/test_framework/script.py",
   "commit": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8",
   "in_reply_to": 4023603909,
   "text": "`0xFFFFFFFF` isn't a sentinel here, it's the BIP342 value for \"no codeseparator executed\", so it's the correct default as-is. `None` would need a branch back to `0xFFFFFFFF` before the `to_bytes` call, which doesn't buy anything."
  },
  {
   "t": "2026-09-17T08:05:12Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "test/functional/test_framework/script.py",
   "commit": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8",
   "in_reply_to": 4023603909,
   "text": "What I was trying to say is that there is no need to pass this value, if it isn't used. And if it is used, it seems better to write test code that is obvious and explicit.\n\n-1 or None achieve that by throwing a Python exception. Your suggestion of `0xFFFFFFFF` does not.\n\nMaybe I am blind, but I don't see the point of this pull request. My recommendation would be to use:\n\n* -1 (i.e. close this pull), or\n* use None.\n\nIf you think that 0xFFFFFFFF makes sense, it would be good to explain what real-world test scenario or dev experience you are trying to improve."
  }
 ],
 "labels_log": [
  {
   "t": "2026-09-07T18:06:46Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-07T19:06:31Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-12T13:31:31Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 2124,
 "text_tokens_estimate": 531,
 "changed_paths": [
  "test/functional/test_framework/script.py"
 ],
 "files": [
  {
   "path": "test/functional/test_framework/script.py",
   "add": 1,
   "del": 1
  }
 ],
 "test_lines": 2,
 "git": {
  "head": "8fdc55e52bb71df2037da232ec0f15a4b1e4a1f8",
  "head_matches_backup": true,
  "base": "57721f8074c2e8ccfe4c6d10114d4683dca58118",
  "commits": [
   {
    "sha": "8fdc55e52b",
    "subject": "test: fix TaprootSignatureMsg default codeseparator_pos",
    "files": 1,
    "add": 1,
    "del": 1
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "53a35f31e5482fe6",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}