bench: replace embedded raw block with configurable block generator #32554
+272
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative to #32457 which replaces the current benchmark block 413567 from 2016 with block 784588 from 2023.
Added
bench/block_generator.{h,cpp}
that builds a fully valid block at runtime and exposes a serialized and an in-memory block, so benchmarks can fetch whichever form they need:-
GetBlock()
- in-memoryCBlock
;-
GetBlockData()
- serializedDataStream
.ScriptRecipe
:Presets
kLegacy
(pre-SegWit) andkWitness
(Taproot-era) are included, callers can supply custom mixes.FastRandomContext
yields identical output on every run while avoiding repetition and predictability bias.CheckBlock()
to ensure full validity.This delivers diverse, up-to-date test data without adding another megabyte-scale binary to the repository and lets us retune workloads as network patterns evolve.