Commit 3e6e8f5
committed
Merge #6838: refactor: split off governance masternode-only logic to
b51cd1d lint: apply most `clang-format` suggestions, update circular allowlist (Kittywhiskers Van Gogh)
700e069 refactor: cleanup headers and forward decls (Kittywhiskers Van Gogh)
c516fd3 refactor: apply review suggestions (Kittywhiskers Van Gogh)
d19e1f3 fix: add `nullptr` check before using `FindGovernanceObject()` retval (Kittywhiskers Van Gogh)
1777919 refactor: use `std::chrono` for governance time constants (Kittywhiskers Van Gogh)
4d96f5f refactor: move `DoMaintenance()` inside `Schedule()` (Kittywhiskers Van Gogh)
e224991 governance: add lock annotations for `cs_relay` (Kittywhiskers Van Gogh)
df589c7 governance: introduce task for relaying governance objects (Kittywhiskers Van Gogh)
3811924 governance: drop `Relay()` from `CGovernance{Object,Vote}` (Kittywhiskers Van Gogh)
63448ff refactor: abstract away parent implementation from signer (Kittywhiskers Van Gogh)
757ded3 refactor: remove need for access to private members (Kittywhiskers Van Gogh)
bd6af83 refactor: separate masternode mode logic into dedicated signer class (Kittywhiskers Van Gogh)
2b74e15 refactor: move masternode mode logic to `governance/signing.cpp` (Kittywhiskers Van Gogh)
fefbe27 refactor: replace `Sign` functions with direct activeman call (Kittywhiskers Van Gogh)
Pull request description:
## Additional Information
* Depends on #6828
* Depends on #6842
* Depends on #6877
* Dependency for #6849
* To reduce the proliferation of `PeerManager` in governance logic, relaying has been centralized to `CGovernanceManager` and now done through a scheduled task that processes a queue of requests. This reduces the amount of code that needs to fetch a reference to `PeerManager` in order to queue a message for relay and brings us closer to dropping it as a member in other objects.
* On test chains, the queue of requests is processed every second but on mainnet, it is processed every 5 seconds. This is because functional tests assume instantaneous relay and fail if it takes too long to relay messages (as cascading delays cause test timeout).
* Likewise, to reduce the references to `CActiveMasternodeManager`, signing logic is consolidated to `SignBasic()` with the objects using simple getter/setters (or direct assignment) where applicable.
## 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)_
ACKs for top commit:
UdjinM6:
utACK b51cd1d
knst:
utACK b51cd1d
Tree-SHA512: cd4bba1e7314695a215a8a83e2d5319be8d2eb2e88eb42f641f6c88ca6d74ee68ced9e95475c6b1d93f5b061993efa6a195d23f61a8775f920867d9836a0dcf8GovernanceSigner, drop Relay()s and use periodic relay instead, minor cleanupFile tree
28 files changed
+691
-543
lines changed- src
- coinjoin
- governance
- masternode
- active
- node
- qt
- rpc
- test
- wallet
- test
- functional
- lint
28 files changed
+691
-543
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | 225 | | |
227 | 226 | | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
510 | 511 | | |
511 | 512 | | |
512 | 513 | | |
| 514 | + | |
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 47 | | |
61 | 48 | | |
62 | 49 | | |
| |||
84 | 71 | | |
85 | 72 | | |
86 | 73 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 74 | | |
100 | 75 | | |
101 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
209 | 207 | | |
210 | 208 | | |
211 | 209 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 210 | + | |
220 | 211 | | |
221 | 212 | | |
222 | 213 | | |
| |||
284 | 275 | | |
285 | 276 | | |
286 | 277 | | |
287 | | - | |
288 | 278 | | |
289 | 279 | | |
290 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
717 | | - | |
| 717 | + | |
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
36 | | - | |
37 | 34 | | |
38 | | - | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
| |||
94 | 90 | | |
95 | 91 | | |
96 | 92 | | |
97 | | - | |
| 93 | + | |
98 | 94 | | |
99 | 95 | | |
100 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
27 | 24 | | |
28 | | - | |
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
| |||
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
55 | | - | |
56 | 51 | | |
57 | | - | |
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
| |||
0 commit comments