#include <bench/bench.h>
#include <kernel/disconnected_transactions.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <test/util/setup_common.h>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <memory>
#include <vector>
Go to the source code of this file.
|
struct | ReorgTxns |
| Reorg where 1 block is disconnected and 2 blocks are connected. More...
|
|
|
static BlockTxns | CreateRandomTransactions (size_t num_txns) |
|
static ReorgTxns | CreateBlocks (size_t num_not_shared) |
| Creates blocks for a Reorg, each with BLOCK_VTX_COUNT transactions. More...
|
|
static void | Reorg (const ReorgTxns &reorg) |
|
static void | AddAndRemoveDisconnectedBlockTransactionsAll (benchmark::Bench &bench) |
| Add transactions from DisconnectedBlockTransactions, remove all but one (the disconnected block's coinbase transaction) of them, and then pop from the front until empty. More...
|
|
static void | AddAndRemoveDisconnectedBlockTransactions90 (benchmark::Bench &bench) |
| Add transactions from DisconnectedBlockTransactions, remove 90% of them, and then pop from the front until empty. More...
|
|
static void | AddAndRemoveDisconnectedBlockTransactions10 (benchmark::Bench &bench) |
| Add transactions from DisconnectedBlockTransactions, remove 10% of them, and then pop from the front until empty. More...
|
|
| BENCHMARK (AddAndRemoveDisconnectedBlockTransactionsAll, benchmark::PriorityLevel::HIGH) |
|
| BENCHMARK (AddAndRemoveDisconnectedBlockTransactions90, benchmark::PriorityLevel::HIGH) |
|
| BENCHMARK (AddAndRemoveDisconnectedBlockTransactions10, benchmark::PriorityLevel::HIGH) |
|
◆ BlockTxns
◆ AddAndRemoveDisconnectedBlockTransactions10()
static void AddAndRemoveDisconnectedBlockTransactions10 |
( |
benchmark::Bench & |
bench | ) |
|
|
static |
◆ AddAndRemoveDisconnectedBlockTransactions90()
static void AddAndRemoveDisconnectedBlockTransactions90 |
( |
benchmark::Bench & |
bench | ) |
|
|
static |
◆ AddAndRemoveDisconnectedBlockTransactionsAll()
static void AddAndRemoveDisconnectedBlockTransactionsAll |
( |
benchmark::Bench & |
bench | ) |
|
|
static |
Add transactions from DisconnectedBlockTransactions, remove all but one (the disconnected block's coinbase transaction) of them, and then pop from the front until empty.
This is a reorg in which all of the non-coinbase transactions in the disconnected chain also exist in the new chain.
Definition at line 105 of file disconnected_transactions.cpp.
◆ BENCHMARK() [1/3]
◆ BENCHMARK() [2/3]
◆ BENCHMARK() [3/3]
◆ CreateBlocks()
static ReorgTxns CreateBlocks |
( |
size_t |
num_not_shared | ) |
|
|
static |
Creates blocks for a Reorg, each with BLOCK_VTX_COUNT transactions.
Between the disconnected block and the first connected block, there will be num_not_shared transactions that are different, and all other transactions the exact same. The second connected block has all unique transactions. This is to simulate a reorg in which all but num_not_shared transactions are confirmed in the new chain.
Definition at line 62 of file disconnected_transactions.cpp.
◆ CreateRandomTransactions()
static BlockTxns CreateRandomTransactions |
( |
size_t |
num_txns | ) |
|
|
static |
◆ Reorg()
◆ BLOCK_VTX_COUNT
constexpr size_t BLOCK_VTX_COUNT {4000} |
|
constexpr |
◆ BLOCK_VTX_COUNT_10PERCENT
constexpr size_t BLOCK_VTX_COUNT_10PERCENT {400} |
|
constexpr |