You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #6828: refactor: drop fMasternodeMode global, create new context for masternode mode-only logic (ActiveContext), move spun-off signers and EHF signals handler
f4ac71c lint: update circular dependencies allowlist, minor cleanup (Kittywhiskers Van Gogh)
ecb924c refactor: move EHF signals handler to `ActiveContext` (Kittywhiskers Van Gogh)
83707a0 refactor: create notification interface for masternode mode (Kittywhiskers Van Gogh)
d52795c refactor: clean up `CCoinJoinServer`, remove redundant checks (Kittywhiskers Van Gogh)
afec9ae refactor: move CoinJoin server to `ActiveContext` (Kittywhiskers Van Gogh)
fcabb3d refactor: move ChainLock signer to `ActiveContext` (Kittywhiskers Van Gogh)
314f070 refactor: move InstantSend signer to new `ActiveContext` (Kittywhiskers Van Gogh)
be84075 refactor: drop `fMasternodeMode` global (Kittywhiskers Van Gogh)
562ad2b wallet: drop collateral outpoints filtering from balance calculation (Kittywhiskers Van Gogh)
Pull request description:
## Additional Information
* To allow removing `::fMasternodeMode`, we needed to route all pending global usage and one usage, in `wallet/coinjoin.cpp` ([source](https://github.com/dashpay/dash/blob/873dee049265404f91b7012f73d0e7e8f63078c2/src/wallet/coinjoin.cpp#L184)) required additional refactoring. When calculating a tally of all outpoints from an address, if the node is in masternode mode, we skip over outputs with collateral values.
`SelectCoinsGroupedByAddresses` is used in three places, creating collaterals ([source](https://github.com/dashpay/dash/blob/873dee049265404f91b7012f73d0e7e8f63078c2/src/coinjoin/client.cpp#L1433)) and denoms ([source](https://github.com/dashpay/dash/blob/873dee049265404f91b7012f73d0e7e8f63078c2/src/coinjoin/client.cpp#L1605)) in the CoinJoin client, calculating the anonymizable balance ([source](https://github.com/dashpay/dash/blob/873dee049265404f91b7012f73d0e7e8f63078c2/src/wallet/coinjoin.cpp#L438)) in wallet, and tests.
As the wallet will have no way of querying if masternode mode is enabled, we need to pull this logic outside. It isn't required in the CoinJoin client as masternodes cannot participate in CoinJoin as a client ([source](https://github.com/dashpay/dash/blob/873dee049265404f91b7012f73d0e7e8f63078c2/src/coinjoin/client.cpp#L684)) and so `fMasternodeMode` will not evaluate `true`, leaving behind `GetAnonymizableBalance()`~~, which now accepts `fSkipMnCollateral` as the caller _can_ query if the node is in masternode mode ([source](https://github.com/dashpay/dash/blob/08db0fd193ecf124de0f8745eca8b24483a0c062/src/qt/overviewpage.cpp#L397)).~~
* ~~This requires storing the outpoint's value in order to filter it in `GetAnonymizableBalance()`, which required a change in `CompactTallyItem`'s structure ([source](https://github.com/dashpay/dash/blob/08db0fd193ecf124de0f8745eca8b24483a0c062/src/wallet/wallet.h#L135)).~~ This has been reverted as masternodes can no longer hold collaterals in their local wallet, so we can remove the collateral check outright ([comment](#6828 (comment))).
* The signers spun-off in [dash#6742](#6742) and [dash#6761](#6761) have been moved to a dedicated masternode mode-only context, `ActiveContext`, as part of an effort to pull out networking-heavy and interactive consensus elements out of `LLMQContext`, for `bitcoin-chainstate`.
* As the signers plug into existing managers and aren't standalone, they are _not_ public.
* Alongside the signers, managers that are masternode mode-only have been moved to `ActiveContext`, namely `CCoinJoinServer` ([source](https://github.com/dashpay/dash/blob/873dee049265404f91b7012f73d0e7e8f63078c2/src/coinjoin/server.cpp#L898)) and `llmq::CEHFSignalsHandler` ([source](https://github.com/dashpay/dash/blob/873dee049265404f91b7012f73d0e7e8f63078c2/src/llmq/ehf_signals.cpp#L41-L43)).
## Breaking Changes
None expected.
## Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e tests
- [x] I have made corresponding changes to the documentation **(note: N/A)**
- [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
Top commit has no ACKs.
Tree-SHA512: d193af61592d7206bc3af5d74f4ee4e5b3b8a91d2806d57e8e2d6bed636f33ceeb82f73cdd0557a5239c67ed99e1c98e42d7e6c412d23f5fa076cfd965d804a5
0 commit comments