Remove ancestor and descendant vsize limits from MemPoolLimits
What changed, and why it matters
This commit removes two size-based controls from Bitcoin Core's memory pool (mempool) settings: the maximum virtual-byte size of an ancestor package and of a descendant package. It is a code cleanup that follows earlier work to replace those limits with a single 'cluster size' limit. There is no indication in the commit that this fixes a security bug; it appears to be a refactoring change.
No security action required. Treat as a normal refactoring/cleanup commit. Operators who previously relied on `-limitancestorsize` or `-limitdescendantsize` should note those options are no longer wired to mempool policy in this version.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the ancestor_size_vbytes and descendant_size_vbytes fields from kernel::MemPoolLimits, stops reading the -limitancestorsize and -limitdescendantsize command-line options, and removes the corresponding fuzz-test inputs. The remaining limits are transaction count (ancestor_count, descendant_count) and the newer cluster virtual-size limit (cluster_size_vbytes). No logic that enforces mempool policy is changed beyond removing these struct fields and their argument wiring.
Changed components
src/kernel/mempool_limits.hsrc/node/mempool_args.cppsrc/test/fuzz/package_eval.cppInspect captured patch +1 / −11
diff --git a/src/kernel/mempool_limits.h b/src/kernel/mempool_limits.h
index cbca1790..7ca5d2bc 100644
--- a/src/kernel/mempool_limits.h
+++ b/src/kernel/mempool_limits.h
@@ -22,12 +22,8 @@ struct MemPoolLimits {
int64_t cluster_size_vbytes{DEFAULT_CLUSTER_SIZE_LIMIT_KVB * 1'000};
//! The maximum allowed number of transactions in a package including the entry and its ancestors.
int64_t ancestor_count{DEFAULT_ANCESTOR_LIMIT};
- //! The maximum allowed size in virtual bytes of an entry and its ancestors within a package.
- int64_t ancestor_size_vbytes{DEFAULT_ANCESTOR_SIZE_LIMIT_KVB * 1'000};
//! The maximum allowed number of transactions in a package including the entry and its descendants.
int64_t descendant_count{DEFAULT_DESCENDANT_LIMIT};
- //! The maximum allowed size in virtual bytes of an entry and its descendants within a package.
- int64_t descendant_size_vbytes{DEFAULT_DESCENDANT_SIZE_LIMIT_KVB * 1'000};
/**
* @return MemPoolLimits with all the limits set to the maximum
@@ -35,7 +31,7 @@ struct MemPoolLimits {
static constexpr MemPoolLimits NoLimits()
{
int64_t no_limit{std::numeric_limits<int64_t>::max()};
- return {std::numeric_limits<unsigned>::max(), no_limit, no_limit, no_limit, no_limit, no_limit};
+ return {std::numeric_limits<unsigned>::max(), no_limit, no_limit, no_limit};
}
};
} // namespace kernel
diff --git a/src/node/mempool_args.cpp b/src/node/mempool_args.cpp
index 93b897d5..14ee8405 100644
--- a/src/node/mempool_args.cpp
+++ b/src/node/mempool_args.cpp
@@ -38,11 +38,7 @@ void ApplyArgsManOptions(const ArgsManager& argsman, MemPoolLimits& mempool_limi
mempool_limits.ancestor_count = argsman.GetIntArg("-limitancestorcount", mempool_limits.ancestor_count);
- if (auto vkb = argsman.GetIntArg("-limitancestorsize")) mempool_limits.ancestor_size_vbytes = *vkb * 1'000;
-
mempool_limits.descendant_count = argsman.GetIntArg("-limitdescendantcount", mempool_limits.descendant_count);
-
- if (auto vkb = argsman.GetIntArg("-limitdescendantsize")) mempool_limits.descendant_size_vbytes = *vkb * 1'000;
}
}
diff --git a/src/test/fuzz/package_eval.cpp b/src/test/fuzz/package_eval.cpp
index 3f1eeeb3..db4e4933 100644
--- a/src/test/fuzz/package_eval.cpp
+++ b/src/test/fuzz/package_eval.cpp
@@ -122,9 +122,7 @@ std::unique_ptr<CTxMemPool> MakeMempool(FuzzedDataProvider& fuzzed_data_provider
// ...override specific options for this specific fuzz suite
mempool_opts.limits.ancestor_count = fuzzed_data_provider.ConsumeIntegralInRange<unsigned>(0, 50);
- mempool_opts.limits.ancestor_size_vbytes = fuzzed_data_provider.ConsumeIntegralInRange<unsigned>(0, 202) * 1'000;
mempool_opts.limits.descendant_count = fuzzed_data_provider.ConsumeIntegralInRange<unsigned>(0, 50);
- mempool_opts.limits.descendant_size_vbytes = fuzzed_data_provider.ConsumeIntegralInRange<unsigned>(0, 202) * 1'000;
mempool_opts.max_size_bytes = fuzzed_data_provider.ConsumeIntegralInRange<unsigned>(0, 200) * 1'000'000;
mempool_opts.expiry = std::chrono::hours{fuzzed_data_provider.ConsumeIntegralInRange<unsigned>(0, 999)};
// Only interested in 2 cases: sigop cost 0 or when single legacy sigop cost is >> 1KvB
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.