From 758cd646a1fee7d9a4d0d08b7651f068eae83be9 Mon Sep 17 00:00:00 2001 From: pasta Date: Thu, 5 Dec 2024 19:40:07 -0600 Subject: [PATCH] Merge #6452: fix: store ready queues on the mixing masternode 24dcce979be16b4482b65e43faaf3f040064e8de fix: store ready queues on the mixing masternode (UdjinM6) Pull request description: ## Issue being fixed or feature implemented We normally do not re-relay/store "ready" `dsq`-s because these are ment to be relayed between mixing clients and the mixing masternode only. I works ok when you simply send `dsq` messages because no extra steps are required. However since 70235 we send `dsq` _`inv`-s_ first and we send actual `dsq`-s only if they are requested via `getdata`. The problem here is that `ProcessGetData()` queries `vecCoinJoinQueue` via `GetQueueFromHash()` to get the data to send back but there is none because we never saved it. ## What was done? ## How Has This Been Tested? To test this patch you need a MN but you can test 2 cases _without this patch_ to indirectly test the idea: 1. try mixing on develop: almost no mixing txes, maybe 10 or so in an hour if you are lucky to mix on an old MN that often 2. ignore old MNs (`MIN_PEER_PROTO_VERSION = 70235`): 0 mixing txes, no matter how long you wait 3. pretend being an old client to receive no-inv `dsq` only (`PROTOCOL_VERSION = 70233`): no issues, mixing on these nodes is as fast as usual, several txes per block (need a couple of nodes like that on the network so that a mixing session could be completed, I'm running one node for now so that anyone could join and test it) I'm running a testnet MN with this fix and applied "ignore old mn" patch on my local machine. Local wallet got mixing tx when it finally hit the patched mn. Also confirmed this via MN`debug.log` (`Create`/`Relay`/`CommitFinalTransaction` in logs). ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 24dcce979be16b4482b65e43faaf3f040064e8de Tree-SHA512: 69cee5401d26eec3f66166a754b8020e7f550dac4a0fdea8ec48ea1082f1286e647ac0a26a189c4d39e1a9da4e7ac36f71913684b13ea0fb4b3cfe831174970e --- src/coinjoin/server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coinjoin/server.cpp b/src/coinjoin/server.cpp index bb65990dd9006..6e0ee38474b7f 100644 --- a/src/coinjoin/server.cpp +++ b/src/coinjoin/server.cpp @@ -520,6 +520,7 @@ void CCoinJoinServer::CheckForCompleteQueue() "with %d participants\n", dsq.ToString(), vecSessionCollaterals.size()); dsq.Sign(*m_mn_activeman); m_peerman->RelayDSQ(dsq); + WITH_LOCK(cs_vecqueue, vecCoinJoinQueue.push_back(dsq)); } }