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 #7056: refactor: extract CActiveMasternodeManager from LLMQContext (1/n, preliminary refactoring)
0114f58 fix: guard `quorumBaseBlockIndexCache` (Kittywhiskers Van Gogh)
2c6cbc9 refactor: use `gsl::not_null` in `CQuorumManager` wherever possible (Kittywhiskers Van Gogh)
8f8078f refactor: initialize `CJWalletManager` after `ActiveContext` (Kittywhiskers Van Gogh)
dac4769 refactor: move `CDKGSessionManager` to `{Active,Observer}Context` (Kittywhiskers Van Gogh)
9c61900 refactor: create stub class for watch-only mode context (Kittywhiskers Van Gogh)
b9e20f4 refactor: introduce `MakePeerManager()` helper for test setup (Kittywhiskers Van Gogh)
6b811c2 refactor: make `CDKGSessionManager` a plugable obj for `CQuorumManager` (Kittywhiskers Van Gogh)
5d54cfe refactor: couple listener registration with instantiation (Kittywhiskers Van Gogh)
263dd67 refactor: drop remaining `gArgs` usage in LLMQ code (Kittywhiskers Van Gogh)
3f41401 refactor: move `GetEnabledQuorumVvecSyncEntries()` invocation to init (Kittywhiskers Van Gogh)
16459c5 refactor: drop `QuorumDataRecoveryEnabled()` (Kittywhiskers Van Gogh)
7f32d39 refactor: drop `IsWatchQuorumsEnabled()` (Kittywhiskers Van Gogh)
Pull request description:
## Additional Information
* Dependency for #7062
* As mentioned in [bitcoin#25862](bitcoin#25862), code in `libbitcoin_kernel` should not interact with `ArgsManager` and currently, Dash-specific chainstate validation relies on it to query flags like `-watchquorums` and `-llmq-data-recovery`.
They have been refactored to be taken as constructor arguments in the style of [bitcoin#23280](bitcoin#23280) and passed from the context to the constructor of the underlying managers. Similar changes have been extended to remaining `gArgs` usage.
* When debugging dependent PRs, it was found that there was a potential race condition as the creation of the signer was done by one entity (`ActiveContext`) but activation was done by the parent entity (e.g. `CChainLocksHandler`). Further complicating the relationship is the introduction of a network entity (e.g. `NetInstantSend`) which could cause potential lifecycle issues.
To simpilfy this, the entity that is responsible for creation of the signer is also responsible for registration of the signer. The functions have also been renamed to follow the convention in `CSigSharesManager` to `{Unr,R}egisterAsRecoveredSigsListener()` as it more descriptive as opposed to `Start`/`Stop()`, which is associated with spawning worker entities.
* `CDKGSessionManager` is a dormant entity if the node is not in watch-only mode or masternode mode ([source](https://github.com/dashpay/dash/blob/bac6bfadffe6fcf323e5e0208c8619e1e68401fe/src/llmq/dkgsessionmgr.cpp#L46-L49)), to allow moving them to contexts that are mode-specific (in order to keep `LLMQContext` limited to only chainstate validation logic), it is now a connectable entity in the style of [dash#5980](#5980) (a5be37c).
* Conversely, we now have ready access to `ChainstateManager` when constructing `CMNHFManager` so we can partially revert the change introduced in [dash#6078](#6078) (208b1c0).
* As subsequent PRs will change the ctor arguments for `PeerManager` multiple times, a helper has been added in the form of `MakePeerManager()` to contain the changes to the helper.
* Currently, `CJWalletManager` is initialised if `CActiveMasternodeManager` is _not_ initialised. This is fine _until_ we move `CActiveMasternodeManager` into `ActiveContext` as `ActiveContext` is initialised after `CJWalletManager` and cannot be moved upward due to hard dependencies.
As there's no reason that `CJWalletManager` needs to be initialised early, we can move it down instead.
## 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: d4597f24f918f2b7bc3468111acce004d3df83b2229afd658bb2b4df319369f337cc3a7ae27ed8159ea36265f8f7ad12cba91299d2b156e75b13c62ebdeedc19
0 commit comments