{
 "number": 35835,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35835",
 "title": "test: add CONST_SCRIPTCODE failure-path vectors to script_tests.json",
 "author": "jeanpablojp",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-07-29T13:25:10Z",
 "updated_at": "2026-08-26T21:00:05Z",
 "age_days": 50,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "829e44a1151fa432f293554f25832f19bde209ec",
 "head_ref": "script-tests-const-scriptcode",
 "head_repo": "jeanpablojp/bitcoin",
 "head_history": [],
 "additions": 11,
 "deletions": 0,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "blocked",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "concept_ack": [
     {
      "login": "darosior",
      "url": "https://github.com/bitcoin/bitcoin/pull/35835#pullrequestreview-4847689160"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "darosior": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-08-03T19:05:55Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 1,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "darosior"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "blocked",
  "last_author_activity": "2026-08-03T20:37:42Z",
  "last_reviewer_activity": "2026-08-03T19:05:55Z",
  "last_reviewer": "darosior",
  "author_silent_days": 44,
  "waiting_on_author_days": 0,
  "days_since_update": 21
 },
 "refs": {
  "mentioned": [
   35664
  ],
  "depends_on": [
   35664
  ],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 35664,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-07-23",
    "title": "test: add CLTV and CHECK(MULTI)SIGVERIFY failure-path vectors to script_tests.json"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Follow-up to #35664.\n\nGoing through which script error codes `script_tests.json` covers, I found that neither error gated behind `SCRIPT_VERIFY_CONST_SCRIPTCODE` is asserted anywhere. `SCRIPT_ERR_SIG_FINDANDDELETE` is not asserted by any test; `SCRIPT_ERR_OP_CODESEPARATOR` appears only as a mempool reject string in `invalid_txs.py`, never at the script level. `tx_invalid.json` does have a `CONST_SCRIPTCODE` section, but those vectors can only say a transaction is invalid, not which error made it fail; `script_tests.json` is the harness that pins error codes, and it has no vector using the flag.\n\nThis adds six vectors. Four fail with the flag set:\n\n- `OP_CODESEPARATOR` in an executed pre-segwit script.\n- `OP_CODESEPARATOR` in an unexecuted `IF` branch. The check in `EvalScript` runs ahead of the `fExec` guard, so the opcode is rejected even though it never executes \u2014 the rule with no error-level coverage before.\n- A signature push that also appears in the scriptPubKey, against `CHECKSIG`.\n- The same against `CHECKMULTISIG`, which calls `FindAndDelete` in a separate loop.\n\nThe other two are controls with the flag off, one per error. Both checks run before signature verification, so the vectors can use a dummy signature.\n\nTo confirm the expected errors are the ones that fire, I added the vectors expecting `OK` first and let the harness report the actual error for each.\n\nTested with:\n\n```\nbuild/bin/test_bitcoin --run_test=script_tests/script_json_test\n```",
 "commits": [
  {
   "sha": "829e44a1151fa432f293554f25832f19bde209ec",
   "date": "2026-07-29T13:14:07Z",
   "message": "test: add CONST_SCRIPTCODE failure-path vectors to script_tests.json"
  }
 ],
 "timeline": [
  {
   "t": "2026-08-03T19:05:55Z",
   "kind": "review",
   "who": "darosior",
   "assoc": "MEMBER",
   "state": "COMMENTED",
   "commit": "829e44a1151fa432f293554f25832f19bde209ec",
   "text": "Concept ACK.\n\nSpeaking of const scriptcode quirks, do we have a test case for [CVE-2024-38365](https://delvingbitcoin.org/t/cve-2024-38365-public-disclosure-btcd-findanddelete-bug/1184)?"
  },
  {
   "t": "2026-08-03T20:37:42Z",
   "kind": "comment",
   "who": "jeanpablojp",
   "assoc": "CONTRIBUTOR",
   "text": "Not with the signature as the suffix of a bigger push, no. And `CONST_SCRIPTCODE` makes no difference there anyway, since `FindAndDelete` finds nothing. I'll add one separately."
  }
 ],
 "labels_log": [
  {
   "t": "2026-07-29T13:25:15Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-04T12:14:43Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-04T15:07:30Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-08-04T14:03:43Z",
   "kind": "closed",
   "who": "maflcko"
  },
  {
   "t": "2026-08-04T14:03:51Z",
   "kind": "reopened",
   "who": "maflcko"
  }
 ],
 "text_chars": 1977,
 "text_tokens_estimate": 494,
 "changed_paths": [
  "src/test/data/script_tests.json"
 ],
 "files": [
  {
   "path": "src/test/data/script_tests.json",
   "add": 11,
   "del": 0
  }
 ],
 "test_lines": 11,
 "git": {
  "head": "829e44a1151fa432f293554f25832f19bde209ec",
  "head_matches_backup": true,
  "base": "7dea464d6b51a69bd99a0451be8aaf3a26313eb6",
  "commits": [
   {
    "sha": "829e44a115",
    "subject": "test: add CONST_SCRIPTCODE failure-path vectors to script_tests.json",
    "files": 1,
    "add": 11,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "42a250107e72095d",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}