diff --git a/doc/release-notes-29496.md b/doc/release-notes-29496.md new file mode 100644 index 00000000000..799b2ca01d5 --- /dev/null +++ b/doc/release-notes-29496.md @@ -0,0 +1,11 @@ +Mempool Policy Changes +---------------------- + +- Transactions with version number set to 3 are now treated as standard on all networks (#29496), + subject to Opt-in Topologically Restricted Until Confirmation (TRUC) Transactions policy as + described in [BIP 431](https://github.com/bitcoin/bips/blob/master/bip-0431.mediawiki). The + policy includes limits on spending unconfirmed outputs (#28948), eviction of a previous descendant + if a more incentive-compatible one is submitted (#29306), and a maximum transaction size of 10,000vB + (#29873). These restrictions simplify the assessment of incentive compatibility of accepting or + replacing TRUC transactions, thus ensuring any replacements are more profitable for the node and + making fee-bumping more reliable. diff --git a/src/Makefile.am b/src/Makefile.am index 52d4aae8939..183d196a7b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -244,7 +244,6 @@ BITCOIN_CORE_H = \ node/warnings.h \ noui.h \ outputtype.h \ - policy/v3_policy.h \ policy/feerate.h \ policy/fees.h \ policy/fees_args.h \ @@ -252,6 +251,7 @@ BITCOIN_CORE_H = \ policy/policy.h \ policy/rbf.h \ policy/settings.h \ + policy/truc_policy.h \ pow.h \ protocol.h \ psbt.h \ @@ -448,12 +448,12 @@ libbitcoin_node_a_SOURCES = \ node/validation_cache_args.cpp \ node/warnings.cpp \ noui.cpp \ - policy/v3_policy.cpp \ policy/fees.cpp \ policy/fees_args.cpp \ policy/packages.cpp \ policy/rbf.cpp \ policy/settings.cpp \ + policy/truc_policy.cpp \ pow.cpp \ rest.cpp \ rpc/blockchain.cpp \ @@ -708,9 +708,9 @@ libbitcoin_common_a_SOURCES = \ netbase.cpp \ net_permissions.cpp \ outputtype.cpp \ - policy/v3_policy.cpp \ policy/feerate.cpp \ policy/policy.cpp \ + policy/truc_policy.cpp \ protocol.cpp \ psbt.cpp \ rpc/external_signer.cpp \ @@ -955,12 +955,12 @@ libbitcoinkernel_la_SOURCES = \ node/blockstorage.cpp \ node/chainstate.cpp \ node/utxo_snapshot.cpp \ - policy/v3_policy.cpp \ policy/feerate.cpp \ policy/packages.cpp \ policy/policy.cpp \ policy/rbf.cpp \ policy/settings.cpp \ + policy/truc_policy.cpp \ pow.cpp \ primitives/block.cpp \ primitives/transaction.cpp \ diff --git a/src/policy/v3_policy.cpp b/src/policy/truc_policy.cpp similarity index 76% rename from src/policy/v3_policy.cpp rename to src/policy/truc_policy.cpp index 6bd043b8e3d..69e8d5ed1d2 100644 --- a/src/policy/v3_policy.cpp +++ b/src/policy/truc_policy.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include +#include #include #include @@ -14,7 +14,7 @@ #include #include -/** Helper for PackageV3Checks: Returns a vector containing the indices of transactions (within +/** Helper for PackageTRUCChecks: Returns a vector containing the indices of transactions (within * package) that are direct parents of ptx. */ std::vector FindInPackageParents(const Package& package, const CTransactionRef& ptx) { @@ -37,13 +37,13 @@ std::vector FindInPackageParents(const Package& package, const CTransact return in_package_parents; } -/** Helper for PackageV3Checks, storing info for a mempool or package parent. */ +/** Helper for PackageTRUCChecks, storing info for a mempool or package parent. */ struct ParentInfo { /** Txid used to identify this parent by prevout */ const Txid& m_txid; /** Wtxid used for debug string */ const Wtxid& m_wtxid; - /** version used to check inheritance of v3 and non-v3 */ + /** version used to check inheritance of TRUC and non-TRUC */ decltype(CTransaction::version) m_version; /** If parent is in mempool, whether it has any descendants in mempool. */ bool m_has_mempool_descendant; @@ -55,36 +55,36 @@ struct ParentInfo { {} }; -std::optional PackageV3Checks(const CTransactionRef& ptx, int64_t vsize, +std::optional PackageTRUCChecks(const CTransactionRef& ptx, int64_t vsize, const Package& package, const CTxMemPool::setEntries& mempool_ancestors) { // This function is specialized for these limits, and must be reimplemented if they ever change. - static_assert(V3_ANCESTOR_LIMIT == 2); - static_assert(V3_DESCENDANT_LIMIT == 2); + static_assert(TRUC_ANCESTOR_LIMIT == 2); + static_assert(TRUC_DESCENDANT_LIMIT == 2); const auto in_package_parents{FindInPackageParents(package, ptx)}; - // Now we have all ancestors, so we can start checking v3 rules. + // Now we have all ancestors, so we can start checking TRUC rules. if (ptx->version == TRUC_VERSION) { - // SingleV3Checks should have checked this already. - if (!Assume(vsize <= V3_MAX_VSIZE)) { - return strprintf("v3 tx %s (wtxid=%s) is too big: %u > %u virtual bytes", - ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), vsize, V3_MAX_VSIZE); + // SingleTRUCChecks should have checked this already. + if (!Assume(vsize <= TRUC_MAX_VSIZE)) { + return strprintf("version=3 tx %s (wtxid=%s) is too big: %u > %u virtual bytes", + ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), vsize, TRUC_MAX_VSIZE); } - if (mempool_ancestors.size() + in_package_parents.size() + 1 > V3_ANCESTOR_LIMIT) { + if (mempool_ancestors.size() + in_package_parents.size() + 1 > TRUC_ANCESTOR_LIMIT) { return strprintf("tx %s (wtxid=%s) would have too many ancestors", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString()); } const bool has_parent{mempool_ancestors.size() + in_package_parents.size() > 0}; if (has_parent) { - // A v3 child cannot be too large. - if (vsize > V3_CHILD_MAX_VSIZE) { - return strprintf("v3 child tx %s (wtxid=%s) is too big: %u > %u virtual bytes", + // A TRUC child cannot be too large. + if (vsize > TRUC_CHILD_MAX_VSIZE) { + return strprintf("version=3 child tx %s (wtxid=%s) is too big: %u > %u virtual bytes", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), - vsize, V3_CHILD_MAX_VSIZE); + vsize, TRUC_CHILD_MAX_VSIZE); } // Exactly 1 parent exists, either in mempool or package. Find it. @@ -107,7 +107,7 @@ std::optional PackageV3Checks(const CTransactionRef& ptx, int64_t v // If there is a parent, it must have the right version. if (parent_info.m_version != TRUC_VERSION) { - return strprintf("v3 tx %s (wtxid=%s) cannot spend from non-v3 tx %s (wtxid=%s)", + return strprintf("version=3 tx %s (wtxid=%s) cannot spend from non-version=3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), parent_info.m_txid.ToString(), parent_info.m_wtxid.ToString()); } @@ -118,7 +118,7 @@ std::optional PackageV3Checks(const CTransactionRef& ptx, int64_t v for (auto& input : package_tx->vin) { // Fail if we find another tx with the same parent. We don't check whether the - // sibling is to-be-replaced (done in SingleV3Checks) because these transactions + // sibling is to-be-replaced (done in SingleTRUCChecks) because these transactions // are within the same package. if (input.prevout.hash == parent_info.m_txid) { return strprintf("tx %s (wtxid=%s) would exceed descendant count limit", @@ -140,17 +140,17 @@ std::optional PackageV3Checks(const CTransactionRef& ptx, int64_t v } } } else { - // Non-v3 transactions cannot have v3 parents. + // Non-TRUC transactions cannot have TRUC parents. for (auto it : mempool_ancestors) { if (it->GetTx().version == TRUC_VERSION) { - return strprintf("non-v3 tx %s (wtxid=%s) cannot spend from v3 tx %s (wtxid=%s)", + return strprintf("non-version=3 tx %s (wtxid=%s) cannot spend from version=3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), it->GetSharedTx()->GetHash().ToString(), it->GetSharedTx()->GetWitnessHash().ToString()); } } for (const auto& index: in_package_parents) { if (package.at(index)->version == TRUC_VERSION) { - return strprintf("non-v3 tx %s (wtxid=%s) cannot spend from v3 tx %s (wtxid=%s)", + return strprintf("non-version=3 tx %s (wtxid=%s) cannot spend from version=3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), package.at(index)->GetHash().ToString(), @@ -161,20 +161,20 @@ std::optional PackageV3Checks(const CTransactionRef& ptx, int64_t v return std::nullopt; } -std::optional> SingleV3Checks(const CTransactionRef& ptx, +std::optional> SingleTRUCChecks(const CTransactionRef& ptx, const CTxMemPool::setEntries& mempool_ancestors, const std::set& direct_conflicts, int64_t vsize) { - // Check v3 and non-v3 inheritance. + // Check TRUC and non-TRUC inheritance. for (const auto& entry : mempool_ancestors) { if (ptx->version != TRUC_VERSION && entry->GetTx().version == TRUC_VERSION) { - return std::make_pair(strprintf("non-v3 tx %s (wtxid=%s) cannot spend from v3 tx %s (wtxid=%s)", + return std::make_pair(strprintf("non-version=3 tx %s (wtxid=%s) cannot spend from version=3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), entry->GetSharedTx()->GetHash().ToString(), entry->GetSharedTx()->GetWitnessHash().ToString()), nullptr); } else if (ptx->version == TRUC_VERSION && entry->GetTx().version != TRUC_VERSION) { - return std::make_pair(strprintf("v3 tx %s (wtxid=%s) cannot spend from non-v3 tx %s (wtxid=%s)", + return std::make_pair(strprintf("version=3 tx %s (wtxid=%s) cannot spend from non-version=3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), entry->GetSharedTx()->GetHash().ToString(), entry->GetSharedTx()->GetWitnessHash().ToString()), nullptr); @@ -182,20 +182,20 @@ std::optional> SingleV3Checks(const CTra } // This function is specialized for these limits, and must be reimplemented if they ever change. - static_assert(V3_ANCESTOR_LIMIT == 2); - static_assert(V3_DESCENDANT_LIMIT == 2); + static_assert(TRUC_ANCESTOR_LIMIT == 2); + static_assert(TRUC_DESCENDANT_LIMIT == 2); // The rest of the rules only apply to transactions with version=3. if (ptx->version != TRUC_VERSION) return std::nullopt; - if (vsize > V3_MAX_VSIZE) { - return std::make_pair(strprintf("v3 tx %s (wtxid=%s) is too big: %u > %u virtual bytes", - ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), vsize, V3_MAX_VSIZE), + if (vsize > TRUC_MAX_VSIZE) { + return std::make_pair(strprintf("version=3 tx %s (wtxid=%s) is too big: %u > %u virtual bytes", + ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), vsize, TRUC_MAX_VSIZE), nullptr); } - // Check that V3_ANCESTOR_LIMIT would not be violated. - if (mempool_ancestors.size() + 1 > V3_ANCESTOR_LIMIT) { + // Check that TRUC_ANCESTOR_LIMIT would not be violated. + if (mempool_ancestors.size() + 1 > TRUC_ANCESTOR_LIMIT) { return std::make_pair(strprintf("tx %s (wtxid=%s) would have too many ancestors", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString()), nullptr); @@ -203,10 +203,10 @@ std::optional> SingleV3Checks(const CTra // Remaining checks only pertain to transactions with unconfirmed ancestors. if (mempool_ancestors.size() > 0) { - // If this transaction spends V3 parents, it cannot be too large. - if (vsize > V3_CHILD_MAX_VSIZE) { - return std::make_pair(strprintf("v3 child tx %s (wtxid=%s) is too big: %u > %u virtual bytes", - ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), vsize, V3_CHILD_MAX_VSIZE), + // If this transaction spends TRUC parents, it cannot be too large. + if (vsize > TRUC_CHILD_MAX_VSIZE) { + return std::make_pair(strprintf("version=3 child tx %s (wtxid=%s) is too big: %u > %u virtual bytes", + ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), vsize, TRUC_CHILD_MAX_VSIZE), nullptr); } @@ -217,14 +217,14 @@ std::optional> SingleV3Checks(const CTra // possible through a reorg. const auto& children = parent_entry->GetMemPoolChildrenConst(); // Don't double-count a transaction that is going to be replaced. This logic assumes that - // any descendant of the V3 transaction is a direct child, which makes sense because a V3 - // transaction can only have 1 descendant. + // any descendant of the TRUC transaction is a direct child, which makes sense because a + // TRUC transaction can only have 1 descendant. const bool child_will_be_replaced = !children.empty() && std::any_of(children.cbegin(), children.cend(), [&direct_conflicts](const CTxMemPoolEntry& child){return direct_conflicts.count(child.GetTx().GetHash()) > 0;}); - if (parent_entry->GetCountWithDescendants() + 1 > V3_DESCENDANT_LIMIT && !child_will_be_replaced) { - // Allow sibling eviction for v3 transaction: if another child already exists, even if - // we don't conflict inputs with it, consider evicting it under RBF rules. We rely on v3 rules + if (parent_entry->GetCountWithDescendants() + 1 > TRUC_DESCENDANT_LIMIT && !child_will_be_replaced) { + // Allow sibling eviction for TRUC transaction: if another child already exists, even if + // we don't conflict inputs with it, consider evicting it under RBF rules. We rely on TRUC rules // only permitting 1 descendant, as otherwise we would need to have logic for deciding // which descendant to evict. Skip if this isn't true, e.g. if the transaction has // multiple children or the sibling also has descendants due to a reorg. diff --git a/src/policy/truc_policy.h b/src/policy/truc_policy.h new file mode 100644 index 00000000000..dbc77696c67 --- /dev/null +++ b/src/policy/truc_policy.h @@ -0,0 +1,94 @@ +// Copyright (c) 2022 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_POLICY_TRUC_POLICY_H +#define BITCOIN_POLICY_TRUC_POLICY_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +// This module enforces rules for BIP 431 TRUC transactions which help make +// RBF abilities more robust. A transaction with version=3 is treated as TRUC. +static constexpr decltype(CTransaction::version) TRUC_VERSION{3}; + +// TRUC only allows 1 parent and 1 child when unconfirmed. This translates to a descendant set size +// of 2 and ancestor set size of 2. +/** Maximum number of transactions including an unconfirmed tx and its descendants. */ +static constexpr unsigned int TRUC_DESCENDANT_LIMIT{2}; +/** Maximum number of transactions including a TRUC tx and all its mempool ancestors. */ +static constexpr unsigned int TRUC_ANCESTOR_LIMIT{2}; + +/** Maximum sigop-adjusted virtual size of all v3 transactions. */ +static constexpr int64_t TRUC_MAX_VSIZE{10000}; +/** Maximum sigop-adjusted virtual size of a tx which spends from an unconfirmed TRUC transaction. */ +static constexpr int64_t TRUC_CHILD_MAX_VSIZE{1000}; +// These limits are within the default ancestor/descendant limits. +static_assert(TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE <= DEFAULT_ANCESTOR_SIZE_LIMIT_KVB * 1000); +static_assert(TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE <= DEFAULT_DESCENDANT_SIZE_LIMIT_KVB * 1000); + +/** Must be called for every transaction, even if not TRUC. Not strictly necessary for transactions + * accepted through AcceptMultipleTransactions. + * + * Checks the following rules: + * 1. A TRUC tx must only have TRUC unconfirmed ancestors. + * 2. A non-TRUC tx must only have non-TRUC unconfirmed ancestors. + * 3. A TRUC's ancestor set, including itself, must be within TRUC_ANCESTOR_LIMIT. + * 4. A TRUC's descendant set, including itself, must be within TRUC_DESCENDANT_LIMIT. + * 5. If a TRUC tx has any unconfirmed ancestors, the tx's sigop-adjusted vsize must be within + * TRUC_CHILD_MAX_VSIZE. + * 6. A TRUC tx must be within TRUC_MAX_VSIZE. + * + * + * @param[in] mempool_ancestors The in-mempool ancestors of ptx. + * @param[in] direct_conflicts In-mempool transactions this tx conflicts with. These conflicts + * are used to more accurately calculate the resulting descendant + * count of in-mempool ancestors. + * @param[in] vsize The sigop-adjusted virtual size of ptx. + * + * @returns 3 possibilities: + * - std::nullopt if all TRUC checks were applied successfully + * - debug string + pointer to a mempool sibling if this transaction would be the second child in a + * 1-parent-1-child cluster; the caller may consider evicting the specified sibling or return an + * error with the debug string. + * - debug string + nullptr if this transaction violates some TRUC rule and sibling eviction is not + * applicable. + */ +std::optional> SingleTRUCChecks(const CTransactionRef& ptx, + const CTxMemPool::setEntries& mempool_ancestors, + const std::set& direct_conflicts, + int64_t vsize); + +/** Must be called for every transaction that is submitted within a package, even if not TRUC. + * + * For each transaction in a package: + * If it's not a TRUC transaction, verify it has no direct TRUC parents in the mempool or the package. + + * If it is a TRUC transaction, verify that any direct parents in the mempool or the package are TRUC. + * If such a parent exists, verify that parent has no other children in the package or the mempool, + * and that the transaction itself has no children in the package. + * + * If any TRUC violations in the package exist, this test will fail for one of them: + * - if a TRUC transaction T has a parent in the mempool and a child in the package, then PTRUCC(T) will fail + * - if a TRUC transaction T has a parent in the package and a child in the package, then PTRUCC(T) will fail + * - if a TRUC transaction T and a TRUC (sibling) transaction U have some parent in the mempool, + * then PTRUCC(T) and PTRUCC(U) will fail + * - if a TRUC transaction T and a TRUC (sibling) transaction U have some parent in the package, + * then PTRUCC(T) and PTRUCC(U) will fail + * - if a TRUC transaction T has a parent P and a grandparent G in the package, then + * PTRUCC(P) will fail (though PTRUCC(G) and PTRUCC(T) might succeed). + * + * @returns debug string if an error occurs, std::nullopt otherwise. + * */ +std::optional PackageTRUCChecks(const CTransactionRef& ptx, int64_t vsize, + const Package& package, + const CTxMemPool::setEntries& mempool_ancestors); + +#endif // BITCOIN_POLICY_TRUC_POLICY_H diff --git a/src/policy/v3_policy.h b/src/policy/v3_policy.h deleted file mode 100644 index 90eaeda46f1..00000000000 --- a/src/policy/v3_policy.h +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2022 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_POLICY_V3_POLICY_H -#define BITCOIN_POLICY_V3_POLICY_H - -#include -#include -#include -#include -#include -#include - -#include -#include - -// This module enforces rules for BIP 431 TRUC transactions (with version=3) which help make -// RBF abilities more robust. -static constexpr decltype(CTransaction::version) TRUC_VERSION{3}; - -// v3 only allows 1 parent and 1 child when unconfirmed. -/** Maximum number of transactions including an unconfirmed tx and its descendants. */ -static constexpr unsigned int V3_DESCENDANT_LIMIT{2}; -/** Maximum number of transactions including a V3 tx and all its mempool ancestors. */ -static constexpr unsigned int V3_ANCESTOR_LIMIT{2}; - -/** Maximum sigop-adjusted virtual size of all v3 transactions. */ -static constexpr int64_t V3_MAX_VSIZE{10000}; -/** Maximum sigop-adjusted virtual size of a tx which spends from an unconfirmed v3 transaction. */ -static constexpr int64_t V3_CHILD_MAX_VSIZE{1000}; -// These limits are within the default ancestor/descendant limits. -static_assert(V3_MAX_VSIZE + V3_CHILD_MAX_VSIZE <= DEFAULT_ANCESTOR_SIZE_LIMIT_KVB * 1000); -static_assert(V3_MAX_VSIZE + V3_CHILD_MAX_VSIZE <= DEFAULT_DESCENDANT_SIZE_LIMIT_KVB * 1000); - -/** Must be called for every transaction, even if not v3. Not strictly necessary for transactions - * accepted through AcceptMultipleTransactions. - * - * Checks the following rules: - * 1. A v3 tx must only have v3 unconfirmed ancestors. - * 2. A non-v3 tx must only have non-v3 unconfirmed ancestors. - * 3. A v3's ancestor set, including itself, must be within V3_ANCESTOR_LIMIT. - * 4. A v3's descendant set, including itself, must be within V3_DESCENDANT_LIMIT. - * 5. If a v3 tx has any unconfirmed ancestors, the tx's sigop-adjusted vsize must be within - * V3_CHILD_MAX_VSIZE. - * 6. A v3 tx must be within V3_MAX_VSIZE. - * - * - * @param[in] mempool_ancestors The in-mempool ancestors of ptx. - * @param[in] direct_conflicts In-mempool transactions this tx conflicts with. These conflicts - * are used to more accurately calculate the resulting descendant - * count of in-mempool ancestors. - * @param[in] vsize The sigop-adjusted virtual size of ptx. - * - * @returns 3 possibilities: - * - std::nullopt if all v3 checks were applied successfully - * - debug string + pointer to a mempool sibling if this transaction would be the second child in a - * 1-parent-1-child cluster; the caller may consider evicting the specified sibling or return an - * error with the debug string. - * - debug string + nullptr if this transaction violates some v3 rule and sibling eviction is not - * applicable. - */ -std::optional> SingleV3Checks(const CTransactionRef& ptx, - const CTxMemPool::setEntries& mempool_ancestors, - const std::set& direct_conflicts, - int64_t vsize); - -/** Must be called for every transaction that is submitted within a package, even if not v3. - * - * For each transaction in a package: - * If it's not a v3 transaction, verify it has no direct v3 parents in the mempool or the package. - - * If it is a v3 transaction, verify that any direct parents in the mempool or the package are v3. - * If such a parent exists, verify that parent has no other children in the package or the mempool, - * and that the transaction itself has no children in the package. - * - * If any v3 violations in the package exist, this test will fail for one of them: - * - if a v3 transaction T has a parent in the mempool and a child in the package, then PV3C(T) will fail - * - if a v3 transaction T has a parent in the package and a child in the package, then PV3C(T) will fail - * - if a v3 transaction T and a v3 (sibling) transaction U have some parent in the mempool, - * then PV3C(T) and PV3C(U) will fail - * - if a v3 transaction T and a v3 (sibling) transaction U have some parent in the package, - * then PV3C(T) and PV3C(U) will fail - * - if a v3 transaction T has a parent P and a grandparent G in the package, then - * PV3C(P) will fail (though PV3C(G) and PV3C(T) might succeed). - * - * @returns debug string if an error occurs, std::nullopt otherwise. - * */ -std::optional PackageV3Checks(const CTransactionRef& ptx, int64_t vsize, - const Package& package, - const CTxMemPool::setEntries& mempool_ancestors); - -#endif // BITCOIN_POLICY_V3_POLICY_H diff --git a/src/test/fuzz/package_eval.cpp b/src/test/fuzz/package_eval.cpp index 53aedf23ea6..652c7a7609f 100644 --- a/src/test/fuzz/package_eval.cpp +++ b/src/test/fuzz/package_eval.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -225,7 +225,7 @@ FUZZ_TARGET(tx_package_eval, .init = initialize_tx_pool) tx_mut.vin.emplace_back(); } - // Make a p2pk output to make sigops adjusted vsize to violate v3, potentially, which is never spent + // Make a p2pk output to make sigops adjusted vsize to violate TRUC rules, potentially, which is never spent if (last_tx && amount_in > 1000 && fuzzed_data_provider.ConsumeBool()) { tx_mut.vout.emplace_back(1000, CScript() << std::vector(33, 0x02) << OP_CHECKSIG); // Don't add any other outputs. @@ -320,7 +320,7 @@ FUZZ_TARGET(tx_package_eval, .init = initialize_tx_pool) Assert(result_package.m_tx_results.size() == txs.size() || result_package.m_tx_results.empty()); } - CheckMempoolV3Invariants(tx_pool); + CheckMempoolTRUCInvariants(tx_pool); } node.validation_signals->UnregisterSharedValidationInterface(outpoints_updater); diff --git a/src/test/fuzz/tx_pool.cpp b/src/test/fuzz/tx_pool.cpp index b6b91445f97..64861311dbd 100644 --- a/src/test/fuzz/tx_pool.cpp +++ b/src/test/fuzz/tx_pool.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -320,7 +320,7 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool) if (accepted) { Assert(added.size() == 1); // For now, no package acceptance Assert(tx == *added.begin()); - CheckMempoolV3Invariants(tx_pool); + CheckMempoolTRUCInvariants(tx_pool); } else { // Do not consider rejected transaction removed removed.erase(tx); @@ -413,7 +413,7 @@ FUZZ_TARGET(tx_pool, .init = initialize_tx_pool) const bool accepted = res.m_result_type == MempoolAcceptResult::ResultType::VALID; if (accepted) { txids.push_back(tx->GetHash()); - CheckMempoolV3Invariants(tx_pool); + CheckMempoolTRUCInvariants(tx_pool); } } Finish(fuzzed_data_provider, tx_pool, chainstate); diff --git a/src/test/txvalidation_tests.cpp b/src/test/txvalidation_tests.cpp index f429f94a2f0..97b27ef3704 100644 --- a/src/test/txvalidation_tests.cpp +++ b/src/test/txvalidation_tests.cpp @@ -4,9 +4,9 @@ #include #include -#include #include #include +#include #include #include #include