#36254 bench: add and use undo-data for BlockToJsonVerbosity3 bench
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #36254 bench: add and use undo-data for BlockToJsonVerbosity3 bench | Ready | 1 | Strong | 0 + 21 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
Add undo data for block 413567 to benchmark test data and write it during test block index setup. This ensures that the RPC blockchain benchmarks for blockToJSON at verbosity level 3 exercise undo data reading, fee calculation, and prevout serialization.
Problem: The `blockToJSON` RPC helper requires undo data to populate prevouts and calculate transaction fees. Because the benchmark harness lacked undo data for the sample block, `TxVerbosity::SHOW_DETAILS` (verbosity 2) and `TxVerbosity::SHOW_DETAILS_AND_PREVOUT` (verbosity 3) performed identical work, giving an inaccurate benchmark of verbosity 3 performance.
Evidence of importance:
- PR description benchmarks show that before the change, `BlockToJsonVerbosity2` ran in 17.07 ms/op and `BlockToJsonVerbosity3` ran in 17.25 ms/op (virtually identical), whereas with undo data available verbosity 3 increases to 34.27 ms/op as it processes prevouts.
Scope: Adds a binary raw data file (`src/bench/data/block413567_undo.raw`, ~136 KB).
Reviewability
Ready
Nothing known that would invalidate a review now.
Agreement
Strong
substantive support, no open objection (ismaelsadeeq)
Thread notes: Initial record. ismaelsadeeq provided a Tested ACK after reproducing benchmark results and verifying the undo-data blob; sedited offered an off-topic/related PR reference.
Objections, suggestions, and questions: none recorded.
Support:
- ismaelsadeeq (member) (Tested ACK, 2026-09-15): I reproduced the benchmark and verified the undo-data blob.
Participants:
- ismaelsadeeq (member, support, 1 statements 2026-09-15 to 2026-09-15): Tested ACK; reproduced benchmarks and verified undo-data blob
- sedited (member, neutral, 1 statements 2026-09-15 to 2026-09-15): pointed to related PR 32554
Files
21 lines under test/bench/ci.
- src/bench/rpc_blockchain.cpp +20/-0
- src/bench/CMakeLists.txt +1/-0
- src/bench/data/block413567_undo.raw +None/-None
Card
The short text the ranking pass compares across PRs.
This PR adds undo data for block 413567 to benchmark fixtures so that `blockToJSON` can read prevouts and calculate fees during benchmarks. Previously, the lack of undo data meant `BlockToJsonVerbosity3` (requesting prevouts) performed the exact same work as verbosity 2, masking the true cost of prevout extraction and serialization. Benchmark data in the PR description shows verbosity 3 runtime jumping from ~17.2 ms/op (identical to verbosity 2) to ~34.3 ms/op once undo data is actually processed.
Data
thread read through 2026-09-15 (3 statements), head 0771dd89d6
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: Tests
Categories
Test infrastructure
P3 · test coverage
Fixes an inaccurate benchmark so that verbosity 3 actually exercises undo-data reading and prevout serialization instead of duplicating verbosity 2 work. The benchmark previously ran in 17.25 ms/op vs 17.07 ms/op for verbosity 2, whereas providing the undo data reflects its true ~34.27 ms/op runtime.
Membership: Touches src/bench/ and carries the Tests label, modifying the RPC blockchain benchmark harness and test data.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 1