37 uint32_t current_height{0};
38 const auto advance_height{
39 [&] { current_height = fuzzed_data_provider.
ConsumeIntegralInRange<
decltype(current_height)>(current_height, 1 << 30); },
54 const auto tx_submitted_in_package = fuzzed_data_provider.
ConsumeBool();
55 const auto tx_has_mempool_parents = fuzzed_data_provider.
ConsumeBool();
57 entry.GetTxSize(), entry.GetHeight(),
59 tx_submitted_in_package,
61 tx_has_mempool_parents);
68 std::list<CTxMemPoolEntry> mempool_entries;
79 std::vector<RemovedMempoolTransactionInfo> txs;
80 txs.reserve(mempool_entries.size());
82 txs.emplace_back(mempool_entry);
85 block_policy_estimator.
processBlock(txs, current_height);
98 auto* result_ptr = fuzzed_data_provider.
ConsumeBool() ? &result :
nullptr;
99 (void)block_policy_estimator.
estimateRawFee(conf_target, success_threshold, horizon, result_ptr);
103 auto* fee_calc_ptr = fuzzed_data_provider.
ConsumeBool() ? &fee_calculation :
nullptr;
104 auto conservative = fuzzed_data_provider.
ConsumeBool();
105 (void)block_policy_estimator.
estimateSmartFee(conf_target, fee_calc_ptr, conservative);
112 block_policy_estimator.
Write(fuzzed_auto_file);
113 block_policy_estimator.
Read(fuzzed_auto_file);
114 (void)fuzzed_auto_file.
fclose();
for(unsigned int i=0;i< 256;++i)
const TestingSetup * g_setup
static constexpr bool DEFAULT_ACCEPT_STALE_FEE_ESTIMATES
static constexpr auto ALL_FEE_ESTIMATE_HORIZONS
fs::path FeeestPath(const ArgsManager &argsman)
Non-refcounted RAII wrapper for FILE*.
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
void processTransaction(const NewMempoolTransactionInfo &tx) EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Process a transaction accepted to the mempool.
bool removeTx(Txid hash) EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Remove a transaction from the mempool tracking stats for non BLOCK removal reasons.
virtual CFeeRate estimateSmartFee(int confTarget, FeeCalculation *feeCalc, bool conservative) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Estimate feerate needed to get be included in a block within confTarget blocks.
bool Write(AutoFile &fileout) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Write estimation data to a file.
virtual unsigned int HighestTargetTracked(FeeEstimateHorizon horizon) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Calculation of highest target that estimates are tracked for.
CFeeRate estimateFee(int confTarget) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
DEPRECATED.
bool Read(AutoFile &filein) EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Read estimation data from a file.
void FlushUnconfirmed() EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Empty mempool transactions on shutdown to record failure to confirm for txs still in mempool.
CFeeRate estimateRawFee(int confTarget, double successThreshold, FeeEstimateHorizon horizon, EstimationResult *result=nullptr) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Return a specific fee estimate calculation with a given success threshold and time horizon,...
void processBlock(const std::vector< RemovedMempoolTransactionInfo > &txs_removed_for_block, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Process all the transactions that have been included in a block.
The basic transaction that is broadcasted on the network and contained in blocks.
const Txid & GetHash() const LIFETIMEBOUND
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
T ConsumeIntegralInRange(T min, T max)
T PickValueInArray(const T(&array)[size])
static transaction_identifier FromUint256(const uint256 &id)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
void initialize_policy_estimator()
static constexpr TransactionSerParams TX_WITH_WITNESS
std::unique_ptr< T > MakeNoLogFileContext(const ChainType chain_type=ChainType::REGTEST, TestOpts opts={})
Make a test setup that has disk access to the debug.log file disabled.
CTxMemPoolEntry ConsumeTxMemPoolEntry(FuzzedDataProvider &fuzzed_data_provider, const CTransaction &tx, uint32_t max_height) noexcept
uint256 ConsumeUInt256(FuzzedDataProvider &fuzzed_data_provider) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
std::optional< T > ConsumeDeserializable(FuzzedDataProvider &fuzzed_data_provider, const P ¶ms, const std::optional< size_t > &max_length=std::nullopt) noexcept