From b234a843580b9c4db79d6381502cdd920a8896b4 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:51:13 +0000 Subject: [PATCH] net: move CConnman::RelayInv{Filtered} into PeerManager --- src/coinjoin/server.cpp | 2 +- src/dsnotificationinterface.cpp | 5 ++- src/dsnotificationinterface.h | 5 ++- src/governance/governance.cpp | 48 +++++++++++----------- src/governance/governance.h | 20 +++++----- src/governance/object.cpp | 6 +-- src/governance/object.h | 3 +- src/governance/vote.cpp | 6 +-- src/governance/vote.h | 4 +- src/init.cpp | 2 +- src/llmq/blockprocessor.cpp | 8 ++-- src/llmq/blockprocessor.h | 6 ++- src/llmq/chainlocks.cpp | 11 ++--- src/llmq/chainlocks.h | 10 ++--- src/llmq/context.cpp | 4 +- src/llmq/ehf_signals.h | 1 - src/llmq/instantsend.cpp | 4 +- src/net.cpp | 46 --------------------- src/net.h | 10 ----- src/net_processing.cpp | 53 ++++++++++++++++++++++++- src/net_processing.h | 15 +++++++ src/rpc/governance.cpp | 8 ++-- src/rpc/misc.cpp | 4 +- src/spork.cpp | 17 ++++---- src/spork.h | 9 +++-- test/lint/lint-circular-dependencies.sh | 13 ++++-- 26 files changed, 173 insertions(+), 147 deletions(-) diff --git a/src/coinjoin/server.cpp b/src/coinjoin/server.cpp index 868786de38ce24..50c256665b12dc 100644 --- a/src/coinjoin/server.cpp +++ b/src/coinjoin/server.cpp @@ -349,7 +349,7 @@ void CCoinJoinServer::CommitFinalTransaction() LogPrint(BCLog::COINJOIN, "CCoinJoinServer::CommitFinalTransaction -- TRANSMITTING DSTX\n"); CInv inv(MSG_DSTX, hashTx); - RelayInv(connman, inv); + m_peerman->RelayInv(inv); // Tell the clients it was successful RelayCompletedTransaction(MSG_SUCCESS); diff --git a/src/dsnotificationinterface.cpp b/src/dsnotificationinterface.cpp index ac0f116da857e9..f540b151145bed 100644 --- a/src/dsnotificationinterface.cpp +++ b/src/dsnotificationinterface.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -26,6 +27,7 @@ CDSNotificationInterface::CDSNotificationInterface(CConnman& connman, CMasternodeSync& mn_sync, CGovernanceManager& govman, + PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman, const std::unique_ptr& dmnman, const std::unique_ptr& llmq_ctx, @@ -33,6 +35,7 @@ CDSNotificationInterface::CDSNotificationInterface(CConnman& connman, : m_connman(connman), m_mn_sync(mn_sync), m_govman(govman), + m_peerman(peerman), m_mn_activeman(mn_activeman), m_dmnman(dmnman), m_llmq_ctx(llmq_ctx), @@ -96,7 +99,7 @@ void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, con m_llmq_ctx->qdkgsman->UpdatedBlockTip(pindexNew, fInitialDownload); m_llmq_ctx->ehfSignalsHandler->UpdatedBlockTip(pindexNew); - if (!fDisableGovernance) m_govman.UpdatedBlockTip(pindexNew, m_connman, m_mn_activeman); + if (!fDisableGovernance) m_govman.UpdatedBlockTip(pindexNew, m_connman, m_peerman, m_mn_activeman); } void CDSNotificationInterface::TransactionAddedToMempool(const CTransactionRef& ptx, int64_t nAcceptTime) diff --git a/src/dsnotificationinterface.h b/src/dsnotificationinterface.h index 35092ea11a1c8e..b715217ac118e2 100644 --- a/src/dsnotificationinterface.h +++ b/src/dsnotificationinterface.h @@ -12,6 +12,7 @@ class CConnman; class CDeterministicMNManager; class CGovernanceManager; class CMasternodeSync; +class PeerManager; struct CJContext; struct LLMQContext; @@ -21,6 +22,7 @@ class CDSNotificationInterface : public CValidationInterface explicit CDSNotificationInterface(CConnman& connman, CMasternodeSync& mn_sync, CGovernanceManager& govman, + PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman, const std::unique_ptr& dmnman, const std::unique_ptr& llmq_ctx, @@ -45,10 +47,9 @@ class CDSNotificationInterface : public CValidationInterface private: CConnman& m_connman; - CMasternodeSync& m_mn_sync; CGovernanceManager& m_govman; - + PeerManager& m_peerman; const CActiveMasternodeManager* const m_mn_activeman; const std::unique_ptr& m_dmnman; const std::unique_ptr& m_llmq_ctx; diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index 021411112768c2..7b8ad1532a04a1 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -119,7 +119,7 @@ bool CGovernanceManager::SerializeVoteForHash(const uint256& nHash, CDataStream& return cmapVoteToObject.Get(nHash, pGovobj) && pGovobj->GetVoteFile().SerializeVoteToStream(nHash, ss); } -PeerMsgRet CGovernanceManager::ProcessMessage(CNode& peer, CConnman& connman, std::string_view msg_type, CDataStream& vRecv) +PeerMsgRet CGovernanceManager::ProcessMessage(CNode& peer, CConnman& connman, PeerManager& peerman, std::string_view msg_type, CDataStream& vRecv) { if (fDisableGovernance) return {}; if (m_mn_sync == nullptr || !m_mn_sync->IsBlockchainSynced()) return {}; @@ -213,7 +213,7 @@ PeerMsgRet CGovernanceManager::ProcessMessage(CNode& peer, CConnman& connman, st return {}; } - AddGovernanceObject(govobj, connman, &peer); + AddGovernanceObject(govobj, peerman, &peer); } // A NEW GOVERNANCE OBJECT VOTE HAS ARRIVED @@ -248,7 +248,7 @@ PeerMsgRet CGovernanceManager::ProcessMessage(CNode& peer, CConnman& connman, st if (ProcessVote(&peer, vote, exception, connman)) { LogPrint(BCLog::GOBJECT, "MNGOVERNANCEOBJECTVOTE -- %s new\n", strHash); m_mn_sync->BumpAssetLastTime("MNGOVERNANCEOBJECTVOTE"); - vote.Relay(connman, *m_mn_sync, tip_mn_list); + vote.Relay(peerman, *m_mn_sync, tip_mn_list); } else { LogPrint(BCLog::GOBJECT, "MNGOVERNANCEOBJECTVOTE -- Rejected vote, error = %s\n", exception.what()); if ((exception.GetNodePenalty() != 0) && m_mn_sync->IsSynced()) { @@ -260,7 +260,7 @@ PeerMsgRet CGovernanceManager::ProcessMessage(CNode& peer, CConnman& connman, st return {}; } -void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj, CConnman& connman) +void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj, PeerManager& peerman) { uint256 nHash = govobj.GetHash(); std::vector vecVotePairs; @@ -277,7 +277,7 @@ void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj, CConnman& c if (pairVote.second < nNow) { fRemove = true; } else if (govobj.ProcessVote(m_mn_metaman, *this, tip_mn_list, vote, e)) { - vote.Relay(connman, *Assert(m_mn_sync), tip_mn_list); + vote.Relay(peerman, *Assert(m_mn_sync), tip_mn_list); fRemove = true; } if (fRemove) { @@ -286,7 +286,7 @@ void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj, CConnman& c } } -void CGovernanceManager::AddGovernanceObject(CGovernanceObject& govobj, CConnman& connman, const CNode* pfrom) +void CGovernanceManager::AddGovernanceObject(CGovernanceObject& govobj, PeerManager& peerman, const CNode* pfrom) { uint256 nHash = govobj.GetHash(); std::string strHash = nHash.ToString(); @@ -331,7 +331,7 @@ void CGovernanceManager::AddGovernanceObject(CGovernanceObject& govobj, CConnman } LogPrint(BCLog::GOBJECT, "CGovernanceManager::AddGovernanceObject -- %s new, received from peer %s\n", strHash, pfrom ? pfrom->GetLogString() : "nullptr"); - govobj.Relay(connman, *Assert(m_mn_sync)); + govobj.Relay(peerman, *Assert(m_mn_sync)); // Update the rate buffer MasternodeRateUpdate(govobj); @@ -340,7 +340,7 @@ void CGovernanceManager::AddGovernanceObject(CGovernanceObject& govobj, CConnman // WE MIGHT HAVE PENDING/ORPHAN VOTES FOR THIS OBJECT - CheckOrphanVotes(govobj, connman); + CheckOrphanVotes(govobj, peerman); // SEND NOTIFICATION TO SCRIPT/ZMQ GetMainSignals().NotifyGovernanceObject(std::make_shared(govobj.Object())); @@ -672,7 +672,7 @@ std::optional CGovernanceManager::CreateSuperblockCandidate(i return CSuperblock(nNextSuperblock, std::move(payments)); } -std::optional CGovernanceManager::CreateGovernanceTrigger(const std::optional& sb_opt, CConnman& connman, +std::optional CGovernanceManager::CreateGovernanceTrigger(const std::optional& sb_opt, PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman) { if (!fMasternodeMode) return std::nullopt; @@ -718,11 +718,11 @@ std::optional CGovernanceManager::CreateGovernanceTrigg } // The trigger we just created looks good, submit it - AddGovernanceObject(gov_sb, connman); + AddGovernanceObject(gov_sb, peerman); return std::make_optional(gov_sb); } -void CGovernanceManager::VoteGovernanceTriggers(const std::optional& trigger_opt, CConnman& connman, +void CGovernanceManager::VoteGovernanceTriggers(const std::optional& trigger_opt, CConnman& connman, PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman) { // only active masternodes can vote on triggers @@ -736,7 +736,7 @@ void CGovernanceManager::VoteGovernanceTriggers(const std::optionalGetListAtChainTip()); + vote.Relay(peerman, *Assert(m_mn_sync), Assert(m_dmnman)->GetListAtChainTip()); } return fOK; } @@ -1129,7 +1129,7 @@ bool CGovernanceManager::ProcessVote(CNode* pfrom, const CGovernanceVote& vote, return fOk; } -void CGovernanceManager::CheckPostponedObjects(CConnman& connman) +void CGovernanceManager::CheckPostponedObjects(PeerManager& peerman) { if (!Assert(m_mn_sync)->IsSynced()) return; @@ -1146,7 +1146,7 @@ void CGovernanceManager::CheckPostponedObjects(CConnman& connman) bool fMissingConfirmations; if (govobj.IsCollateralValid(strError, fMissingConfirmations)) { if (govobj.IsValidLocally(Assert(m_dmnman)->GetListAtChainTip(), strError, false)) { - AddGovernanceObject(govobj, connman); + AddGovernanceObject(govobj, peerman); } else { LogPrint(BCLog::GOBJECT, "CGovernanceManager::CheckPostponedObjects -- %s invalid\n", nHash.ToString()); } @@ -1179,7 +1179,7 @@ void CGovernanceManager::CheckPostponedObjects(CConnman& connman) if (fValid) { if (fReady) { LogPrint(BCLog::GOBJECT, "CGovernanceManager::CheckPostponedObjects -- additional relay: hash = %s\n", govobj.GetHash().ToString()); - govobj.Relay(connman, *m_mn_sync); + govobj.Relay(peerman, *m_mn_sync); } else { it++; continue; @@ -1474,7 +1474,7 @@ UniValue CGovernanceManager::ToJson() const return jsonObj; } -void CGovernanceManager::UpdatedBlockTip(const CBlockIndex* pindex, CConnman& connman, const CActiveMasternodeManager* const mn_activeman) +void CGovernanceManager::UpdatedBlockTip(const CBlockIndex* pindex, CConnman& connman, PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman) { // Note this gets called from ActivateBestChain without cs_main being held // so it should be safe to lock our mutex here without risking a deadlock @@ -1486,8 +1486,8 @@ void CGovernanceManager::UpdatedBlockTip(const CBlockIndex* pindex, CConnman& co } const auto sb_opt = CreateSuperblockCandidate(pindex->nHeight); - const auto trigger_opt = CreateGovernanceTrigger(sb_opt, connman, mn_activeman); - VoteGovernanceTriggers(trigger_opt, connman, mn_activeman); + const auto trigger_opt = CreateGovernanceTrigger(sb_opt, peerman, mn_activeman); + VoteGovernanceTriggers(trigger_opt, connman, peerman, mn_activeman); nCachedBlockHeight = pindex->nHeight; LogPrint(BCLog::GOBJECT, "CGovernanceManager::UpdatedBlockTip -- nCachedBlockHeight: %d\n", nCachedBlockHeight); @@ -1496,7 +1496,7 @@ void CGovernanceManager::UpdatedBlockTip(const CBlockIndex* pindex, CConnman& co RemoveInvalidVotes(); } - CheckPostponedObjects(connman); + CheckPostponedObjects(peerman); CSuperblockManager::ExecuteBestSuperblock(*this, Assert(m_dmnman)->GetListAtChainTip(), pindex->nHeight); } diff --git a/src/governance/governance.h b/src/governance/governance.h index cad15d52aa37d4..9cfe0a0a7c20f7 100644 --- a/src/governance/governance.h +++ b/src/governance/governance.h @@ -17,9 +17,11 @@ class CBloomFilter; class CBlockIndex; +class CConnman; template class CFlatDB; class CInv; +class PeerManager; class CDeterministicMNManager; class CGovernanceManager; @@ -292,7 +294,7 @@ class CGovernanceManager : public GovernanceStore void SyncSingleObjVotes(CNode& peer, const uint256& nProp, const CBloomFilter& filter, CConnman& connman); PeerMsgRet SyncObjects(CNode& peer, CConnman& connman) const; - PeerMsgRet ProcessMessage(CNode& peer, CConnman& connman, std::string_view msg_type, CDataStream& vRecv); + PeerMsgRet ProcessMessage(CNode& peer, CConnman& connman, PeerManager& peerman, std::string_view msg_type, CDataStream& vRecv); void ResetVotedFundingTrigger(); @@ -307,13 +309,13 @@ class CGovernanceManager : public GovernanceStore std::vector GetCurrentVotes(const uint256& nParentHash, const COutPoint& mnCollateralOutpointFilter) const; void GetAllNewerThan(std::vector& objs, int64_t nMoreThanTime) const; - void AddGovernanceObject(CGovernanceObject& govobj, CConnman& connman, const CNode* pfrom = nullptr); + void AddGovernanceObject(CGovernanceObject& govobj, PeerManager& peerman, const CNode* pfrom = nullptr); void CheckAndRemove(); UniValue ToJson() const; - void UpdatedBlockTip(const CBlockIndex* pindex, CConnman& connman, const CActiveMasternodeManager* const mn_activeman); + void UpdatedBlockTip(const CBlockIndex* pindex, CConnman& connman, PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman); int64_t GetLastDiffTime() const { return nTimeLastDiff; } void UpdateLastDiffTime(int64_t nTimeIn) { nTimeLastDiff = nTimeIn; } @@ -342,9 +344,9 @@ class CGovernanceManager : public GovernanceStore bool MasternodeRateCheck(const CGovernanceObject& govobj, bool fUpdateFailStatus, bool fForce, bool& fRateCheckBypassed); - bool ProcessVoteAndRelay(const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman); + bool ProcessVoteAndRelay(const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman, PeerManager& peerman); - void CheckPostponedObjects(CConnman& connman); + void CheckPostponedObjects(PeerManager& peerman); bool AreRateChecksEnabled() const { @@ -368,11 +370,11 @@ class CGovernanceManager : public GovernanceStore private: std::optional CreateSuperblockCandidate(int nHeight) const; - std::optional CreateGovernanceTrigger(const std::optional& sb_opt, CConnman& connman, + std::optional CreateGovernanceTrigger(const std::optional& sb_opt, PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman); - void VoteGovernanceTriggers(const std::optional& trigger_opt, CConnman& connman, + void VoteGovernanceTriggers(const std::optional& trigger_opt, CConnman& connman, PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman); - bool VoteFundingTrigger(const uint256& nHash, const vote_outcome_enum_t outcome, CConnman& connman, + bool VoteFundingTrigger(const uint256& nHash, const vote_outcome_enum_t outcome, CConnman& connman, PeerManager& peerman, const CActiveMasternodeManager* const mn_activeman); bool HasAlreadyVotedFundingTrigger() const; @@ -393,7 +395,7 @@ class CGovernanceManager : public GovernanceStore static bool AcceptMessage(const uint256& nHash, hash_s_t& setHash); - void CheckOrphanVotes(CGovernanceObject& govobj, CConnman& connman); + void CheckOrphanVotes(CGovernanceObject& govobj, PeerManager& peerman); void RebuildIndexes(); diff --git a/src/governance/object.cpp b/src/governance/object.cpp index 109c2bb2bd49c3..9b147325ef1921 100644 --- a/src/governance/object.cpp +++ b/src/governance/object.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -629,7 +629,7 @@ bool CGovernanceObject::GetCurrentMNVotes(const COutPoint& mnCollateralOutpoint, return true; } -void CGovernanceObject::Relay(CConnman& connman, const CMasternodeSync& mn_sync) const +void CGovernanceObject::Relay(PeerManager& peerman, const CMasternodeSync& mn_sync) const { // Do not relay until fully synced if (!mn_sync.IsSynced()) { @@ -651,7 +651,7 @@ void CGovernanceObject::Relay(CConnman& connman, const CMasternodeSync& mn_sync) } CInv inv(MSG_GOVERNANCE_OBJECT, GetHash()); - RelayInv(connman, inv, minProtoVersion); + peerman.RelayInv(inv, minProtoVersion); } void CGovernanceObject::UpdateSentinelVariables(const CDeterministicMNList& tip_mn_list) diff --git a/src/governance/object.h b/src/governance/object.h index d7f22bad9bf904..b427fe2c212264 100644 --- a/src/governance/object.h +++ b/src/governance/object.h @@ -22,6 +22,7 @@ class CGovernanceVote; class CMasternodeMetaMan; class CMasternodeSync; class CNode; +class PeerManager; extern RecursiveMutex cs_main; @@ -249,7 +250,7 @@ class CGovernanceObject UniValue GetJSONObject() const; - void Relay(CConnman& connman, const CMasternodeSync& mn_sync) const; + void Relay(PeerManager& peerman, const CMasternodeSync& mn_sync) const; uint256 GetHash() const; uint256 GetDataHash() const; diff --git a/src/governance/vote.cpp b/src/governance/vote.cpp index a1000426cae625..62f9a763aa59c8 100644 --- a/src/governance/vote.cpp +++ b/src/governance/vote.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -122,7 +122,7 @@ std::string CGovernanceVote::ToString(const CDeterministicMNList& tip_mn_list) c return ostr.str(); } -void CGovernanceVote::Relay(CConnman& connman, const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list) const +void CGovernanceVote::Relay(PeerManager& peerman, const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list) const { // Do not relay until fully synced if (!mn_sync.IsSynced()) { @@ -136,7 +136,7 @@ void CGovernanceVote::Relay(CConnman& connman, const CMasternodeSync& mn_sync, c } CInv inv(MSG_GOVERNANCE_OBJECT_VOTE, GetHash()); - RelayInv(connman, inv); + peerman.RelayInv(inv); } void CGovernanceVote::UpdateHash() const diff --git a/src/governance/vote.h b/src/governance/vote.h index bb2c0a510b2788..5662ac839cba80 100644 --- a/src/governance/vote.h +++ b/src/governance/vote.h @@ -10,12 +10,12 @@ class CActiveMasternodeManager; class CBLSPublicKey; -class CConnman; class CDeterministicMNList; class CGovernanceVote; class CMasternodeSync; class CKey; class CKeyID; +class PeerManager; // INTENTION OF MASTERNODES REGARDING ITEM enum vote_outcome_enum_t : uint8_t { @@ -105,7 +105,7 @@ class CGovernanceVote bool Sign(const CActiveMasternodeManager& mn_activeman); bool CheckSignature(const CBLSPublicKey& pubKey) const; bool IsValid(const CDeterministicMNList& tip_mn_list, bool useVotingKey) const; - void Relay(CConnman& connman, const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list) const; + void Relay(PeerManager& peerman, const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list) const; const COutPoint& GetMasternodeOutpoint() const { return masternodeOutpoint; } diff --git a/src/init.cpp b/src/init.cpp index e9328c83fccfd7..772e7d55f1ef3a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1860,7 +1860,7 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc #endif pdsNotificationInterface = new CDSNotificationInterface( - *node.connman, *node.mn_sync, *node.govman, node.mn_activeman.get(), node.dmnman, node.llmq_ctx, node.cj_ctx + *node.connman, *node.mn_sync, *node.govman, *node.peerman, node.mn_activeman.get(), node.dmnman, node.llmq_ctx, node.cj_ctx ); RegisterValidationInterface(pdsNotificationInterface); diff --git a/src/llmq/blockprocessor.cpp b/src/llmq/blockprocessor.cpp index 4f118f24331e17..0604ec747527b8 100644 --- a/src/llmq/blockprocessor.cpp +++ b/src/llmq/blockprocessor.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -46,8 +47,9 @@ static const std::string DB_MINED_COMMITMENT_BY_INVERSED_HEIGHT_Q_INDEXED = "q_m static const std::string DB_BEST_BLOCK_UPGRADE = "q_bbu2"; -CQuorumBlockProcessor::CQuorumBlockProcessor(CChainState& chainstate, CConnman& _connman, CDeterministicMNManager& dmnman, CEvoDB& evoDb) : - m_chainstate(chainstate), connman(_connman), m_dmnman(dmnman), m_evoDb(evoDb) +CQuorumBlockProcessor::CQuorumBlockProcessor(CChainState& chainstate, CDeterministicMNManager& dmnman, CEvoDB& evoDb, + const std::unique_ptr& peerman) : + m_chainstate(chainstate), m_dmnman(dmnman), m_evoDb(evoDb), m_peerman(peerman) { utils::InitQuorumsCache(mapHasMinedCommitmentCache); } @@ -666,7 +668,7 @@ void CQuorumBlockProcessor::AddMineableCommitment(const CFinalCommitment& fqc) // We only relay the new commitment if it's new or better then the old one if (relay) { CInv inv(MSG_QUORUM_FINAL_COMMITMENT, commitmentHash); - RelayInv(connman, inv); + m_peerman->RelayInv(inv); } } diff --git a/src/llmq/blockprocessor.h b/src/llmq/blockprocessor.h index 62e27ed43cf010..b77f125233a3f4 100644 --- a/src/llmq/blockprocessor.h +++ b/src/llmq/blockprocessor.h @@ -25,6 +25,7 @@ class CDataStream; class CDeterministicMNManager; class CEvoDB; class CNode; +class PeerManager; extern RecursiveMutex cs_main; @@ -38,9 +39,9 @@ class CQuorumBlockProcessor { private: CChainState& m_chainstate; - CConnman& connman; CDeterministicMNManager& m_dmnman; CEvoDB& m_evoDb; + const std::unique_ptr& m_peerman; mutable Mutex minableCommitmentsCs; std::map, uint256> minableCommitmentsByQuorum GUARDED_BY(minableCommitmentsCs); @@ -49,7 +50,8 @@ class CQuorumBlockProcessor mutable std::map> mapHasMinedCommitmentCache GUARDED_BY(minableCommitmentsCs); public: - explicit CQuorumBlockProcessor(CChainState& chainstate, CConnman& _connman, CDeterministicMNManager& dmnman, CEvoDB& evoDb); + explicit CQuorumBlockProcessor(CChainState& chainstate, CDeterministicMNManager& dmnman, CEvoDB& evoDb, + const std::unique_ptr& peerman); PeerMsgRet ProcessMessage(const CNode& peer, std::string_view msg_type, CDataStream& vRecv); diff --git a/src/llmq/chainlocks.cpp b/src/llmq/chainlocks.cpp index e55a4c9e98651c..a22a8dc44f8c64 100644 --- a/src/llmq/chainlocks.cpp +++ b/src/llmq/chainlocks.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -25,17 +26,17 @@ namespace llmq { std::unique_ptr chainLocksHandler; -CChainLocksHandler::CChainLocksHandler(CChainState& chainstate, CConnman& _connman, CQuorumManager& _qman, - CSigningManager& _sigman, CSigSharesManager& _shareman, CSporkManager& sporkman, - CTxMemPool& _mempool, const CMasternodeSync& mn_sync) : +CChainLocksHandler::CChainLocksHandler(CChainState& chainstate, CQuorumManager& _qman, CSigningManager& _sigman, + CSigSharesManager& _shareman, CSporkManager& sporkman, CTxMemPool& _mempool, + const CMasternodeSync& mn_sync, const std::unique_ptr& peerman) : m_chainstate(chainstate), - connman(_connman), qman(_qman), sigman(_sigman), shareman(_shareman), spork_manager(sporkman), mempool(_mempool), m_mn_sync(mn_sync), + m_peerman(peerman), scheduler(std::make_unique()), scheduler_thread(std::make_unique(std::thread(util::TraceThread, "cl-schdlr", [&] { scheduler->serviceQueue(); }))) { @@ -161,7 +162,7 @@ PeerMsgRet CChainLocksHandler::ProcessNewChainLock(const NodeId from, const llmq // Note: do not hold cs while calling RelayInv AssertLockNotHeld(cs); - RelayInv(connman, clsigInv); + m_peerman->RelayInv(clsigInv); if (pindex == nullptr) { // we don't know the block/header for this CLSIG yet, so bail out for now diff --git a/src/llmq/chainlocks.h b/src/llmq/chainlocks.h index e9041d54425344..9ac83669dd7f98 100644 --- a/src/llmq/chainlocks.h +++ b/src/llmq/chainlocks.h @@ -24,12 +24,12 @@ #include class CChainState; -class CConnman; class CBlockIndex; class CMasternodeSync; class CScheduler; class CSporkManager; class CTxMemPool; +class PeerManager; namespace llmq { @@ -46,13 +46,13 @@ class CChainLocksHandler : public CRecoveredSigsListener private: CChainState& m_chainstate; - CConnman& connman; CQuorumManager& qman; CSigningManager& sigman; CSigSharesManager& shareman; CSporkManager& spork_manager; CTxMemPool& mempool; const CMasternodeSync& m_mn_sync; + const std::unique_ptr& m_peerman; std::unique_ptr scheduler; std::unique_ptr scheduler_thread; @@ -85,9 +85,9 @@ class CChainLocksHandler : public CRecoveredSigsListener std::atomic lastCleanupTime{0}; public: - explicit CChainLocksHandler(CChainState& chainstate, CConnman& _connman, CQuorumManager& _qman, - CSigningManager& _sigman, CSigSharesManager& _shareman, CSporkManager& sporkman, - CTxMemPool& _mempool, const CMasternodeSync& mn_sync); + explicit CChainLocksHandler(CChainState& chainstate, CQuorumManager& _qman, CSigningManager& _sigman, + CSigSharesManager& _shareman, CSporkManager& sporkman, CTxMemPool& _mempool, + const CMasternodeSync& mn_sync, const std::unique_ptr& peerman); ~CChainLocksHandler(); void Start(); diff --git a/src/llmq/context.cpp b/src/llmq/context.cpp index ea182a90b55e11..ceb39497872075 100644 --- a/src/llmq/context.cpp +++ b/src/llmq/context.cpp @@ -25,7 +25,7 @@ LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CDeterminis dkg_debugman{std::make_unique()}, quorum_block_processor{[&]() -> llmq::CQuorumBlockProcessor* const { assert(llmq::quorumBlockProcessor == nullptr); - llmq::quorumBlockProcessor = std::make_unique(chainstate, connman, dmnman, evo_db); + llmq::quorumBlockProcessor = std::make_unique(chainstate, dmnman, evo_db, peerman); return llmq::quorumBlockProcessor.get(); }()}, qdkgsman{std::make_unique(*bls_worker, chainstate, connman, dmnman, *dkg_debugman, mn_metaman, *quorum_block_processor, mn_activeman, sporkman, unit_tests, wipe)}, @@ -38,7 +38,7 @@ LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CDeterminis shareman{std::make_unique(connman, *sigman, mn_activeman, *llmq::quorumManager, sporkman, peerman)}, clhandler{[&]() -> llmq::CChainLocksHandler* const { assert(llmq::chainLocksHandler == nullptr); - llmq::chainLocksHandler = std::make_unique(chainstate, connman, *llmq::quorumManager, *sigman, *shareman, sporkman, mempool, mn_sync); + llmq::chainLocksHandler = std::make_unique(chainstate, *llmq::quorumManager, *sigman, *shareman, sporkman, mempool, mn_sync, peerman); return llmq::chainLocksHandler.get(); }()}, isman{[&]() -> llmq::CInstantSendManager* const { diff --git a/src/llmq/ehf_signals.h b/src/llmq/ehf_signals.h index 675b90d833ca92..b29828ebd288da 100644 --- a/src/llmq/ehf_signals.h +++ b/src/llmq/ehf_signals.h @@ -11,7 +11,6 @@ class CBlockIndex; class CChainState; -class CConnman; class CMNHFManager; class CSporkManager; class CTxMemPool; diff --git a/src/llmq/instantsend.cpp b/src/llmq/instantsend.cpp index 06020ff275a4d3..8278b156739e13 100644 --- a/src/llmq/instantsend.cpp +++ b/src/llmq/instantsend.cpp @@ -1051,11 +1051,11 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, const uint256& has CInv inv(MSG_ISDLOCK, hash); if (tx != nullptr) { - RelayInvFiltered(connman, inv, *tx, ISDLOCK_PROTO_VERSION); + m_peerman.load()->RelayInvFiltered(inv, *tx, ISDLOCK_PROTO_VERSION); } else { // we don't have the TX yet, so we only filter based on txid. Later when that TX arrives, we will re-announce // with the TX taken into account. - RelayInvFiltered(connman, inv, islock->txid, ISDLOCK_PROTO_VERSION); + m_peerman.load()->RelayInvFiltered(inv, islock->txid, ISDLOCK_PROTO_VERSION); } ResolveBlockConflicts(hash, *islock); diff --git a/src/net.cpp b/src/net.cpp index 675465b40be8e1..4f9de84a657280 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3921,52 +3921,6 @@ bool CConnman::DisconnectNode(NodeId id) return false; } -void RelayInv(CConnman& connman, CInv &inv, const int minProtoVersion) { - connman.ForEachNode([&](CNode* pnode) { - if (pnode->nVersion < minProtoVersion || !pnode->CanRelay()) - return; - pnode->PushInventory(inv); - }); -} - -void RelayInvFiltered(CConnman& connman, CInv &inv, const CTransaction& relatedTx, const int minProtoVersion) -{ - connman.ForEachNode([&](CNode* pnode) { - if (pnode->nVersion < minProtoVersion || !pnode->CanRelay() || pnode->IsBlockOnlyConn()) { - return; - } - { - LOCK(pnode->m_tx_relay->cs_filter); - if (!pnode->m_tx_relay->fRelayTxes) { - return; - } - if (pnode->m_tx_relay->pfilter && !pnode->m_tx_relay->pfilter->IsRelevantAndUpdate(relatedTx)) { - return; - } - } - pnode->PushInventory(inv); - }); -} - -void RelayInvFiltered(CConnman& connman, CInv &inv, const uint256& relatedTxHash, const int minProtoVersion) -{ - connman.ForEachNode([&](CNode* pnode) { - if (pnode->nVersion < minProtoVersion || !pnode->CanRelay() || pnode->IsBlockOnlyConn()) { - return; - } - { - LOCK(pnode->m_tx_relay->cs_filter); - if (!pnode->m_tx_relay->fRelayTxes) { - return; - } - if (pnode->m_tx_relay->pfilter && !pnode->m_tx_relay->pfilter->contains(relatedTxHash)) { - return; - } - } - pnode->PushInventory(inv); - }); -} - void CConnman::RecordBytesRecv(uint64_t bytes) { LOCK(cs_totalBytesRecv); diff --git a/src/net.h b/src/net.h index 4334924e630e6a..4ed16a2f84fe4d 100644 --- a/src/net.h +++ b/src/net.h @@ -1526,16 +1526,6 @@ friend class CNode; friend struct ConnmanTestMsg; }; -void RelayInv(CConnman& connman, CInv &inv, const int minProtoVersion = MIN_PEER_PROTO_VERSION); -void RelayInvFiltered(CConnman& connman, CInv &inv, const CTransaction &relatedTx, - const int minProtoVersion = MIN_PEER_PROTO_VERSION); -/** - * This overload will not update node filters, so use it only for the cases - * when other messages will update related transaction data in filters - */ -void RelayInvFiltered(CConnman& connman, CInv &inv, const uint256 &relatedTxHash, - const int minProtoVersion = MIN_PEER_PROTO_VERSION); - /** Return a timestamp in the future (in microseconds) for exponentially distributed events. */ std::chrono::microseconds PoissonNextSend(std::chrono::microseconds now, std::chrono::seconds average_interval); diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 63e7df604d9049..ae9b9e5ba65b88 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -358,6 +358,9 @@ class PeerManagerImpl final : public PeerManager bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) override; bool IgnoresIncomingTxs() override { return m_ignore_incoming_txs; } void SendPings() override; + void RelayInv(CInv &inv, const int minProtoVersion) override; + void RelayInvFiltered(CInv &inv, const CTransaction &relatedTx, const int minProtoVersion) override; + void RelayInvFiltered(CInv &inv, const uint256 &relatedTxHash, const int minProtoVersion) override; void RelayTransaction(const uint256& txid) override; void SetBestHeight(int height) override { m_best_height = height; }; void Misbehaving(const NodeId pnode, const int howmuch, const std::string& message = "") override; @@ -2109,6 +2112,52 @@ void PeerManagerImpl::SendPings() for(auto& it : m_peer_map) it.second->m_ping_queued = true; } +void PeerManagerImpl::RelayInv(CInv &inv, const int minProtoVersion) { + m_connman.ForEachNode([&](CNode* pnode) { + if (pnode->nVersion < minProtoVersion || !pnode->CanRelay()) + return; + pnode->PushInventory(inv); + }); +} + +void PeerManagerImpl::RelayInvFiltered(CInv &inv, const CTransaction& relatedTx, const int minProtoVersion) +{ + m_connman.ForEachNode([&](CNode* pnode) { + if (pnode->nVersion < minProtoVersion || !pnode->CanRelay() || pnode->IsBlockOnlyConn()) { + return; + } + { + LOCK(pnode->m_tx_relay->cs_filter); + if (!pnode->m_tx_relay->fRelayTxes) { + return; + } + if (pnode->m_tx_relay->pfilter && !pnode->m_tx_relay->pfilter->IsRelevantAndUpdate(relatedTx)) { + return; + } + } + pnode->PushInventory(inv); + }); +} + +void PeerManagerImpl::RelayInvFiltered(CInv &inv, const uint256& relatedTxHash, const int minProtoVersion) +{ + m_connman.ForEachNode([&](CNode* pnode) { + if (pnode->nVersion < minProtoVersion || !pnode->CanRelay() || pnode->IsBlockOnlyConn()) { + return; + } + { + LOCK(pnode->m_tx_relay->cs_filter); + if (!pnode->m_tx_relay->fRelayTxes) { + return; + } + if (pnode->m_tx_relay->pfilter && !pnode->m_tx_relay->pfilter->contains(relatedTxHash)) { + return; + } + } + pnode->PushInventory(inv); + }); +} + void PeerManagerImpl::RelayTransaction(const uint256& txid) { CInv inv(m_cj_ctx->dstxman->GetDSTX(txid) ? MSG_DSTX : MSG_TX, txid); @@ -4689,9 +4738,9 @@ void PeerManagerImpl::ProcessMessage( } #endif // ENABLE_WALLET ProcessPeerMsgRet(m_cj_ctx->server->ProcessMessage(pfrom, msg_type, vRecv), pfrom); - ProcessPeerMsgRet(m_sporkman.ProcessMessage(pfrom, m_connman, msg_type, vRecv), pfrom); + ProcessPeerMsgRet(m_sporkman.ProcessMessage(pfrom, m_connman, *this, msg_type, vRecv), pfrom); m_mn_sync.ProcessMessage(pfrom, msg_type, vRecv); - ProcessPeerMsgRet(m_govman.ProcessMessage(pfrom, m_connman, msg_type, vRecv), pfrom); + ProcessPeerMsgRet(m_govman.ProcessMessage(pfrom, m_connman, *this, msg_type, vRecv), pfrom); ProcessPeerMsgRet(CMNAuth::ProcessMessage(pfrom, m_connman, m_mn_metaman, m_mn_activeman, m_mn_sync, m_dmnman->GetListAtChainTip(), msg_type, vRecv), pfrom); ProcessPeerMsgRet(m_llmq_ctx->quorum_block_processor->ProcessMessage(pfrom, msg_type, vRecv), pfrom); ProcessPeerMsgRet(m_llmq_ctx->qdkgsman->ProcessMessage(pfrom, this, msg_type, vRecv), pfrom); diff --git a/src/net_processing.h b/src/net_processing.h index 2ef1b8473c227c..ff1124da318d57 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -21,7 +22,9 @@ class CMasternodeSync; class ChainstateManager; class CCoinJoinServer; class CGovernanceManager; +class CInv; class CSporkManager; +class CTransaction; struct CJContext; struct LLMQContext; @@ -71,6 +74,18 @@ class PeerManager : public CValidationInterface, public NetEventsInterface /** Send ping message to all peers */ virtual void SendPings() = 0; + /** Relay inventories to all peers */ + virtual void RelayInv(CInv &inv, const int minProtoVersion = MIN_PEER_PROTO_VERSION) = 0; + virtual void RelayInvFiltered(CInv &inv, const CTransaction &relatedTx, + const int minProtoVersion = MIN_PEER_PROTO_VERSION) = 0; + + /** + * This overload will not update node filters, use it only for the cases + * when other messages will update related transaction data in filters + */ + virtual void RelayInvFiltered(CInv &inv, const uint256 &relatedTxHash, + const int minProtoVersion = MIN_PEER_PROTO_VERSION) = 0; + /** Relay transaction to all peers. */ virtual void RelayTransaction(const uint256& txid) EXCLUSIVE_LOCKS_REQUIRED(cs_main) = 0; diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp index b91261fb696370..9d173a1f96f9af 100644 --- a/src/rpc/governance.cpp +++ b/src/rpc/governance.cpp @@ -399,9 +399,9 @@ static UniValue gobject_submit(const JSONRPCRequest& request) if (fMissingConfirmations) { node.govman->AddPostponedObject(govobj); - govobj.Relay(*node.connman, *node.mn_sync); + govobj.Relay(*node.peerman, *node.mn_sync); } else { - node.govman->AddGovernanceObject(govobj, *node.connman); + node.govman->AddGovernanceObject(govobj, *node.peerman); } return govobj.GetHash().ToString(); @@ -452,7 +452,7 @@ static UniValue VoteWithMasternodes(const JSONRPCRequest& request, const std::ma } CGovernanceException exception; - if (node.govman->ProcessVoteAndRelay(vote, exception, *node.connman)) { + if (node.govman->ProcessVoteAndRelay(vote, exception, *node.connman, *node.peerman)) { nSuccessful++; statusObj.pushKV("result", "success"); } else { @@ -1035,7 +1035,7 @@ static UniValue voteraw(const JSONRPCRequest& request) } CGovernanceException exception; - if (node.govman->ProcessVoteAndRelay(vote, exception, *node.connman)) { + if (node.govman->ProcessVoteAndRelay(vote, exception, *node.connman, *node.peerman)) { return "Voted successfully"; } else { throw JSONRPCError(RPC_INTERNAL_ERROR, "Error voting : " + exception.GetMessage()); diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index dfb463eb3aa70e..da6771c17bfee5 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -213,7 +213,7 @@ static RPCHelpMan sporkupdate() } const NodeContext& node = EnsureAnyNodeContext(request.context); - if (!node.connman) { + if (!node.peerman) { throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); } @@ -221,7 +221,7 @@ static RPCHelpMan sporkupdate() int64_t nValue = request.params[1].get_int64(); // broadcast new spork - if (node.sporkman->UpdateSpork(nSporkID, nValue, *node.connman)) { + if (node.sporkman->UpdateSpork(*node.peerman, nSporkID, nValue)) { return "success"; } diff --git a/src/spork.cpp b/src/spork.cpp index 19896e1081fa7f..798dddac77e816 100644 --- a/src/spork.cpp +++ b/src/spork.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -127,17 +128,17 @@ void CSporkManager::CheckAndRemove() } } -PeerMsgRet CSporkManager::ProcessMessage(CNode& peer, CConnman& connman, std::string_view msg_type, CDataStream& vRecv) +PeerMsgRet CSporkManager::ProcessMessage(CNode& peer, CConnman& connman, PeerManager& peerman, std::string_view msg_type, CDataStream& vRecv) { if (msg_type == NetMsgType::SPORK) { - return ProcessSpork(peer, connman, vRecv); + return ProcessSpork(peer, peerman, vRecv); } else if (msg_type == NetMsgType::GETSPORKS) { ProcessGetSporks(peer, connman); } return {}; } -PeerMsgRet CSporkManager::ProcessSpork(const CNode& peer, CConnman& connman, CDataStream& vRecv) +PeerMsgRet CSporkManager::ProcessSpork(const CNode& peer, PeerManager& peerman, CDataStream& vRecv) { CSporkMessage spork; vRecv >> spork; @@ -193,7 +194,7 @@ PeerMsgRet CSporkManager::ProcessSpork(const CNode& peer, CConnman& connman, CDa WITH_LOCK(cs_mapSporksCachedActive, mapSporksCachedActive.erase(spork.nSporkID)); WITH_LOCK(cs_mapSporksCachedValues, mapSporksCachedValues.erase(spork.nSporkID)); } - spork.Relay(connman); + spork.Relay(peerman); return {}; } @@ -208,7 +209,7 @@ void CSporkManager::ProcessGetSporks(CNode& peer, CConnman& connman) } -bool CSporkManager::UpdateSpork(SporkId nSporkID, SporkValue nValue, CConnman& connman) +bool CSporkManager::UpdateSpork(PeerManager& peerman, SporkId nSporkID, SporkValue nValue) { CSporkMessage spork(nSporkID, nValue, GetAdjustedTime()); @@ -235,7 +236,7 @@ bool CSporkManager::UpdateSpork(SporkId nSporkID, SporkValue nValue, CConnman& c WITH_LOCK(cs_mapSporksCachedValues, mapSporksCachedValues.erase(spork.nSporkID)); } - spork.Relay(connman); + spork.Relay(peerman); return true; } @@ -451,8 +452,8 @@ std::optional CSporkMessage::GetSignerKeyID() const return {pubkeyFromSig.GetID()}; } -void CSporkMessage::Relay(CConnman& connman) const +void CSporkMessage::Relay(PeerManager& peerman) const { CInv inv(MSG_SPORK, GetHash()); - RelayInv(connman, inv); + peerman.RelayInv(inv); } diff --git a/src/spork.h b/src/spork.h index effc9d75309ce7..02e9eeecd3d586 100644 --- a/src/spork.h +++ b/src/spork.h @@ -25,6 +25,7 @@ template class CFlatDB; class CNode; class CDataStream; +class PeerManager; class CSporkMessage; class CSporkManager; @@ -155,7 +156,7 @@ class CSporkMessage /** * Relay is used to send this spork message to other peers. */ - void Relay(CConnman& connman) const; + void Relay(PeerManager& peerman) const; }; class SporkStore @@ -257,7 +258,7 @@ class CSporkManager : public SporkStore /** * ProcessMessage is used to call ProcessSpork and ProcessGetSporks. See below */ - PeerMsgRet ProcessMessage(CNode& peer, CConnman& connman, std::string_view msg_type, CDataStream& vRecv); + PeerMsgRet ProcessMessage(CNode& peer, CConnman& connman, PeerManager& peerman, std::string_view msg_type, CDataStream& vRecv); /** * ProcessSpork is used to handle the 'spork' p2p message. @@ -265,7 +266,7 @@ class CSporkManager : public SporkStore * For 'spork', it validates the spork and adds it to the internal spork storage and * performs any necessary processing. */ - PeerMsgRet ProcessSpork(const CNode& peer, CConnman& connman, CDataStream& vRecv) LOCKS_EXCLUDED(cs); + PeerMsgRet ProcessSpork(const CNode& peer, PeerManager& peerman, CDataStream& vRecv) LOCKS_EXCLUDED(cs); /** * ProcessGetSporks is used to handle the 'getsporks' p2p message. @@ -278,7 +279,7 @@ class CSporkManager : public SporkStore * UpdateSpork is used by the spork RPC command to set a new spork value, sign * and broadcast the spork message. */ - bool UpdateSpork(SporkId nSporkID, SporkValue nValue, CConnman& connman) LOCKS_EXCLUDED(cs); + bool UpdateSpork(PeerManager& peerman, SporkId nSporkID, SporkValue nValue) LOCKS_EXCLUDED(cs); /** * IsSporkActive returns a bool for time-based sporks, and should be used diff --git a/test/lint/lint-circular-dependencies.sh b/test/lint/lint-circular-dependencies.sh index 6eef8b94721fff..5fc193b53bed06 100755 --- a/test/lint/lint-circular-dependencies.sh +++ b/test/lint/lint-circular-dependencies.sh @@ -32,7 +32,6 @@ EXPECTED_CIRCULAR_DEPENDENCIES=( "governance/governance -> governance/object -> governance/governance" "governance/governance -> masternode/sync -> governance/governance" "llmq/chainlocks -> llmq/instantsend -> llmq/chainlocks" - "llmq/chainlocks -> llmq/instantsend -> net_processing -> llmq/chainlocks" "llmq/dkgsessionhandler -> net_processing -> llmq/dkgsessionmgr -> llmq/dkgsessionhandler" "llmq/instantsend -> net_processing -> llmq/instantsend" "llmq/instantsend -> txmempool -> llmq/instantsend" @@ -51,7 +50,6 @@ EXPECTED_CIRCULAR_DEPENDENCIES=( "qt/guiutil -> qt/optionsdialog -> qt/guiutil" "qt/guiutil -> qt/qvalidatedlineedit -> qt/guiutil" "core_io -> evo/cbtx -> evo/simplifiedmns -> core_io" - "core_io -> evo/assetlocktx -> llmq/signing -> net_processing -> governance/governance -> governance/object -> core_io" "llmq/dkgsession -> llmq/dkgsessionmgr -> llmq/dkgsessionhandler -> llmq/dkgsession" "logging -> util/system -> sync -> logging" "logging -> util/system -> stacktraces -> logging" @@ -60,12 +58,10 @@ EXPECTED_CIRCULAR_DEPENDENCIES=( "qt/guiutil -> qt/optionsdialog -> qt/optionsmodel -> qt/guiutil" "bloom -> evo/assetlocktx -> llmq/quorums -> net -> bloom" - "bloom -> evo/assetlocktx -> llmq/signing -> net_processing -> governance/governance -> bloom" "bloom -> evo/assetlocktx -> llmq/signing -> net_processing -> merkleblock -> bloom" "banman -> bloom -> evo/assetlocktx -> llmq/quorums -> net -> banman" "banman -> bloom -> evo/assetlocktx -> llmq/signing -> net_processing -> banman" - "coinjoin/client -> coinjoin/coinjoin -> llmq/instantsend -> net_processing -> coinjoin/client" "llmq/dkgsession -> llmq/dkgsessionmgr -> llmq/dkgsession" "llmq/chainlocks -> validation -> llmq/chainlocks" "coinjoin/coinjoin -> llmq/chainlocks -> net -> coinjoin/coinjoin" @@ -100,6 +96,15 @@ EXPECTED_CIRCULAR_DEPENDENCIES=( "coinjoin/server -> net_processing -> coinjoin/server" "llmq/context -> llmq/ehf_signals -> net_processing -> llmq/context" "coinjoin/client -> coinjoin/util -> wallet/wallet -> psbt -> node/transaction -> node/context -> coinjoin/context -> coinjoin/client" + "llmq/blockprocessor -> net_processing -> llmq/blockprocessor" + "llmq/chainlocks -> net_processing -> llmq/chainlocks" + "net_processing -> spork -> net_processing" + "evo/simplifiedmns -> llmq/blockprocessor -> net_processing -> evo/simplifiedmns" + "governance/governance -> governance/object -> net_processing -> governance/governance" + "llmq/blockprocessor -> net_processing -> llmq/context -> llmq/blockprocessor" + "llmq/blockprocessor -> net_processing -> llmq/quorums -> llmq/blockprocessor" + "llmq/chainlocks -> net_processing -> llmq/context -> llmq/chainlocks" + "coinjoin/client -> coinjoin/coinjoin -> llmq/chainlocks -> net_processing -> coinjoin/client" ) EXIT_CODE=0