{
 "number": 36405,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36405",
 "title": "test: look for the wtxid in p2p_blocksonly",
 "author": "fametrano",
 "author_association": "FIRST_TIME_CONTRIBUTOR",
 "created_at": "2026-10-01T20:32:02Z",
 "updated_at": "2026-10-26T01:42:08Z",
 "description_hash": "39f252945e396c66",
 "age_days": 31,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "22535b460568be47e57aadfbe50d489becb77577",
 "head_ref": "test-blocksonly-wtxid-inv",
 "head_repo": "fametrano/bitcoin",
 "head_history": [],
 "additions": 5,
 "deletions": 2,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "maflcko",
      "url": "https://github.com/bitcoin/bitcoin/pull/36405#issuecomment-6161642824"
     },
     {
      "login": "AndreaDiazCorreia",
      "url": "https://github.com/bitcoin/bitcoin/pull/36405#pullrequestreview-5646511712"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "mercie-ux": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-10-07T14:23:48Z",
   "stale": false
  },
  "AndreaDiazCorreia": {
   "kind": "ack",
   "hash": "22535b460568be47e57aadfbe50d489becb77577",
   "t": "2026-10-26T01:42:04Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 1,
  "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": [
   "AndreaDiazCorreia",
   "maflcko",
   "mercie-ux"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-14T05:24:30Z",
  "last_reviewer_activity": "2026-10-26T01:42:04Z",
  "last_reviewer": "AndreaDiazCorreia",
  "author_silent_days": 18,
  "waiting_on_author_days": 6,
  "days_since_update": 6
 },
 "refs": {
  "mentioned": [
   35920
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 35920,
    "type": "pull",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "net_processing: Ignore MSG_WITNESS_TX entries from INV messages"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "test/functional/p2p_blocksonly.py"
 ],
 "body": "In `blocks_relay_conn_tests`, the check that a transaction submitted over RPC is not announced to a block-relay-only peer looks for its txid among the peer's invs. The peer is a `P2PTxInvStore`, which negotiates wtxidrelay, so an announcement would carry the wtxid. The MiniWallet transaction has a witness, so its txid and wtxid differ, and the check passes whether or not the node announces it.\n\nThis checks the wtxid instead. To see the difference, open that connection as `outbound-full-relay`: the old check still passes, the new one fails. It also adds an `outbound-full-relay` peer that must receive the wtxid announcement first, so the check cannot pass silently again.\n\n#35920 also edits `blocks_relay_conn_tests`; the two do not conflict.\n\nFound while porting these tests to https://github.com/btclib-org/bitcoin-node-tests.",
 "commits": [
  {
   "sha": "22535b460568be47e57aadfbe50d489becb77577",
   "date": "2026-10-13T20:34:59Z",
   "message": "test: look for the wtxid in p2p_blocksonly\n\nThe connection that checks a transaction submitted over RPC is not\nannounced to a block-relay-only peer uses P2PTxInvStore, which negotiates\nwtxidrelay. The node would therefore announce the transaction by its\nwtxid, and the assertion looked for the txid, which cannot be in the\nstore for a transaction carrying a witness: it passed whether or not the\ntransaction was announced.\n\nAssert on the wtxid instead. With the connection opened as\noutbound-full-relay rather than block-relay-only, the old assertion still\npasses and the new one fails.\n\nAlso open an outbound-full-relay connection and assert that the wtxid\nwas announced on it. The two assertions differ only by `not`, so if the\nannouncement or its id changes, the test fails instead of the absence\ncheck passing silently."
  }
 ],
 "timeline": [
  {
   "t": "2026-10-07T14:23:48Z",
   "kind": "comment",
   "who": "mercie-ux",
   "assoc": "CONTRIBUTOR",
   "text": "Concept Ack",
   "id": "c:6040022214",
   "url": "https://github.com/bitcoin/bitcoin/pull/36405#issuecomment-6040022214",
   "hash": "946319c0862d7b47",
   "edited": null
  },
  {
   "t": "2026-10-12T12:33:00Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "test/functional/p2p_blocksonly.py",
   "commit": "22535b460568be47e57aadfbe50d489becb77577",
   "in_reply_to": null,
   "text": "maybe there should be another peer to check it is received for it? Otherwise the test will likely silently break again in the future?",
   "id": "rc:4248035821",
   "url": "https://github.com/bitcoin/bitcoin/pull/36405#discussion_r4248035821",
   "hash": "75e02e42f99838db",
   "edited": "2026-10-12T12:33:09Z"
  },
  {
   "t": "2026-10-13T10:31:09Z",
   "kind": "review_comment",
   "who": "fametrano",
   "assoc": "NONE",
   "path": "test/functional/p2p_blocksonly.py",
   "commit": "22535b460568be47e57aadfbe50d489becb77577",
   "in_reply_to": 4248035821,
   "text": "Done in c765571. I added an outbound-full-relay peer that must receive the wtxid announcement before the block-relay-only peer is checked, so the test fails if the node stops announcing the transaction or announces it under another id.",
   "id": "rc:4257533456",
   "url": "https://github.com/bitcoin/bitcoin/pull/36405#discussion_r4257533456",
   "hash": "eed3411906d0513a",
   "edited": null
  },
  {
   "t": "2026-10-13T10:45:55Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "test/functional/p2p_blocksonly.py",
   "commit": "c765571e83b59f85bf329b5458f2e03afb2c9989",
   "in_reply_to": null,
   "text": "There is no need to wait for a broadcast, when not using the unbroadcast set for this test. Also, with mocktime, this should probably be a sync_with_ping instead?\n\nFinally, the point was that the test has the relevant assert directly inside, so that it is somewhat \"self-checking\". So the difference between the two asserts is just the `not`.",
   "id": "rc:4257661531",
   "url": "https://github.com/bitcoin/bitcoin/pull/36405#discussion_r4257661531",
   "hash": "014f10a7f6933b52",
   "edited": null
  },
  {
   "t": "2026-10-14T05:24:30Z",
   "kind": "review_comment",
   "who": "fametrano",
   "assoc": "NONE",
   "path": "test/functional/p2p_blocksonly.py",
   "commit": "c765571e83b59f85bf329b5458f2e03afb2c9989",
   "in_reply_to": 4257661531,
   "text": "Thanks, done in 22535b4. I dropped the wait and sync both peers with a ping; the two asserts now differ only by `not`.",
   "id": "rc:4267090004",
   "url": "https://github.com/bitcoin/bitcoin/pull/36405#discussion_r4267090004",
   "hash": "ed414f3f4f5bb470",
   "edited": null
  },
  {
   "t": "2026-10-14T05:31:55Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "lgtm ACK 22535b460568be47e57aadfbe50d489becb77577",
   "id": "c:6161642824",
   "url": "https://github.com/bitcoin/bitcoin/pull/36405#issuecomment-6161642824",
   "hash": "63e0fed0870b5e24",
   "edited": null
  },
  {
   "t": "2026-10-26T01:42:04Z",
   "kind": "review",
   "who": "AndreaDiazCorreia",
   "assoc": "NONE",
   "state": "COMMENTED",
   "commit": "22535b460568be47e57aadfbe50d489becb77577",
   "text": "ACK 22535b460568be47e57aadfbe50d489becb77577\n\nRan p2p_blocksonly.py with v1 and v2 transport. With conn changed to outbound-full-relay, the new assertion fails while the old txid check still passes. Using txid in both assertions also fails at the positive control.",
   "id": "r:5646511712",
   "url": "https://github.com/bitcoin/bitcoin/pull/36405#pullrequestreview-5646511712",
   "hash": "fa49d3303cfe19e5",
   "edited": null
  }
 ],
 "labels_log": [
  {
   "t": "2026-10-01T20:32:08Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 2859,
 "text_tokens_estimate": 714,
 "changed_paths": [
  "test/functional/p2p_blocksonly.py"
 ],
 "files": [
  {
   "path": "test/functional/p2p_blocksonly.py",
   "add": 5,
   "del": 2
  }
 ],
 "test_lines": 7,
 "git": {
  "head": "22535b460568be47e57aadfbe50d489becb77577",
  "head_matches_backup": true,
  "base": "3b07eeeae08aa395a5ab9ec704e533518ad466c1",
  "patch_id": "e9113cce8e1949ea",
  "commits": [
   {
    "sha": "22535b4605",
    "subject": "test: look for the wtxid in p2p_blocksonly",
    "files": 1,
    "add": 5,
    "del": 2
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "e9113cce8e1949ea",
 "input_hash": "9630724bce3aa2e5",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}