{
 "number": 35286,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35286",
 "title": "rpc: add testsubmitpackage for 1p1c test submissions",
 "author": "instagibbs",
 "author_association": "MEMBER",
 "created_at": "2026-05-13T18:16:36Z",
 "updated_at": "2026-07-24T23:26:31Z",
 "age_days": 126,
 "draft": true,
 "labels": [
  "RPC/REST/ZMQ",
  "Needs rebase"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
 "head_ref": "2026-05-testsubmitpackage_2",
 "head_repo": "instagibbs/bitcoin",
 "head_history": [
  {
   "t": "2026-05-13T18:47:49Z",
   "sha": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa"
  }
 ],
 "additions": 957,
 "deletions": 64,
 "changed_files": 7,
 "commit_count": 1,
 "size_bucket": "XL",
 "mergeable_state": "dirty",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "concept_ack": [
     {
      "login": "ismaelsadeeq",
      "url": "https://github.com/bitcoin/bitcoin/pull/35286#issuecomment-4572545699"
     },
     {
      "login": "w0xlt",
      "url": "https://github.com/bitcoin/bitcoin/pull/35286#issuecomment-4792558553"
     }
    ]
   },
   "conflicts": [
    {
     "number": 35557,
     "title": "kernel, validation: Add btck_chainstate_manager_set_clock_time",
     "author": "ryanofsky"
    },
    {
     "number": 32800,
     "title": "rpc: Distinguish between vsize and sigop adjusted mempool vsize",
     "author": "musaHaruna"
    }
   ]
  }
 },
 "acks_parsed": {
  "ismaelsadeeq": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-05-29T08:23:20Z",
   "stale": false
  },
  "w0xlt": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-06-24T18:45:15Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 2,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "ajtowns",
   "dergoegge",
   "ismaelsadeeq",
   "w0xlt"
  ]
 },
 "signals": {
  "needs_rebase": true,
  "ci_failed": false,
  "mergeable_state": "dirty",
  "last_author_activity": "2026-06-17T14:31:25Z",
  "last_reviewer_activity": "2026-07-01T13:10:16Z",
  "last_reviewer": "dergoegge",
  "author_silent_days": 92,
  "waiting_on_author_days": 78,
  "days_since_update": 54
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": [
   35557,
   32800
  ]
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "src/validation.cpp",
  "src/validation.h",
  "test/functional/rpc_testsubmitpackage.py"
 ],
 "body": "A test-only companion to submitpackage that validates a strict 1p1c [parent, child] bundle without mutating the mempool. Intended as a wallet pre-flight check for CPFP fee-bumping packages.\n\nEnables rbf and sibling eviction evaluation, just like submitpackage.\n\nDiverging behaviors from submitpackage:\n\nHard rejects packages that aren't exactly 2 txs in a child-with-parents topology, and parents that pass individual acceptance (caller should use testsubmitpackage on parent alone for that).\n\n---\n\nTo do this \"properly\" without rejecting the self-sufficient parents (and not giving surprising results that don't match reality), we would need fairly extensive changes to mempool acceptance logic, more book-keeping to unroll test-accepted subpackage state (while risking mutating the mempool in brittle ways), and possibly other changes.\n\nThis is a partial addressing of https://github.com/bitcoin/bitcoin/issues/32160, hopefully addressing most of the missing functionality people are requesting.",
 "commits": [
  {
   "sha": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "date": "2026-05-13T18:47:39Z",
   "message": "rpc: add testsubmitpackage for 1p1c test submissions\n\nA test-only companion to submitpackage that validates a strict 1p1c\n[parent, child] bundle without mutating the mempool. Intended as a\nwallet pre-flight check for CPFP fee-bumping packages.\n\nEnables rbf and sibling eviction evaluation, just like\nsubmitblock.\n\nDiverging behaviors from submitpackage:\n\nHard rejects packages that aren't exactly 2 txs in a child-with-parents\ntopology, and parents that pass individual acceptance (caller should\nuse testsubmitpackage on parent alone for that)."
  }
 ],
 "timeline": [
  {
   "t": "2026-05-13T18:17:07Z",
   "kind": "comment",
   "who": "instagibbs",
   "assoc": "MEMBER",
   "text": "cc @ajtowns @ismaelsadeeq as discussed, let's focus on concept / approach ACKs first, name is clearly up for debate, etc etc"
  },
  {
   "t": "2026-05-13T18:47:49Z",
   "kind": "force_push",
   "who": "instagibbs",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa"
  },
  {
   "t": "2026-05-29T08:23:20Z",
   "kind": "comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "text": "Concept ACK, users normally test run submissions to see whether they will get through; so having `testsubmitpackage` rpc to test run 1p1c package is very useful.\n\nI will review the approach and correctness."
  },
  {
   "t": "2026-05-29T12:56:32Z",
   "kind": "review_comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "path": "src/validation.cpp",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "in_reply_to": null,
   "text": "In a723ef365c88c3bcbf1f5c1ff00137d62651d6aa\nThis is weird to read?  why is `allow_sibling_eviction` tied to `test_accept`?"
  },
  {
   "t": "2026-05-29T13:39:47Z",
   "kind": "review_comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "path": "src/validation.h",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "in_reply_to": null,
   "text": "In  a723ef365c88c3bcbf1f5c1ff00137d62651d6aa\n\n`test_package_feerates`  is a bit hard to read?\n\nCan you use a clearer name for this, maybe `test_accept_as_package`?"
  },
  {
   "t": "2026-05-29T13:56:53Z",
   "kind": "review_comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "path": "src/validation.cpp",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "in_reply_to": null,
   "text": "In  a723ef365c88c3bcbf1f5c1ff00137d62651d6aa\n\n - The loop that copies staged removals into replaced transactions is duplicated at both `test_accept` sites. A helper like `CollectStagedRemovals() `would dedup things\n  - The two sites guard the changeset access inconsistently  one uses if (test_accept && Assume(changeset)), the other nests if (test_accept) { if\n  (Assume(changeset)). Would be nice to make them consistent ( a helper would solve this too since the two code paths are identical)."
  },
  {
   "t": "2026-05-29T14:22:16Z",
   "kind": "review_comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "path": "src/validation.cpp",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "in_reply_to": null,
   "text": "In  a723ef365c88c3bcbf1f5c1ff00137d62651d6aa\n\nI think this is a good time to split the individual-evaluation dry-run path out of ProcessNewPackage into its own function. This removes the `test_package_feerates` parameter, and the branching  `ProcessNewPackage` now always goes through `AcceptPackage`."
  },
  {
   "t": "2026-05-29T14:33:10Z",
   "kind": "review_comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "path": "test/functional/rpc_testsubmitpackage.py",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "in_reply_to": null,
   "text": "In  a723ef365c88c3bcbf1f5c1ff00137d62651d6aa\n\nSeems redundant to have this independent.\nCan we fold `test_no_mempool_mutation_on_success` into `test_basic_1p1c_cpfp` they build the same 1p1c bundle; the mempool-unchanged check belongs alongside the\n basic success assertions rather than in a separate test?"
  },
  {
   "t": "2026-05-29T14:44:49Z",
   "kind": "review_comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "path": "test/functional/rpc_testsubmitpackage.py",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "in_reply_to": null,
   "text": "In  a723ef365c88c3bcbf1f5c1ff00137d62651d6aa\n\nSide note? It seems like a hack to always generate a block when we want to remove a transaction or restart the node, which is much heavier. I think it's part of the reason why the tests are slow.\nIt is worth having evict from mempool rpc for this case and others, which could eliminate this.\n\nAnother way to do this is to also use unit tests, and remove them directly."
  },
  {
   "t": "2026-05-29T14:54:50Z",
   "kind": "review",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "state": "COMMENTED",
   "commit": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
   "text": "This is simple to reason about. I suggest some improvements that will make the code easier to reason about.\nAlso, I think there are still opportunities to dedup things in `rpc/mempool.cpp` shared code of `testsubmitpackage` and `submitpackage`, in the code args collection, help text and the logic."
  },
  {
   "t": "2026-05-29T15:02:30Z",
   "kind": "comment",
   "who": "instagibbs",
   "assoc": "MEMBER",
   "text": "@ismaelsadeeq Interestingly I haven't had a lot of positive feedback yet on this PR. In the LN world, for example, the parent may end up having fees >=minfee, due to trimmed htlcs. Many of these projects don't even use test RPCs.\n\nI think it might make sense to look for more buy-in from prospective users before iterating further."
  },
  {
   "t": "2026-06-16T09:43:54Z",
   "kind": "comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nIt seems LND uses  testflight as a prerequisite for broadcasting.\n\n @GeorgeTsagk mentioned\n\n[quoted text omitted]\nSee https://github.com/2140-dev/bitcoin/issues/24"
  },
  {
   "t": "2026-06-16T21:26:44Z",
   "kind": "comment",
   "who": "ajtowns",
   "assoc": "CONTRIBUTOR",
   "text": "[quoted text omitted]\n\nWould it be possible to somehow test txs with nSequence relative locktimes spending currently out-of-mempool txs? I guess \"Assume utxo `txid vout sPK amt height` exists, and validate this tx against it\" might be feasible? Would let you check \"does this claim tx actually work with this commitment tx, or is there some subtle policy breakage that's been introduced that I didn't check?\" I realise this is probably horrible scope creep :)"
  },
  {
   "t": "2026-06-17T14:31:25Z",
   "kind": "comment",
   "who": "instagibbs",
   "assoc": "MEMBER",
   "text": "@ajtowns https://github.com/bitcoin/bitcoin/issues/32142 I think?"
  },
  {
   "t": "2026-06-24T18:45:15Z",
   "kind": "comment",
   "who": "w0xlt",
   "assoc": "CONTRIBUTOR",
   "text": "Concept ACK"
  },
  {
   "t": "2026-07-01T13:10:16Z",
   "kind": "comment",
   "who": "dergoegge",
   "assoc": "MEMBER",
   "text": "The code looks fine to me, but it'd be helpful for users that want this to say so explicitly here, to help us decide if we should maintain this.\n\n[quoted text omitted]\nIt's been a month since [this](https://github.com/bitcoin/bitcoin/pull/35286#issuecomment-4576630874), any update?"
  }
 ],
 "labels_log": [
  {
   "t": "2026-05-13T18:16:41Z",
   "action": "labeled",
   "label": "RPC/REST/ZMQ",
   "who": "DrahtBot"
  },
  {
   "t": "2026-05-13T18:49:01Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-05-13T19:46:03Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-07-24T23:26:30Z",
   "action": "labeled",
   "label": "Needs rebase",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-07-01T15:36:19Z",
   "kind": "convert_to_draft",
   "who": "instagibbs"
  }
 ],
 "text_chars": 5373,
 "text_tokens_estimate": 1343,
 "changed_paths": [
  "src/rpc/client.cpp",
  "src/rpc/mempool.cpp",
  "src/test/fuzz/rpc.cpp",
  "src/validation.cpp",
  "src/validation.h",
  "test/functional/rpc_testsubmitpackage.py",
  "test/functional/test_runner.py"
 ],
 "files": [
  {
   "path": "src/rpc/client.cpp",
   "add": 3,
   "del": 0
  },
  {
   "path": "src/rpc/mempool.cpp",
   "add": 215,
   "del": 50
  },
  {
   "path": "src/test/fuzz/rpc.cpp",
   "add": 1,
   "del": 0
  },
  {
   "path": "src/validation.cpp",
   "add": 46,
   "del": 13
  },
  {
   "path": "src/validation.h",
   "add": 5,
   "del": 1
  },
  {
   "path": "test/functional/rpc_testsubmitpackage.py",
   "add": 686,
   "del": 0
  },
  {
   "path": "test/functional/test_runner.py",
   "add": 1,
   "del": 0
  }
 ],
 "test_lines": 688,
 "git": {
  "head": "a723ef365c88c3bcbf1f5c1ff00137d62651d6aa",
  "head_matches_backup": true,
  "base": "1af8e0c4e895ebd159304ed86ac059bebeced1f8",
  "commits": [
   {
    "sha": "a723ef365c",
    "subject": "rpc: add testsubmitpackage for 1p1c test submissions",
    "files": 7,
    "add": 957,
    "del": 64
   }
  ],
  "patch_truncated": true
 },
 "input_hash": "42ed1cc5875f99fc",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}