Skip to content
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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

kwvg
Copy link
Collaborator

@kwvg kwvg commented Dec 2, 2024

Additional Information

  • Depends on refactor: move CInstantSendManager::AskNodesForLockedTx into PeerManager #6425
  • Dependency for backport: merge bitcoin#23280 (coalesce chainstate loading sequence between {,non-}unittest codepaths) #6304
  • In order to reduce the logic used in chainstate initialization (that will be split out of init.cpp in bitcoin#23280), the spinning up of threads (as done in LLMQContext::Start()) needs to be moved down.
    • They were moved up in 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 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 no NodeContext, source)
      • 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:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (note: N/A)
  • I have added or updated relevant unit/integration/functional/e2e tests (note: N/A)
  • I have made corresponding changes to the documentation (note: N/A)
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@kwvg kwvg modified the milestones: 22.1, 22 Dec 2, 2024
Copy link

github-actions bot commented Dec 3, 2024

This pull request has conflicts, please rebase.

@kwvg kwvg marked this pull request as ready for review December 4, 2024 18:47
@kwvg
Copy link
Collaborator Author

kwvg commented Dec 4, 2024

Latest changes are whitespace only (applying clang-format-diff.py suggestions on a commit-by-commit basis)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant