#36694 test, bench: construct mempool inputs/outputs declaratively
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #36694 test, bench: construct mempool inputs/outputs declaratively | Ready | 0 | Crickets | 0 + 132 tests | |||
|
|
|
| ||||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | |||||||
Goal
Refactors transaction construction in mempool unit tests and benchmarks to use declarative constructor syntax for inputs and outputs instead of resizing vectors and setting fields manually. It modifies `mempool_tests`, `rbf_tests`, and the `mempool_eviction` benchmark without altering transaction data. This standardizes transaction setup and prepares call sites for potential direct `CTransaction` construction.
Problem: Transaction setup in mempool tests and benchmarks relies on imperative, field-by-field mutation of `CMutableTransaction` fields and vector resizing, which is verbose and complicates future transitions to immutable transaction constructors.
Evidence of importance:
- PR description notes this is part of #36692 ('Declarative construction of test data') to ease future direct construction of CTransaction instances.
Risk of a mistake: low (tests). Touches only unit tests and benchmarks without altering consensus, validation, or node runtime logic.
Changed since the previous assessment: Diff provided; the patch matches the earlier high-level description across the three files.
Reviewability
Ready
Nothing known that would invalidate a review now.
Waiting on (from the thread read):
- author: response to maflcko's suggestion to wait on #36692 and #36521 2026-10-29
- author: reply to maflcko's suggestion to wait on #36692 and #36521 2026-10-29
- decision: outcome of issue #36692 and merge of PR #36521 2026-10-29
Agreement
Crickets
no substantive comment either way
Thread notes: Initial record. maflcko suggested waiting on related issue #36692 and conflicting PR #36521. / Initial record. maflcko suggested waiting for resolution on issue #36692 and PR #36521 before proceeding.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| maflcko (member) | suggestion, approach | Wait for the outcome of issue #36692 and for conflicting PR #36521 to merge before proceeding. | open | answered | no | 2026-10-29: 'Let's wait a week or two on that issue. Also, this pull conflicts with https://github.com/bitcoin/bitcoin/pull/36521, so let's wait for that to be merged first.' |
Participants:
Files
287 lines under test/bench/ci.
- src/test/mempool_tests.cpp +79/-90
- src/bench/mempool_eviction.cpp +50/-56
- src/test/rbf_tests.cpp +3/-9
Card
The short text the ranking pass compares across PRs.
This PR refactors transaction creation across mempool unit tests and benchmarks to use declarative CTxIn and CTxOut constructor calls rather than manual vector resizing and field assignments. It covers mempool_tests, rbf_tests, and the mempool_eviction benchmark as part of #36692. The change is restricted to tests and benchmarks, alters no transaction semantics, and simplifies future conversion to immutable CTransaction constructors.
Data
thread read through 2026-10-29 (1 statements), head 30ad3ca75d
labels: none
Categories
Test infrastructure
P4 · cleanup (ranking pass: Moved up ahead of #35994: it is the manual approach the #35994 author now prefers for the same #36692 goal.)
Refactors test and benchmark code to use declarative constructors rather than manual vector resizing and field mutations. In the test infrastructure category, test code cleanliness ranks lowest as an internal refactoring without bug fixes, signal improvements, or performance gains.
Membership: Touches src/bench/mempool_eviction.cpp and refactors transaction construction syntax across unit tests and benchmarks.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0