15#include <validation.h>
27 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
31 BlockAssembler::Options options;
35 constexpr size_t NUM_BLOCKS{200};
37 for (
size_t b{0}; b < NUM_BLOCKS; ++b) {
39 tx.
vin.emplace_back(
MineBlock(test_setup->m_node, options));
40 tx.
vin.back().scriptWitness = witness;
48 for (
const auto& txr : txs) {
61 auto testing_setup{MakeNoLogFileContext<TestChain100Setup>()};
62 testing_setup->PopulateMempool(det_rand, 1000,
true);
63 BlockAssembler::Options assembler_options;
64 assembler_options.test_block_validity =
false;
static void AssembleBlock(benchmark::Bench &bench)
static void BlockAssemblerAddPackageTxns(benchmark::Bench &bench)
BENCHMARK(AssembleBlock, benchmark::PriorityLevel::HIGH)
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Generate a new block, without valid proof-of-work.
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
std::shared_ptr< const CTransaction > CTransactionRef
A mutable version of CTransaction.
std::vector< CTxOut > vout
std::vector< std::vector< unsigned char > > stack
Validation result for a transaction evaluated by MemPoolAccept (single or package).
const ResultType m_result_type
Result type.
std::shared_ptr< CBlock > PrepareBlock(const NodeContext &node, const BlockAssembler::Options &assembler_options)
COutPoint MineBlock(const NodeContext &node, const node::BlockAssembler::Options &assembler_options)
Returns the generated coin.
static const std::vector< uint8_t > WITNESS_STACK_ELEM_OP_TRUE
static const CScript P2WSH_OP_TRUE