backport: merge bitcoin#23280 (coalesce chainstate loading sequence between {,non-}unittest codepaths)#6304
Merged
Merged
Conversation
|
This pull request has conflicts, please rebase. |
|
This pull request has conflicts, please rebase. |
kwvg
force-pushed
the
bp_23280
branch
2 times, most recently
from
October 9, 2024 16:13
da80bdd to
1a0d125
Compare
kwvg
marked this pull request as ready for review
October 10, 2024 06:17
UdjinM6
previously approved these changes
Oct 10, 2024
UdjinM6
left a comment
There was a problem hiding this comment.
LGTM, light ACK 1a0d1256968d79af39b57de98e9a9612c2ee78cb
nit: clang format complains a bit
Collaborator
Author
|
Current approach of allowing |
kwvg
marked this pull request as draft
October 15, 2024 09:38
|
This pull request has conflicts, please rebase. |
5 tasks
PastaPastaPasta
added a commit
that referenced
this pull request
Dec 9, 2024
…erministicMNManager`, `LLMQContext` member ctors, reduce use in `CJContext` 7d26061 refactor: move `CConnman`, `PeerManager` out of `CCoinJoinClientQueueManager` ctor (Kittywhiskers Van Gogh) 953ba96 refactor: move `CConnman` out of `CoinJoinWalletManager` ctor (Kittywhiskers Van Gogh) ac930a8 refactor: remove unused `CConnman` from `CDeterministicMNManager` ctor (Kittywhiskers Van Gogh) a14e604 refactor: remove `CConnman`, `PeerManager` from `LLMQContext` ctor (Kittywhiskers Van Gogh) d9e5cc7 refactor: move `PeerManager` out of `CInstantSendManager` ctor (Kittywhiskers Van Gogh) 82d1aed refactor: move `CConnman`, `PeerManager` out of `CSigSharesManager` ctor (Kittywhiskers Van Gogh) 7498a38 refactor: move `PeerManager` out of `CSigningManager` ctor (Kittywhiskers Van Gogh) 7ebc61e refactor: move `CConnman` out of `CQuorumManager` ctor (Kittywhiskers Van Gogh) c07b522 refactor: move `CConnman` out of `CDKGSession{,Handler,Manager}` ctor (Kittywhiskers Van Gogh) 01876c7 refactor: move `PeerManager` out of `CDKGSession{,Handler,Manager}` ctor (Kittywhiskers Van Gogh) cc0e771 refactor: start BLS thread in `LLMQContext` ctor, move `Start` downwards (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Depends on #6425 * Dependency for #6304 * In order to reduce the logic used in chainstate initialization (that will be split out of `init.cpp` in [bitcoin#23280](bitcoin#23280)), the spinning up of threads (as done in `LLMQContext::Start()`) needs to be moved down. * They were moved up in [dash#5752](#5752) as `CBLSWorker` is a part of `LLMQContext` and `CBLSWorker` is needed during chainstate verification. As suggested in dash#5752, an alternate fix to the one already merged in was to move `CBLSWorker` `Start()`/`Stop()` to the constructor, which is done here. * Another alternate fix is that we move it out of `LLMQContext` entirely and let it remain in `NodeContext` though this approach has not been taken. * The reason we cannot retain the status quo is because `bitcoin-chainstate` (the binary introduced in [bitcoin#24304](bitcoin#24304) that's built on the code split off in [bitcoin#23280](bitcoin#23280)) aims to be devoid of P2P logic and this is reflected in the source files used to build it ([source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R794)). (Also, there's no `NodeContext`, [source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R795-R798)) * This means need to separate P2P and validation components from Dash-specific logic in order for the split to work as expected. This PR is a step in that direction by moving P2P elements (`CConnman` and `PeerManager`) out of constructors. * As it stands, there are two sources for Dash-specific components to have access to P2P components, initialization (e.g. through `LLMQContext::Start()` or `PeerManagerImpl::ProcessMessage()`). ## Breaking Changes None expected. While changes are present in initialization order, consensus behaviour should remain unchanged. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [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: knst: utACK 7d26061 UdjinM6: utACK 7d26061 Tree-SHA512: 4f12cbda935cad3a186acb31fed513cea489b0d3a55aa80be8e1336d10cbe1579d6d3db862a78a167134650c9e97816732acaf0c85ab759f6555b1b6be99ec02
Match formatting with what upcoming commits expect to limit conflicts
UdjinM6
previously approved these changes
Dec 16, 2024
UdjinM6
approved these changes
Dec 16, 2024
ab4cus
pushed a commit
to ab4cus/e4Coin-core
that referenced
this pull request
Jul 8, 2026
…erministicMNManager`, `LLMQContext` member ctors, reduce use in `CJContext` f27f564 refactor: move `CConnman`, `PeerManager` out of `CCoinJoinClientQueueManager` ctor (Kittywhiskers Van Gogh) 1d2f62c refactor: move `CConnman` out of `CoinJoinWalletManager` ctor (Kittywhiskers Van Gogh) 465b0c0 refactor: remove unused `CConnman` from `CDeterministicMNManager` ctor (Kittywhiskers Van Gogh) c9e56e4 refactor: remove `CConnman`, `PeerManager` from `LLMQContext` ctor (Kittywhiskers Van Gogh) 8555ae5 refactor: move `PeerManager` out of `CInstantSendManager` ctor (Kittywhiskers Van Gogh) 7a4b4e4 refactor: move `CConnman`, `PeerManager` out of `CSigSharesManager` ctor (Kittywhiskers Van Gogh) bd6f2a4 refactor: move `PeerManager` out of `CSigningManager` ctor (Kittywhiskers Van Gogh) e2b81dd refactor: move `CConnman` out of `CQuorumManager` ctor (Kittywhiskers Van Gogh) 6c7da9b refactor: move `CConnman` out of `CDKGSession{,Handler,Manager}` ctor (Kittywhiskers Van Gogh) 6a4de36 refactor: move `PeerManager` out of `CDKGSession{,Handler,Manager}` ctor (Kittywhiskers Van Gogh) 0836130 refactor: start BLS thread in `LLMQContext` ctor, move `Start` downwards (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Depends on dashpay/dash#6425 * Dependency for dashpay/dash#6304 * In order to reduce the logic used in chainstate initialization (that will be split out of `init.cpp` in [bitcoin#23280](bitcoin/bitcoin#23280)), the spinning up of threads (as done in `LLMQContext::Start()`) needs to be moved down. * They were moved up in [dash#5752](dashpay/dash#5752) as `CBLSWorker` is a part of `LLMQContext` and `CBLSWorker` is needed during chainstate verification. As suggested in dash#5752, an alternate fix to the one already merged in was to move `CBLSWorker` `Start()`/`Stop()` to the constructor, which is done here. * Another alternate fix is that we move it out of `LLMQContext` entirely and let it remain in `NodeContext` though this approach has not been taken. * The reason we cannot retain the status quo is because `bitcoin-chainstate` (the binary introduced in [bitcoin#24304](bitcoin/bitcoin#24304) that's built on the code split off in [bitcoin#23280](bitcoin/bitcoin#23280)) aims to be devoid of P2P logic and this is reflected in the source files used to build it ([source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R794)). (Also, there's no `NodeContext`, [source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R795-R798)) * This means need to separate P2P and validation components from Dash-specific logic in order for the split to work as expected. This PR is a step in that direction by moving P2P elements (`CConnman` and `PeerManager`) out of constructors. * As it stands, there are two sources for Dash-specific components to have access to P2P components, initialization (e.g. through `LLMQContext::Start()` or `PeerManagerImpl::ProcessMessage()`). ## Breaking Changes None expected. While changes are present in initialization order, consensus behaviour should remain unchanged. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [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: knst: utACK f27f564 UdjinM6: utACK f27f564 Tree-SHA512: 4f12cbda935cad3a186acb31fed513cea489b0d3a55aa80be8e1336d10cbe1579d6d3db862a78a167134650c9e97816732acaf0c85ab759f6555b1b6be99ec02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional Information
Dependent on backport: merge bitcoin#22772, #22987, #23185, #23157, #23173, #23249, #23211, #22677, #23649, #23683, #23636, #22626 (auxiliary backports: part 17) #6296
Dependent on refactor: move
CConnmanandPeerManagerout ofCDeterministicMNManager,LLMQContextmember ctors, reduce use inCJContext#6443As one of the backport's intentions were to unify code between
init.cppandsetup_common.cpp, Dash-specific initialization code (to the extent that it can be moved out non-disruptively) has been spun out intoDashChainstateSetup{,Close}()so it can also be used insetup_common.cppandvalidation_chainstatemanager_tests.cpp.This is also why
DashTestSetup{,Close}()(nowDashPostChainstateSetup{,Close}()) was introduced in dash#5531.DashChainstateSetup{,Close}()(as defined innode/chainstate.cpp) cannot takeNodeContextin becausenode/chainstate.cppis used inbitcoin-chainstate, which doesn't includeNodeContext(source), this is reflected by neitherLoadChainstatenorVerifyLoadedChainstatetaking inNodeContext.To make it less onerous to use in unit tests,
DashChainstateSetup{,Close}()has been overloaded with a variant that acceptsNodeContext.To remove
LogPrintfusage innode/chainstate.cpp, index enablement reporting has been pulled out of chainstate loading and BLS scheme reporting has been abstracted out usingnotify_bls_state.Breaking Changes
None expected.
Checklist