-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: move CConnman
and PeerManager
out of CDeterministicMNManager
, LLMQContext
member ctors, reduce use in CJContext
#6443
Conversation
This pull request has conflicts, please rebase. |
Latest changes are whitespace only (applying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM e5e3218
nits can be addressed in follow-up PR
src/llmq/dkgsessionhandler.h
Outdated
|
||
void StartThread(); | ||
void StartThread(PeerManager& peerman); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good solution to pass PeerManager when thread start. Wow!
Alternate fix as proposed in dash#5752, needed because dependencies for threaded logic will be pulled out of ctor in upcoming commits and that needs `Start` to be pushed downwards so we can avoid having to pass `unique_ptr` references.
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 7d26061
range-diff looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 7d26061
…ng sequence between {,non-}unittest codepaths) 1974651 refactor: move remaining `LogPrintf` usage outside (Kittywhiskers Van Gogh) 04dbaa8 style-only: Remove redundant scope in *Chainstate (Kittywhiskers Van Gogh) 872158d Remove all #include // for * comments (Kittywhiskers Van Gogh) 09ab629 test/setup: Use LoadChainstate (Kittywhiskers Van Gogh) 459f339 node/chainstate: extract Dash post-`InitializeChainstate` logic (Kittywhiskers Van Gogh) c06e074 node/chainstate: Add options for in-memory DBs (Kittywhiskers Van Gogh) 52bb35d node/caches: Remove intermediate variables (Kittywhiskers Van Gogh) 4ab1827 node/caches: Extract cache calculation logic (Kittywhiskers Van Gogh) d7f1e23 validation: VerifyDB only needs Consensus::Params (Kittywhiskers Van Gogh) c405492 node/chainstate: Decouple from ShutdownRequested (Kittywhiskers Van Gogh) fdf803d node/chainstate: Decouple from GetTime (Kittywhiskers Van Gogh) f7aef8d init: Delay RPC block notif until warmup finished (Kittywhiskers Van Gogh) 94c0ceb Move -checkblocks LogPrintf to AppInitMain (Kittywhiskers Van Gogh) d3345ee node/chainstate: Reduce coupling of LogPrintf (Kittywhiskers Van Gogh) a141f5d node/chainstate: Decouple from concept of uiInterface (Kittywhiskers Van Gogh) 913411e Split off VerifyLoadedChainstate (Kittywhiskers Van Gogh) 53231ca node/chainstate: Remove do/while loop (Kittywhiskers Van Gogh) 2ea1bbc Move init logistics message for BAD_GENESIS_BLOCK to init.cpp (Kittywhiskers Van Gogh) 29c7362 Move mempool nullptr Assert out of LoadChainstate (Kittywhiskers Van Gogh) 7071282 node/chainstate: Decouple from concept of NodeContext (Kittywhiskers Van Gogh) ee9d3dd node/chainstate: Decouple from ArgsManager (Kittywhiskers Van Gogh) d7419e4 node/chainstate: Decouple from stringy errors (Kittywhiskers Van Gogh) 9ab08c4 node/chainstate: Decouple from GetTimeMillis (Kittywhiskers Van Gogh) 2455c06 node: Extract chainstate loading sequence (Kittywhiskers Van Gogh) 620146b chore: sync chainstate loading logic with upstream (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Dependent on #6296 * Dependent on #6443 * As one of the backport's intentions were to unify code between `init.cpp` and `setup_common.cpp`, Dash-specific initialization code (to the extent that it can be moved out non-disruptively) has been spun out into `DashChainstateSetup{,Close}()` so it can also be used in `setup_common.cpp` and `validation_chainstatemanager_tests.cpp`. This is also why `DashTestSetup{,Close}()` (now `DashPostChainstateSetup{,Close}()`) was introduced in [dash#5531](#5531). * `DashChainstateSetup{,Close}()` (as defined in `node/chainstate.cpp`) cannot take `NodeContext` in because `node/chainstate.cpp` is used in `bitcoin-chainstate`, which doesn't include `NodeContext` ([source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R795-R798)), this is reflected by neither `LoadChainstate` nor `VerifyLoadedChainstate` taking in `NodeContext`. * To make it less onerous to use in unit tests, `DashChainstateSetup{,Close}()` has been overloaded with a variant that accepts `NodeContext`. * To remove `LogPrintf` usage in `node/chainstate.cpp`, index enablement reporting has been pulled out of chainstate loading and BLS scheme reporting has been abstracted out using `notify_bls_state`. ## 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 **(note: N/A)** - [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 1974651 PastaPastaPasta: utACK 1974651 Tree-SHA512: 8ebfce48dccc6a867339aff9374a4cb8dc7b02b0c17432db2b97c982523d0d9589a87e6527a103f314bf32be176486311ef6dcde1c4d5cdccc1eeb1f80bbb040
Additional Information
init.cpp
in bitcoin#23280), the spinning up of threads (as done inLLMQContext::Start()
) needs to be moved down.CBLSWorker
is a part ofLLMQContext
andCBLSWorker
is needed during chainstate verification. As suggested in dash#5752, an alternate fix to the one already merged in was to moveCBLSWorker
Start()
/Stop()
to the constructor, which is done here.LLMQContext
entirely and let it remain inNodeContext
though this approach has not been taken.bitcoin-chainstate
(the binary introduced in bitcoin#24304 that's built on the code split off in bitcoin#23280) aims to be devoid of P2P logic and this is reflected in the source files used to build it (source). (Also, there's noNodeContext
, source)CConnman
andPeerManager
) out of constructors.LLMQContext::Start()
orPeerManagerImpl::ProcessMessage()
).Breaking Changes
None expected. While changes are present in initialization order, consensus behaviour should remain unchanged.
Checklist: