{
 "number": 35923,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35923",
 "title": "mempool: count unbroadcast txids in memory usage",
 "author": "l0rinc",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-08-06T22:33:33Z",
 "updated_at": "2026-08-08T13:07:28Z",
 "age_days": 41,
 "draft": false,
 "labels": [
  "Mempool"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "db21e03c9d50386072a1123568f917ba65dcf348",
 "head_ref": "l0rinc/mempool-unbroadcast-memory",
 "head_repo": "l0rinc/bitcoin",
 "head_history": [],
 "additions": 18,
 "deletions": 1,
 "changed_files": 2,
 "commit_count": 2,
 "size_bucket": "S",
 "mergeable_state": "blocked",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "jeanpablojp",
      "url": "https://github.com/bitcoin/bitcoin/pull/35923#issuecomment-5226236179"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "jeanpablojp": {
   "kind": "ack",
   "hash": "db21e03c9d50386072a1123568f917ba65dcf348",
   "t": "2026-08-08T13:07:25Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 1,
  "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": [
   "jeanpablojp"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "blocked",
  "last_author_activity": "2026-08-06T21:20:48Z",
  "last_reviewer_activity": "2026-08-08T13:07:25Z",
  "last_reviewer": "jeanpablojp",
  "author_silent_days": 41,
  "waiting_on_author_days": 40,
  "days_since_update": 40
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "**Problem:** The mempool memory estimate omits the txid set used to retry the initial broadcast of locally submitted transactions, so `getmempoolinfo` and `-maxmempool` undercount retained memory.\n\n**Fix:** Count this set when calculating mempool memory usage.",
 "commits": [
  {
   "sha": "8d5c4a9290b0bc0c323cf77619f1620aa3d4caf0",
   "date": "2026-08-06T21:20:41Z",
   "message": "test: characterize unbroadcast memory accounting\n\nTrack a mempool transaction before and after adding its txid to the unbroadcast set, which currently retains a node without changing reported memory usage."
  },
  {
   "sha": "db21e03c9d50386072a1123568f917ba65dcf348",
   "date": "2026-08-06T21:20:48Z",
   "message": "mempool: include unbroadcast txid memory\n\nInclude `m_unbroadcast_txids` in `DynamicMemoryUsage()` to count the set nodes retained for locally submitted transactions awaiting their first successful broadcast, with at most one entry per mempool transaction."
  }
 ],
 "timeline": [
  {
   "t": "2026-08-08T13:07:25Z",
   "kind": "comment",
   "who": "jeanpablojp",
   "assoc": "CONTRIBUTOR",
   "text": "ACK db21e03c9d50386072a1123568f917ba65dcf348\n\nI have tested the code. `m_unbroadcast_txids` is a `std::set<Txid>` that `memusage.h` handles, 80 bytes per txid on my build, and it was not counted elsewhere in `DynamicMemoryUsage()`. Dropping the term makes the added test fail (760 <= 760), so it covers the change. Built the merge with master (05a7c47): unit suite, `mempool_unbroadcast.py` and `mempool_persist.py` pass."
  }
 ],
 "labels_log": [
  {
   "t": "2026-08-06T22:33:37Z",
   "action": "labeled",
   "label": "Mempool",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-08-07T06:08:09Z",
   "kind": "closed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-07T06:08:14Z",
   "kind": "reopened",
   "who": "DrahtBot"
  }
 ],
 "text_chars": 1192,
 "text_tokens_estimate": 298,
 "changed_paths": [
  "src/test/mempool_tests.cpp",
  "src/txmempool.cpp"
 ],
 "files": [
  {
   "path": "src/test/mempool_tests.cpp",
   "add": 17,
   "del": 0
  },
  {
   "path": "src/txmempool.cpp",
   "add": 1,
   "del": 1
  }
 ],
 "test_lines": 17,
 "git": {
  "head": "db21e03c9d50386072a1123568f917ba65dcf348",
  "head_matches_backup": true,
  "base": "b388674acf06e9cf64788375817737578358367f",
  "commits": [
   {
    "sha": "8d5c4a9290",
    "subject": "test: characterize unbroadcast memory accounting",
    "files": 1,
    "add": 17,
    "del": 0
   },
   {
    "sha": "db21e03c9d",
    "subject": "mempool: include unbroadcast txid memory",
    "files": 2,
    "add": 2,
    "del": 2
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "9ee0d8aa4893aed9",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}