Skip to content

Commit

Permalink
Merge #6282: refactor: drop some of circular dependencies over dkgses…
Browse files Browse the repository at this point in the history
…sion

74a5a9f style: apply clang-format (Konstantin Akimov)
db9798f refactor: move call GetQuorumMembers inside Init() (Konstantin Akimov)
9593566 refactor: move pQuorumBaseBlockIndex from Init() to constructor in CDKGSession (Konstantin Akimov)
9f3eb6b perf: check DIP0003 before CDKGSession initialization (Konstantin Akimov)
7f815cb refactor: remove unused constructor of CDKGLogger (Konstantin Akimov)
c82672a refactor: remove dependency of CDKGSession on PeerManager (Konstantin Akimov)
fb78b0c refactor: remove retBan flag from ReceiveMessage (Konstantin Akimov)
d26d4ab refactor: remove dependency of dkgsessionmgr on dkgsession (Konstantin Akimov)
d361b11 refactor: moved including llmq/dkgsession.h from dkgsessionmgr.h to cpp file (Konstantin Akimov)
e77aeb3 refactor: removed including quorums.h from chainlocks.h (Konstantin Akimov)
6f7068e refactor: remove exceeding evodb.h from headers (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  We have 72 circular dependencies of dash specific code. This PR removes 2 of them, over dkgsession.

  ## What was done?
  Refactor dkgsession initialization, message processing, dropped unused arguments, re-distributed code between functions and modules... See each commit.
  Also optimized headers: excluded evo/evodb.h and llmq/quorums.h from the headers where they are not needed.

  ## How Has This Been Tested?
  Run `test/lint/lint-circular-dependencies.sh`
  Run unit/functional tests

  ## Breaking Changes
  N/A

  ## 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
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK 74a5a9f
  PastaPastaPasta:
    utACK 74a5a9f

Tree-SHA512: f3adabe6a7bc6c4dcae6430be6857b31a0722d7f605d6651f3ff93c6fcb350a7312a9a0ecbda8ac131ffef6fbf2499700112de3990c7512ddb057bde7cc42665
  • Loading branch information
PastaPastaPasta committed Sep 25, 2024
2 parents 52928c5 + 74a5a9f commit 0a9a83f
Show file tree
Hide file tree
Showing 20 changed files with 249 additions and 169 deletions.
7 changes: 4 additions & 3 deletions src/evo/cbtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <consensus/validation.h>
#include <evo/cbtx.h>
#include <evo/deterministicmns.h>
#include <evo/simplifiedmns.h>
#include <evo/specialtx.h>
#include <llmq/blockprocessor.h>
#include <llmq/chainlocks.h>
#include <llmq/commitment.h>
#include <llmq/options.h>
#include <llmq/quorums.h>
#include <node/blockstorage.h>
#include <evo/simplifiedmns.h>
#include <evo/specialtx.h>
#include <consensus/validation.h>

#include <chain.h>
#include <chainparams.h>
Expand Down
1 change: 1 addition & 0 deletions src/evo/creditpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <evo/assetlocktx.h>
#include <evo/cbtx.h>
#include <evo/evodb.h>
#include <evo/specialtx.h>

#include <chain.h>
Expand Down
2 changes: 1 addition & 1 deletion src/evo/creditpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <coins.h>

#include <evo/assetlocktx.h>
#include <evo/evodb.h>

#include <saltedhasher.h>
#include <serialize.h>
Expand All @@ -23,6 +22,7 @@
class BlockManager;
class CBlockIndex;
class BlockValidationState;
class CEvoDB;
class TxValidationState;
namespace Consensus {
struct Params;
Expand Down
1 change: 1 addition & 0 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <evo/deterministicmns.h>
#include <evo/dmn_types.h>
#include <evo/dmnstate.h>
#include <evo/evodb.h>
#include <evo/providertx.h>
#include <evo/specialtx.h>
#include <llmq/commitment.h>
Expand Down
5 changes: 3 additions & 2 deletions src/evo/deterministicmns.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
#include <evo/dmnstate.h>

#include <arith_uint256.h>
#include <clientversion.h>
#include <consensus/params.h>
#include <crypto/common.h>
#include <evo/dmn_types.h>
#include <evo/evodb.h>
#include <evo/providertx.h>
#include <gsl/pointers.h>
#include <saltedhasher.h>
#include <scheduler.h>
#include <sync.h>
#include <gsl/pointers.h>

#include <immer/map.hpp>

Expand All @@ -30,6 +30,7 @@ class CBlock;
class CBlockIndex;
class CChainState;
class CConnman;
class CEvoDB;
class TxValidationState;

extern RecursiveMutex cs_main;
Expand Down
3 changes: 2 additions & 1 deletion src/evo/mnhftx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

#include <consensus/validation.h>
#include <deploymentstatus.h>
#include <evo/evodb.h>
#include <evo/mnhftx.h>
#include <evo/specialtx.h>
#include <llmq/commitment.h>
#include <llmq/signing.h>
#include <llmq/quorums.h>
#include <llmq/signing.h>
#include <node/blockstorage.h>

#include <chain.h>
Expand Down
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
#include <spork.h>
#include <walletinitinterface.h>

#include <evo/evodb.h>
#include <evo/chainhelper.h>
#include <evo/creditpool.h>
#include <evo/deterministicmns.h>
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/chainlocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <crypto/common.h>
#include <llmq/signing.h>
#include <llmq/quorums.h>
#include <net.h>
#include <net_types.h>
#include <primitives/block.h>
Expand All @@ -36,6 +35,7 @@ namespace llmq
{
class CSigningManager;
class CSigSharesManager;
enum class VerifyRecSigStatus;

class CChainLocksHandler : public CRecoveredSigsListener
{
Expand Down
Loading

0 comments on commit 0a9a83f

Please sign in to comment.