@@ -584,7 +584,7 @@ class PeerManagerImpl final : public PeerManager
584
584
* @param[in] maybe_add_extra_compact_tx Whether this tx should be added to vExtraTxnForCompact.
585
585
* Set to false if the tx has already been rejected before,
586
586
* e.g. is an orphan, to avoid adding duplicate entries.
587
- * Updates m_txrequest, m_recent_rejects, m_recent_rejects_reconsiderable , m_orphanage, and vExtraTxnForCompact. */
587
+ * Updates m_txrequest, m_lazy_recent_rejects, m_lazy_recent_rejects_reconsiderable , m_orphanage, and vExtraTxnForCompact. */
588
588
void ProcessInvalidTx (NodeId nodeid, const CTransactionRef& tx, const TxValidationState& result,
589
589
bool maybe_add_extra_compact_tx)
590
590
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, m_tx_download_mutex);
@@ -776,9 +776,9 @@ class PeerManagerImpl final : public PeerManager
776
776
/* * Synchronizes tx download including TxRequestTracker, rejection filters, and TxOrphanage.
777
777
* Lock invariants:
778
778
* - A txhash (txid or wtxid) in m_txrequest is not also in m_orphanage.
779
- * - A txhash (txid or wtxid) in m_txrequest is not also in m_recent_rejects .
780
- * - A txhash (txid or wtxid) in m_txrequest is not also in m_recent_rejects_reconsiderable .
781
- * - A txhash (txid or wtxid) in m_txrequest is not also in m_recent_confirmed_transactions .
779
+ * - A txhash (txid or wtxid) in m_txrequest is not also in m_lazy_recent_rejects .
780
+ * - A txhash (txid or wtxid) in m_txrequest is not also in m_lazy_recent_rejects_reconsiderable .
781
+ * - A txhash (txid or wtxid) in m_txrequest is not also in m_lazy_recent_confirmed_transactions .
782
782
* - Each data structure's limits hold (m_orphanage max size, m_txrequest per-peer limits, etc).
783
783
*/
784
784
Mutex m_tx_download_mutex ACQUIRED_BEFORE (m_mempool.cs);
@@ -856,9 +856,9 @@ class PeerManagerImpl final : public PeerManager
856
856
/* * Check whether we already have this gtxid in:
857
857
* - mempool
858
858
* - orphanage
859
- * - m_recent_rejects
860
- * - m_recent_rejects_reconsiderable (if include_reconsiderable = true)
861
- * - m_recent_confirmed_transactions
859
+ * - m_lazy_recent_rejects
860
+ * - m_lazy_recent_rejects_reconsiderable (if include_reconsiderable = true)
861
+ * - m_lazy_recent_confirmed_transactions
862
862
* */
863
863
bool AlreadyHaveTx (const GenTxid& gtxid, bool include_reconsiderable)
864
864
EXCLUSIVE_LOCKS_REQUIRED(m_tx_download_mutex);
@@ -897,17 +897,17 @@ class PeerManagerImpl final : public PeerManager
897
897
*
898
898
* Memory used: 1.3 MB
899
899
*/
900
- std::unique_ptr<CRollingBloomFilter> m_recent_rejects GUARDED_BY (m_tx_download_mutex){nullptr };
900
+ std::unique_ptr<CRollingBloomFilter> m_lazy_recent_rejects GUARDED_BY (m_tx_download_mutex){nullptr };
901
901
902
902
CRollingBloomFilter& RecentRejectsFilter () EXCLUSIVE_LOCKS_REQUIRED(m_tx_download_mutex)
903
903
{
904
904
AssertLockHeld (m_tx_download_mutex);
905
905
906
- if (!m_recent_rejects ) {
907
- m_recent_rejects = std::make_unique<CRollingBloomFilter>(120'000 , 0.000'001 );
906
+ if (!m_lazy_recent_rejects ) {
907
+ m_lazy_recent_rejects = std::make_unique<CRollingBloomFilter>(120'000 , 0.000'001 );
908
908
}
909
909
910
- return *m_recent_rejects ;
910
+ return *m_lazy_recent_rejects ;
911
911
}
912
912
913
913
/* *
@@ -916,7 +916,7 @@ class PeerManagerImpl final : public PeerManager
916
916
* eligible for reconsideration if submitted with other transactions.
917
917
* (2) packages (see GetPackageHash) we have already rejected before and should not retry.
918
918
*
919
- * Similar to m_recent_rejects , this filter is used to save bandwidth when e.g. all of our peers
919
+ * Similar to m_lazy_recent_rejects , this filter is used to save bandwidth when e.g. all of our peers
920
920
* have larger mempools and thus lower minimum feerates than us.
921
921
*
922
922
* When a transaction's error is TxValidationResult::TX_RECONSIDERABLE (in a package or by
@@ -928,19 +928,19 @@ class PeerManagerImpl final : public PeerManager
928
928
*
929
929
* Reset this filter when the chain tip changes.
930
930
*
931
- * Parameters are picked to be the same as m_recent_rejects , with the same rationale.
931
+ * Parameters are picked to be the same as m_lazy_recent_rejects , with the same rationale.
932
932
*/
933
- std::unique_ptr<CRollingBloomFilter> m_recent_rejects_reconsiderable GUARDED_BY (m_tx_download_mutex){nullptr };
933
+ std::unique_ptr<CRollingBloomFilter> m_lazy_recent_rejects_reconsiderable GUARDED_BY (m_tx_download_mutex){nullptr };
934
934
935
935
CRollingBloomFilter& RecentRejectsReconsiderableFilter () EXCLUSIVE_LOCKS_REQUIRED(m_tx_download_mutex)
936
936
{
937
937
AssertLockHeld (m_tx_download_mutex);
938
938
939
- if (!m_recent_rejects_reconsiderable ) {
940
- m_recent_rejects_reconsiderable = std::make_unique<CRollingBloomFilter>(120'000 , 0.000'001 );
939
+ if (!m_lazy_recent_rejects_reconsiderable ) {
940
+ m_lazy_recent_rejects_reconsiderable = std::make_unique<CRollingBloomFilter>(120'000 , 0.000'001 );
941
941
}
942
942
943
- return *m_recent_rejects_reconsiderable ;
943
+ return *m_lazy_recent_rejects_reconsiderable ;
944
944
}
945
945
946
946
/*
@@ -958,17 +958,17 @@ class PeerManagerImpl final : public PeerManager
958
958
* transaction per day that would be inadvertently ignored (which is the
959
959
* same probability that we have in the reject filter).
960
960
*/
961
- std::unique_ptr<CRollingBloomFilter> m_recent_confirmed_transactions GUARDED_BY (m_tx_download_mutex){nullptr };
961
+ std::unique_ptr<CRollingBloomFilter> m_lazy_recent_confirmed_transactions GUARDED_BY (m_tx_download_mutex){nullptr };
962
962
963
963
CRollingBloomFilter& RecentConfirmedTransactionsFilter () EXCLUSIVE_LOCKS_REQUIRED(m_tx_download_mutex)
964
964
{
965
965
AssertLockHeld (m_tx_download_mutex);
966
966
967
- if (!m_recent_confirmed_transactions ) {
968
- m_recent_confirmed_transactions = std::make_unique<CRollingBloomFilter>(48'000 , 0.000'001 );
967
+ if (!m_lazy_recent_confirmed_transactions ) {
968
+ m_lazy_recent_confirmed_transactions = std::make_unique<CRollingBloomFilter>(48'000 , 0.000'001 );
969
969
}
970
970
971
- return *m_recent_confirmed_transactions ;
971
+ return *m_lazy_recent_confirmed_transactions ;
972
972
}
973
973
974
974
/* *
@@ -3225,7 +3225,7 @@ void PeerManagerImpl::ProcessInvalidTx(NodeId nodeid, const CTransactionRef& ptx
3225
3225
// for concerns around weakening security of unupgraded nodes
3226
3226
// if we start doing this too early.
3227
3227
if (state.GetResult () == TxValidationResult::TX_RECONSIDERABLE) {
3228
- // If the result is TX_RECONSIDERABLE, add it to m_recent_rejects_reconsiderable
3228
+ // If the result is TX_RECONSIDERABLE, add it to m_lazy_recent_rejects_reconsiderable
3229
3229
// because we should not download or submit this transaction by itself again, but may
3230
3230
// submit it as part of a package later.
3231
3231
RecentRejectsReconsiderableFilter ().insert (ptx->GetWitnessHash ().ToUint256 ());
@@ -3389,7 +3389,7 @@ std::optional<PeerManagerImpl::PackageToValidate> PeerManagerImpl::Find1P1CPacka
3389
3389
3390
3390
for (const auto index : tx_indices) {
3391
3391
// If we already tried a package and failed for any reason, the combined hash was
3392
- // cached in m_recent_rejects_reconsiderable .
3392
+ // cached in m_lazy_recent_rejects_reconsiderable .
3393
3393
const auto [child_tx, child_sender] = cpfp_candidates_different_peer.at (index );
3394
3394
Package maybe_cpfp_package{ptx, child_tx};
3395
3395
if (!RecentRejectsReconsiderableFilter ().contains (GetPackageHash (maybe_cpfp_package))) {
@@ -4585,7 +4585,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4585
4585
}
4586
4586
4587
4587
if (RecentRejectsReconsiderableFilter ().contains (wtxid)) {
4588
- // When a transaction is already in m_recent_rejects_reconsiderable , we shouldn't submit
4588
+ // When a transaction is already in m_lazy_recent_rejects_reconsiderable , we shouldn't submit
4589
4589
// it by itself again. However, look for a matching child in the orphanage, as it is
4590
4590
// possible that they succeed as a package.
4591
4591
LogPrint (BCLog::TXPACKAGES, " found tx %s (wtxid=%s) in reconsiderable rejects, looking for child in orphanage\n " ,
@@ -4597,20 +4597,20 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4597
4597
ProcessPackageResult (package_to_validate.value (), package_result);
4598
4598
}
4599
4599
}
4600
- // If a tx is detected by m_recent_rejects it is ignored. Because we haven't
4600
+ // If a tx is detected by m_lazy_recent_rejects it is ignored. Because we haven't
4601
4601
// submitted the tx to our mempool, we won't have computed a DoS
4602
4602
// score for it or determined exactly why we consider it invalid.
4603
4603
//
4604
4604
// This means we won't penalize any peer subsequently relaying a DoSy
4605
4605
// tx (even if we penalized the first peer who gave it to us) because
4606
- // we have to account for m_recent_rejects showing false positives. In
4606
+ // we have to account for m_lazy_recent_rejects showing false positives. In
4607
4607
// other words, we shouldn't penalize a peer if we aren't *sure* they
4608
4608
// submitted a DoSy tx.
4609
4609
//
4610
- // Note that m_recent_rejects doesn't just record DoSy or invalid
4610
+ // Note that m_lazy_recent_rejects doesn't just record DoSy or invalid
4611
4611
// transactions, but any tx not accepted by the mempool, which may be
4612
4612
// due to node policy (vs. consensus). So we can't blanket penalize a
4613
- // peer simply for relaying a tx that our m_recent_rejects has caught,
4613
+ // peer simply for relaying a tx that our m_lazy_recent_rejects has caught,
4614
4614
// regardless of false positives.
4615
4615
return ;
4616
4616
}
@@ -4637,16 +4637,16 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4637
4637
std::sort (unique_parents.begin (), unique_parents.end ());
4638
4638
unique_parents.erase (std::unique (unique_parents.begin (), unique_parents.end ()), unique_parents.end ());
4639
4639
4640
- // Distinguish between parents in m_recent_rejects and m_recent_rejects_reconsiderable .
4641
- // We can tolerate having up to 1 parent in m_recent_rejects_reconsiderable since we
4642
- // submit 1p1c packages. However, fail immediately if any are in m_recent_rejects .
4640
+ // Distinguish between parents in m_lazy_recent_rejects and m_lazy_recent_rejects_reconsiderable .
4641
+ // We can tolerate having up to 1 parent in m_lazy_recent_rejects_reconsiderable since we
4642
+ // submit 1p1c packages. However, fail immediately if any are in m_lazy_recent_rejects .
4643
4643
std::optional<uint256> rejected_parent_reconsiderable;
4644
4644
for (const uint256& parent_txid : unique_parents) {
4645
4645
if (RecentRejectsFilter ().contains (parent_txid)) {
4646
4646
fRejectedParents = true ;
4647
4647
break ;
4648
4648
} else if (RecentRejectsReconsiderableFilter ().contains (parent_txid) && !m_mempool.exists (GenTxid::Txid (parent_txid))) {
4649
- // More than 1 parent in m_recent_rejects_reconsiderable : 1p1c will not be
4649
+ // More than 1 parent in m_lazy_recent_rejects_reconsiderable : 1p1c will not be
4650
4650
// sufficient to accept this package, so just give up here.
4651
4651
if (rejected_parent_reconsiderable.has_value ()) {
4652
4652
fRejectedParents = true ;
@@ -4666,7 +4666,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4666
4666
// protocol for getting all unconfirmed parents.
4667
4667
const auto gtxid{GenTxid::Txid (parent_txid)};
4668
4668
AddKnownTx (*peer, parent_txid);
4669
- // Exclude m_recent_rejects_reconsiderable : the missing parent may have been
4669
+ // Exclude m_lazy_recent_rejects_reconsiderable : the missing parent may have been
4670
4670
// previously rejected for being too low feerate. This orphan might CPFP it.
4671
4671
if (!AlreadyHaveTx (gtxid, /* include_reconsiderable=*/ false )) AddTxAnnouncement (pfrom, gtxid, current_time);
4672
4672
}
@@ -6339,7 +6339,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
6339
6339
entry.second .GetHash ().ToString (), entry.first );
6340
6340
}
6341
6341
for (const GenTxid& gtxid : requestable) {
6342
- // Exclude m_recent_rejects_reconsiderable : we may be requesting a missing parent
6342
+ // Exclude m_lazy_recent_rejects_reconsiderable : we may be requesting a missing parent
6343
6343
// that was previously rejected for being too low feerate.
6344
6344
if (!AlreadyHaveTx (gtxid, /* include_reconsiderable=*/ false )) {
6345
6345
LogPrint (BCLog::NET, " Requesting %s %s peer=%d\n " , gtxid.IsWtxid () ? " wtx" : " tx" ,
0 commit comments