aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/txmempool.cpp
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-07-02 17:49:32 -0400
committerAva Chow <github@achow101.com>2024-07-02 17:49:32 -0400
commit3325a0afa45ee88c9e859f1002183f1bd61868da (patch)
tree9fd7c07e064f118ce45b476fb399629d23f83757 /src/test/util/txmempool.cpp
parent9251bc71110412ff248ee99fbb215d84b60c8c7c (diff)
parent926b8e39dcbc0a3a8a75ef0a29bdca2bf738d746 (diff)
downloadbitcoin-3325a0afa45ee88c9e859f1002183f1bd61868da.tar.xz
Merge bitcoin/bitcoin#30272: doc: use TRUC instead of v3 and add release note
926b8e39dcbc0a3a8a75ef0a29bdca2bf738d746 [doc] add release note for TRUC (glozow) 19a9b90617419f68d0f1c90ee115b5220be99a16 use version=3 instead of v3 in debug strings (glozow) 881fac8e609be17eb71bd9a54c0284b304e2e2e2 scripted-diff: change names from V3 to TRUC (glozow) a573dd261748d2a80560f73db08f7dca788c7fcf [doc] replace mentions of v3 with TRUC (glozow) 089b5757dff39a9a06cdb625aaced9beeb72958d rename mempool_accept_v3.py to mempool_truc.py (glozow) f543852a89d93441645250c40c3980aeb0c3b664 rename policy/v3_policy.* to policy/truc_policy.* (glozow) Pull request description: Adds a release note for TRUC policy which will be live in v28.0. For clarity, replaces mentions of "v3" with "TRUC" in most places. Suggested in - https://github.com/bitcoin/bitcoin/pull/29496#discussion_r1629749583 - https://github.com/bitcoin/bitcoin/pull/29496#discussion_r1624500904 I changed error strings from "v3-violation" to "TRUC-violation" but left v3 in the debug strings because I think it might be clearer for somebody who is debugging. Similarly, I left some variables unchanged because I think they're more descriptive this way, e.g. `tx_v3_from_v2_and_v3`. I'm happy to debate places that should or shouldn't be documented differently in this PR, whatever is clearest to everyone. ACKs for top commit: instagibbs: reACK https://github.com/bitcoin/bitcoin/pull/30272/commits/926b8e39dcbc0a3a8a75ef0a29bdca2bf738d746 achow101: ACK 926b8e39dcbc0a3a8a75ef0a29bdca2bf738d746 ismaelsadeeq: Code review ACK 926b8e39dcbc0a3a8a75ef0a29bdca2bf738d746 Tree-SHA512: 16c88add0a29dc6d1236c4d45f34a17b850f6727b231953cbd52eb9f7268d1d802563eadfc8b7928c94ed3d7a615275dd103e57e81439ebf3ba2b12efa1e42af
Diffstat (limited to 'src/test/util/txmempool.cpp')
-rw-r--r--src/test/util/txmempool.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/test/util/txmempool.cpp b/src/test/util/txmempool.cpp
index 94d50bba50..9d6b4810d0 100644
--- a/src/test/util/txmempool.cpp
+++ b/src/test/util/txmempool.cpp
@@ -8,7 +8,7 @@
#include <node/context.h>
#include <node/mempool_args.h>
#include <policy/rbf.h>
-#include <policy/v3_policy.h>
+#include <policy/truc_policy.h>
#include <txmempool.h>
#include <util/check.h>
#include <util/time.h>
@@ -141,30 +141,30 @@ std::optional<std::string> CheckPackageMempoolAcceptResult(const Package& txns,
return std::nullopt;
}
-void CheckMempoolV3Invariants(const CTxMemPool& tx_pool)
+void CheckMempoolTRUCInvariants(const CTxMemPool& tx_pool)
{
LOCK(tx_pool.cs);
for (const auto& tx_info : tx_pool.infoAll()) {
const auto& entry = *Assert(tx_pool.GetEntry(tx_info.tx->GetHash()));
if (tx_info.tx->version == TRUC_VERSION) {
// Check that special maximum virtual size is respected
- Assert(entry.GetTxSize() <= V3_MAX_VSIZE);
+ Assert(entry.GetTxSize() <= TRUC_MAX_VSIZE);
- // Check that special v3 ancestor/descendant limits and rules are always respected
- Assert(entry.GetCountWithDescendants() <= V3_DESCENDANT_LIMIT);
- Assert(entry.GetCountWithAncestors() <= V3_ANCESTOR_LIMIT);
- Assert(entry.GetSizeWithDescendants() <= V3_MAX_VSIZE + V3_CHILD_MAX_VSIZE);
- Assert(entry.GetSizeWithAncestors() <= V3_MAX_VSIZE + V3_CHILD_MAX_VSIZE);
+ // Check that special TRUC ancestor/descendant limits and rules are always respected
+ Assert(entry.GetCountWithDescendants() <= TRUC_DESCENDANT_LIMIT);
+ Assert(entry.GetCountWithAncestors() <= TRUC_ANCESTOR_LIMIT);
+ Assert(entry.GetSizeWithDescendants() <= TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE);
+ Assert(entry.GetSizeWithAncestors() <= TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE);
// If this transaction has at least 1 ancestor, it's a "child" and has restricted weight.
if (entry.GetCountWithAncestors() > 1) {
- Assert(entry.GetTxSize() <= V3_CHILD_MAX_VSIZE);
- // All v3 transactions must only have v3 unconfirmed parents.
+ Assert(entry.GetTxSize() <= TRUC_CHILD_MAX_VSIZE);
+ // All TRUC transactions must only have TRUC unconfirmed parents.
const auto& parents = entry.GetMemPoolParentsConst();
Assert(parents.begin()->get().GetSharedTx()->version == TRUC_VERSION);
}
} else if (entry.GetCountWithAncestors() > 1) {
- // All non-v3 transactions must only have non-v3 unconfirmed parents.
+ // All non-TRUC transactions must only have non-TRUC unconfirmed parents.
for (const auto& parent : entry.GetMemPoolParentsConst()) {
Assert(parent.get().GetSharedTx()->version != TRUC_VERSION);
}