Skip to content

backport: v0.26 bitcoin#28450, bitcoin#26531, partial bitcoin#27944, bitcoin#28088 - #78

Closed
DCG-Claude wants to merge 4 commits into
developfrom
backport-0.26-b058-misc
Closed

DCG-Claude wants to merge 4 commits into
developfrom
backport-0.26-b058-misc

Conversation

@DCG-Claude

@DCG-Claude DCG-Claude commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Automated Bitcoin Core v0.26 backports, batch backport-0.26-b058-misc.

upstream commit gates notes
bitcoin#28450 6535e49246 pick:pass build:pass tests:pass mech:warn tree:pass verify:pass Adds the upstream tx_package_eval fuzz target and its Makefile.test.include entry, adapted to Dash: P2SH OP_TRUE scripts
bitcoin#26531 2f8c12f1b6 pick:pass build:pass tests:pass mech:warn tree:pass verify:pass Backports the mempool:added, mempool:removed and mempool:rejected USDT tracepoints, with their docs, the mempool_monitor
partial bitcoin#27944 5cd586d474 pick:pass build:pass tests:pass mech:warn tree:pass verify:pass partial: Backports bitcoin#27944's USDT test cleanups to interface_usdt_net.py, interface_usdt_utxocache.py and interfac
bitcoin#28088 1d1414bf81 pick:pass build:pass tests:pass mech:warn tree:pass verify:pass Disables the known-broken mempool:rejected reason assertion in interface_usdt_mempool.py (bitcoin#27380), adapte
Provenance

Each commit passed: cherry-pick (adapted by an Opus lane only where conflicts existed), build, touched tests, a mechanical diff-of-diffs check (every upstream hunk landed; no added line without an upstream counterpart), and an independent Opus verification lane where anything was adapted. Gate rows and lane artifacts are in the backportsys DB.

@DCG-Claude

Copy link
Copy Markdown
Collaborator Author

CI failed at 032809a on thepastaclaw/dash: linux64_tsan-test / Test source

The quoted log shows only container teardown with no failing test or error, and the tsan job builds without --enable-usdt so this batch's mempool tracepoints compile out and all USDT functional tests skip; the remaining changes are fuzz targets, docs and unit-test random helpers that would have failed in 'Build source' rather than 'Test source'. That leaves a flaky/timing-out extended functional test or infra teardown under tsan, which this branch does not touch. Please rerun the job.


🤖 backportsys, on behalf of the Dash backport pipeline.

@DCG-Claude

Copy link
Copy Markdown
Collaborator Author

CI failed at 032809a on thepastaclaw/dash: linux64_tsan-test / Test source

The attached log contains no test or build error at all — only the post-job teardown (git config probes, docker rm, network rm, orphan cleanup), which points at a runner/container failure rather than a test result. Nothing on this batch touches CI definitions or TSAN-relevant runtime code (the changes are fuzz targets, test-only rand helpers, USDT tracepoints that are compiled out without ENABLE_TRACING, and Python USDT tests that skip without bcc), so this reads as infrastructure flake; please rerun linux64_tsan-test.


🤖 backportsys, on behalf of the Dash backport pipeline.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@DCG-Claude DCG-Claude changed the title backport: v0.26 bitcoin#28450, bitcoin#27425, bitcoin#27549, bitcoin#26531, partial bitcoin#27944, bitcoin#28088 backport: v0.26 bitcoin#28450, bitcoin#26531, partial bitcoin#27944, bitcoin#28088 Sep 24, 2026
@DCG-Claude
DCG-Claude force-pushed the backport-0.26-b058-misc branch from 032809a to 124c760 Compare September 24, 2026 16:34
262ab8e Add package evaluation fuzzer (Greg Sanders)

Pull request description:

  This fuzzer target caught the issue in bitcoin#28251 within 5 minutes on master branch, and an additional issue which I've applied a preliminary patch to cover.

  Fuzzer target does the following:

  1) Picks mempool confgs, including max package size, count, mempool size, etc
  2) Generates 1 to 26 transactions with arbitrary coins/fees, the first N-1 spending only confirmed outpoints
  3) Nth transaction, if >1, sweeps all unconfirmed outpoints in mempool
  4) If N==1, it may submit it through single-tx submission path, to allow for more interesting topologies
  5) Otherwise submits through package submission interface
  6) Repeat 1-5  a few hundred times per mempool instance

  In other words, it ends up building chains of txns in the mempool using parents-and-children packages, which is currently the topology supported on master.

  The test itself is a direct rip of tx_pool.cpp, with a number of assertions removed because they were failing for unknown reasons, likely due to the notification changes of single tx submission to package, which is used to track addition/removal of transactions in the test. I'll continue working on re-adding these assertions for further invariant testing.

ACKs for top commit:
  murchandamus:
    ACK 262ab8e
  glozow:
    reACK 262ab8e
  dergoegge:
    tACK 262ab8e

Tree-SHA512: 190784777d0f2361b051b3271db8f79b7927e3cab88596d2c30e556da721510bd17f6cc96f6bb03403bbf0589ad3f799fa54e63c1b2bd92a2084485b5e3e96a5
4b7aec2 Add mempool tracepoints (virtu)

Pull request description:

  This PR adds multiple mempool tracepoints.

  | tracepoint  | description |
  | ------------- | ------------- |
  | `mempool:added`  | Is called when a transaction enters the mempool  |
  | `mempool:removed`  | ... when a transaction is removed from the mempool |
  | `mempool:replaced`  | ... when a transaction is replaced in the mempool |
  | `mempool:rejected`  | ... when a transaction is rejected from entering the mempool |

  The tracepoints are further documented in `docs/tracing.md`. Usage is demonstrated in the example script `contrib/tracing/mempool_monitor.py`. Interface tests are provided in `test/functional/interface_usdt_mempool.py`.

  The rationale for passing the removal reason as a string instead of numerically is that the benefits of not having to maintain a redundant enum-string mapping seem to outweigh the small cost of string generation. The reject reason is passed as string as well, although in this instance the string does not have to be generated but is readily available.

ACKs for top commit:
  0xB10C:
    ACK 4b7aec2
  achow101:
    ACK 4b7aec2

Tree-SHA512: 6deb3ba2d1a061292fb9b0f885f7a5c4d11b109b838102d8a8f4828cd68f5cd03fa3fc64adc6fdf54a08a1eaccce261b0aa90c2b8c33cd5fd3828c8f74978958

Dash adaptations:
- src/txmempool.cpp: `#include <util/trace.h>` added alone — upstream's adjacent `<util/result.h>`/`<util/translation.h>` lines are context this PR does not add and Dash's include block does not have.
- src/txmempool.cpp: TRACE3(mempool, added) placed as the last statement of addUnchecked(), i.e. after Dash's `addUncheckedProTx(newit, tx)` call, preserving upstream's 'end of addUnchecked' position around the Dash-only ProTx bookkeeping.
- src/txmempool.cpp: TRACE5(mempool, removed) applied verbatim; Dash's RemovalReasonToString() longest string is still 'sizelimit' (9 chars), so the documented MAX_REMOVAL_REASON_LENGTH=9 holds.
- doc/tracing.md: the `mempool:replaced` subsection is not added (Dash emits no such tracepoint, see omitted_hunks); heading kept as Dash's 'Adding tracepoints to Dash Core'.
- contrib/tracing/mempool_monitor.py: replaced_event struct, trace_replaced BPF fn, handle_replaced, the mempool:replaced enable_probe/perf buffer, the 'replaced' metric rows and the 'replaced' branch of parse_event are dropped — enable_probe() on a probe absent from the binary raises at startup, so keeping them would make the script unusable on dashd. Also bitcoind->dashd (path arg, USAGE string, variable names) and 'Bitcoin Core'->'Dash Core' in the docstring.
- contrib/tracing/README.md: ./src/bitcoind -> ./src/dashd; the mempool_monitor.py description lists only added/removed/rejected; the sample dashboard drops the 'replaced' count/rate rows and the two replaced event-log lines, and the sample 'removed ...: replaced' line now shows ': expiry' (a reason Dash's RemovalReasonToString actually returns).
- test/functional/interface_usdt_mempool.py: replaced_test(), the replaced_event struct, trace_replaced and the run_test() call are dropped for the same reason; doc URL retargeted to dashpay/dash blob/develop, matching the other interface_usdt_*.py files in Dash.

Not applicable to Dash (intentionally omitted):
- src/validation.cpp: The TRACE7(mempool, replaced) hunk lands inside MemPoolAccept::Finalize's 'Remove conflicting transactions from the mempool' loop. Dash has no RBF: Workspace has no m_all_conflicting/m_conflicting_fees/m_conflicting_size/m_replaced_transactions and MemPoolRemovalReason has no REPLACED member, so the entire enclosing loop is absent from Dash and there is nowhere for the tracepoint to fire. The mempool:replaced tracepoint therefore does not exist in dashd, and its doc/monitor/test counterparts were dropped to match (listed under adaptations). The other three tracepoints (added/removed/rejected) are landed in full.

Replayed onto a newer base.

Dash adaptations:
- src/txmempool.cpp: conflict was only include ordering — kept Dash's newer `#include <util/translation.h>` and added upstream's `#include <util/trace.h>` before it, preserving alphabetical order
- src/txmempool.cpp: TRACE3(mempool, added) is placed after Dash's `addUncheckedProTx(newit, tx);` instead of after upstream's segwit-only `vTxHashes.emplace_back(tx.GetWitnessHash(), newit)` block, which Dash does not have; the tracepoint stays at the end of addUnchecked() as upstream intends
- contrib/tracing/mempool_monitor.py, doc/tracing.md, contrib/tracing/README.md, test/functional/interface_usdt_mempool.py: Bitcoin→Dash / bitcoind→dashd branding and doc URL (dashpay/dash blob/develop), as published in the prior backport
- src/validation.cpp: only the TRACE2(mempool, rejected) hunk lands; see omitted_hunks for the replaced tracepoint

Not applicable to Dash (intentionally omitted):
- src/validation.cpp: The TRACE7(mempool, replaced) hunk sits in MemPoolAccept::Finalize()'s RBF conflict-replacement loop. Dash does not implement BIP125 replace-by-fee (it relies on InstantSend locks to prevent conflicting spends), so there is no mempool replacement event to trace and no Dash counterpart where this shape of change belongs. This matches the prior published backport.
- contrib/tracing/mempool_monitor.py: The replaced_event struct, trace_replaced() BPF handler, replaced perf buffer, 'replaced' row in the count/rate windows and the 'replaced' branch of parse_event() are all consumers of the mempool:replaced tracepoint, which Dash has no RBF path to emit.
- test/functional/interface_usdt_mempool.py: replaced_test() and the replaced_event/trace_replaced parts of MEMPOOL_TRACEPOINTS_PROGRAM exercise mempool:replaced via an RBF bump, which Dash cannot perform.
- doc/tracing.md: The 'Tracepoint mempool:replaced' section documents a tracepoint Dash does not emit.
- contrib/tracing/README.md: mempool:replaced is dropped from the tracepoint list and the sample dashboard/event-log output, consistent with the omitted tracepoint.
…ups (27831 follow-ups)

9f55773 test: refactor: usdt_mempool: store all events (stickies-v)
bc43270 test: refactor: remove unnecessary nonlocal (stickies-v)
326db63 test: log sanity check assertion failures (stickies-v)
f5525ad test: store utxocache events (stickies-v)
f1b99ac test: refactor: deduplicate handle_utxocache_* logic (stickies-v)
ad90ba3 test: refactor:  rename inbound to is_inbound (stickies-v)
afc0224 test: refactor: remove unnecessary blocks_checked counter (stickies-v)

Pull request description:

  Various cleanups to the USDT functional tests, largely (but not exclusively) follow-ups to bitcoin#27831 (review). Except for slightly different logging behaviour in "test: store utxocache events" and "test: log sanity check assertion failures", this is a refactor PR, removing unnecessary code and (imo) making it more readable and maintainable.

  The rationale for each change is in the corresponding commit message.

  Note: except for "test: store utxocache events" (which relies on its parent, and I separated into two commits because we may want the parent but not the child), all commits are stand-alone and I'm okay with dropping one/multiple commits if they turn out to be controversial or undesired.

ACKs for top commit:
  0xB10C:
    ACK 9f55773. Reviewed the code and ran the USDT interface tests. I stepped through the commits and think all changes are reasonable.

Tree-SHA512: 6c37a0265b6c26d4f9552a056a690b8f86f7304bd33b4419febd8b17369cf6af799cb87c16df35d0c2a1b839ad31de24661d4384eafa88816c2051c522fd3bf5

Dash adaptations:
- test/functional/interface_usdt_validation.py: the resolved hunk also deletes the in-callback assertion block that Dash's partial bitcoin#27831 backport (c781f1a) left behind alongside the new post-poll loop; upstream's callback body is just events.append(event), so the duplicate had to go and the file now matches upstream's post-image (Dash keeps its own cflags=["-Wno-error=implicit-function-declaration"] line from bitcoin#28629 and its dashpay doc URLs)

Omitted (partial backport):
- test/functional/interface_usdt_mempool.py: Dash's bitcoin#27831 backport (c781f1a) is marked (Partial) and covers only net/utxocache/validation; interface_usdt_mempool.py is still at the bitcoin#26531 state with assert_equal() calls inside each bcc callback, so the 'EXPECTED_*_EVENTS/handled_*_events/event = None' -> 'events = []' rewrite that bitcoin#27944 performs has nothing to rewrite here (needs bitcoin#27831)
faf8be7 test: Disable known broken USDT test (MarcoFalke)

Pull request description:

  The failure is known and running into more failures doesn't help anyone. Not disabling the test would be a waste of CPU and developer time.

  bitcoin#27380

Top commit has no ACKs.

Tree-SHA512: d0469153b00d6b30e10a21bcd52d508fcf9f796ff2468f59aff75020a82c718bcae85caf4b58397dea6fd9e210b501353fd51567f979c6b57d3b1bb23d318216

Dash adaptations:
- test/functional/interface_usdt_mempool.py: Dash still has the pre-bitcoin#27679 structure, so the disabled assertion is `assert_equal(reason, event.reason.decode("UTF-8"))` inside handle_rejected_event() rather than upstream's inlined `assert_equal(event.reason.decode("UTF-8"), "min relay fee not met")` at the end of the function; the same three-line comment referencing bitcoin#27380 precedes it
- test/functional/interface_usdt_mempool.py: also commented out `reason = "min relay fee not met"` — in Dash's structure it is a local of rejected_test() whose only reference was the now-disabled assertion, and test/lint/lint-python.py enables flake8 F841 (assigned but never used), so leaving it live would fail lint. Upstream had no such variable to deal with
- test/functional/interface_usdt_mempool.py: the incoming hunk's trailing context (`bpf.cleanup()` / `self.generate(self.wallet, 1)` after the assertions) was dropped — Dash already calls bpf.cleanup() before the event-count assertion and has no post-test generate in this function; that context belongs to upstream's refactored layout, not to the change itself
@DCG-Claude

Copy link
Copy Markdown
Collaborator Author

batch closed by PastaPastaPasta on dashpay#7730

@DCG-Claude DCG-Claude closed this Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant