-
Notifications
You must be signed in to change notification settings - Fork 37.7k
refactor: policy: Pass kernel::MemPoolOptions to IsStandard[Tx] rather than long list of individual options #30232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…r than long list of individual options
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
https://github.com/bitcoin/bitcoin/pull/30232/checks?check_run_id=25845075037: A new circular dependency in the form of "kernel/mempool_options -> policy/policy -> kernel/mempool_options" appears to have been introduced. |
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
How do you propose resolving this? It's not really a circular dependency, just equivocated as such due to the CI test stripping file extensions, but maybe there's a better approach that just fixing CI? |
Mind providing some motivation for the refactor? PR description is empty |
Besides making the code cleaner, I'm hoping to get to a point where it's practical to fix the remaining vsize bugs. |
The policy header include should probably be removed from mempool_options. Any policy settings defaults that can be modified should be included in the corresponding header file itself. (This is also true for the other default values in the
|
E.g.: commit 94ed6bf4575abee5200e7fc7054a47d66bebd56c
Author: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
Date: Wed Jul 3 18:05:21 2024 +0200
move-only: Default values in MemPoolLimits
diff --git a/src/kernel/mempool_limits.h b/src/kernel/mempool_limits.h
index 8d4495c3cb..eeeaedd233 100644
--- a/src/kernel/mempool_limits.h
+++ b/src/kernel/mempool_limits.h
@@ -4,9 +4,17 @@
#ifndef BITCOIN_KERNEL_MEMPOOL_LIMITS_H
#define BITCOIN_KERNEL_MEMPOOL_LIMITS_H
-#include <policy/policy.h>
-
#include <cstdint>
+#include <limits>
+
+/** Default for -limitancestorcount, max number of in-mempool ancestors */
+static constexpr unsigned int DEFAULT_ANCESTOR_LIMIT{25};
+/** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors */
+static constexpr unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT_KVB{101};
+/** Default for -limitdescendantcount, max number of in-mempool descendants */
+static constexpr unsigned int DEFAULT_DESCENDANT_LIMIT{25};
+/** Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants */
+static constexpr unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT_KVB{101};
namespace kernel {
/**
diff --git a/src/policy/packages.h b/src/policy/packages.h
index 3050320122..ce84d5a9e1 100644
--- a/src/policy/packages.h
+++ b/src/policy/packages.h
@@ -7,6 +7,7 @@
#include <consensus/consensus.h>
#include <consensus/validation.h>
+#include <kernel/mempool_limits.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <util/hasher.h>
diff --git a/src/policy/policy.h b/src/policy/policy.h
index 9cdb8ab767..a39f8930ea 100644
--- a/src/policy/policy.h
+++ b/src/policy/policy.h
@@ -51,14 +51,6 @@ static constexpr unsigned int MAX_STANDARD_SCRIPTSIG_SIZE{1650};
static constexpr unsigned int DUST_RELAY_TX_FEE{3000};
/** Default for -minrelaytxfee, minimum relay fee for transactions */
static constexpr unsigned int DEFAULT_MIN_RELAY_TX_FEE{1000};
-/** Default for -limitancestorcount, max number of in-mempool ancestors */
-static constexpr unsigned int DEFAULT_ANCESTOR_LIMIT{25};
-/** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors */
-static constexpr unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT_KVB{101};
-/** Default for -limitdescendantcount, max number of in-mempool descendants */
-static constexpr unsigned int DEFAULT_DESCENDANT_LIMIT{25};
-/** Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants */
-static constexpr unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT_KVB{101};
/** Default for -datacarrier */
static const bool DEFAULT_ACCEPT_DATACARRIER = true;
/** |
Seems more like kernel shouldn't have policy stuff at all, but that's out of scope for this PR. Added your commit |
IIRC the kernel will ship with the mempool, so it'll need to ship with policy. In any case, my commit was just for mempool_limits. The same would have to be done for |
Are you still working on this? |
This PR does not seem to have attracted much attention from reviewers. As such, it does not seem important enough right now to keep it sitting idle in the list of open PRs. The motivation is vague/missing. Closing due to lack of interest. |
…r than long list of individual options Github-Pull: bitcoin#30232 Rebased-From: d4c3c2e
…r than long list of individual options Github-Pull: bitcoin#30232 Rebased-From: d4c3c2e
…r than long list of individual options Github-Pull: bitcoin#30232 Rebased-From: d4c3c2e
No description provided.