Commit b169499
committed
Merge #6933: backport: merge bitcoin#24595 (move g_versionbitscache global to ChainstateManager)
2dc0a25 lint: update circular dependencies allowlist (Kittywhiskers Van Gogh)
95d5f97 merge bitcoin#24595: move g_versionbitscache global to ChainstateManager (Kittywhiskers Van Gogh)
14a77f6 refactor: accept `ChainstateManager` in `CMNHFManager` ctor (Kittywhiskers Van Gogh)
838cfcb refactor: move `IsQuorumTypeEnabled` to `ChainstateManager` (Kittywhiskers Van Gogh)
d4dc191 refactor: adapt LLMQ logic to `DeploymentActive{At,After}` (Kittywhiskers Van Gogh)
2f9210f refactor: abstract masternode structures from Qt wallet (Kittywhiskers Van Gogh)
dc3f6bd trivial: force stricter lambda signature for `ForEachMN{,Shared}()` (Kittywhiskers Van Gogh)
a223b8c refactor: adapt CbTx, CreditPool logic to `DeploymentActive{At,After}` (Kittywhiskers Van Gogh)
b25e4fd refactor: adapt ProTx logic to `DeploymentActive{At,After}` (Kittywhiskers Van Gogh)
07ea998 partial bitcoin#24595: move g_versionbitscache global to ChainstateManager (Kittywhiskers Van Gogh)
Pull request description:
## Additional Information
* Depends on #6923
* To reduce the diff size owing to Dash's extensive use of hardforks, `DeploymentActive{After,At}()` calls that simply require a height check have been moved to an explicit height check. This reduces the amount of "thread the needle" refactoring needed to provide `ChainstateManager`.
* As the versionbits cache is now a member of `ChainstateManager`, all `DeploymentActive{After,At}()` calls needed to be adapted to pass a reference to `ChainstateManager`, which has necessitated substantial refactoring. For this reason, the backport has been isolated into a separate PR.
> ℹ️ **Note**
>
> This text was written back when `CDeterministicMNList` and `CDeterministicMN` needed to accept `ChainstateManager`. Through hardening, this is no longer true. The underlying logic has still been retained to allow for future forks which may impact deterministic masternode logic.
* Currently, Qt code is knowledgeable of objects like `CDeterministicMNList` and `CDeterministicMN`. This was fine because none of the functions called demanded knowledge of classes explicitly isolated from Qt code like `CChainState`, access to which is instead mediated through interfaces.
* As the deglobalization now requires knowledge of `ChainstateManager`, both `CDeterministicMNList` and `CDeterministicMN` have been implemented as interfaces `interfaces::MnList` and `interfaces::MnEntry` respectively.
* The problem of ensuring access to the context as `CDeterministicMNList` is updated from sources that cannot set the context themselves has been managed with a workaround, namely `interfaces::MnList::copyContextTo()`. The lifecycle of `MnList` will be as follows:
A blank `MnList` is initialised without a context
https://github.com/dashpay/dash/blob/1dcd28147a1eed2bb1096b5eb20073aa368b9dae/src/qt/clientmodel.cpp#L53
The latest `MnList` is fetched with `interfaces::EVO::getListAtChainTip()`
https://github.com/dashpay/dash/blob/1dcd28147a1eed2bb1096b5eb20073aa368b9dae/src/qt/clientmodel.cpp#L120-L126
`interfaces::EVO` lends its node context to the `MnList`
https://github.com/dashpay/dash/blob/1dcd28147a1eed2bb1096b5eb20073aa368b9dae/src/node/interfaces.cpp#L197-L206
Calls like `interfaces::MnList::getProjectedMNPayees()` now work
https://github.com/dashpay/dash/blob/1dcd28147a1eed2bb1096b5eb20073aa368b9dae/src/node/interfaces.cpp#L166-L174
Event handler gives us the newest masternode list but doesn't have access to node context
https://github.com/dashpay/dash/blob/1dcd28147a1eed2bb1096b5eb20073aa368b9dae/src/qt/clientmodel.cpp#L322-L325
Context from older masternode list is copied into newer list
https://github.com/dashpay/dash/blob/1dcd28147a1eed2bb1096b5eb20073aa368b9dae/src/qt/clientmodel.cpp#L108
## 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 2dc0a25
Tree-SHA512: 43523121366dd940ebf3eca3e30a7988412d438a4b11e7d9b1e27adfbdfb9778888a8f7bd67b2837bf907704e6a2c43d6884ad284dbbdf9fc8ecee17b71992cdFile tree
64 files changed
+977
-660
lines changed- src
- coinjoin
- evo
- governance
- interfaces
- llmq
- node
- qt
- rpc
- test
- fuzz
- util
- test/lint
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
64 files changed
+977
-660
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
| 1047 | + | |
| 1048 | + | |
1050 | 1049 | | |
1051 | 1050 | | |
1052 | 1051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
23 | | - | |
| 20 | + | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| |||
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
| 36 | + | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
| 151 | + | |
153 | 152 | | |
154 | | - | |
| 153 | + | |
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
| |||
178 | 177 | | |
179 | 178 | | |
180 | 179 | | |
181 | | - | |
| 180 | + | |
182 | 181 | | |
183 | 182 | | |
184 | | - | |
| 183 | + | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
329 | | - | |
| 330 | + | |
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | | - | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
129 | | - | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
138 | | - | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | | - | |
145 | | - | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
0 commit comments