Skip to content

Commit 7a549c4

Browse files
Merge #6742: refactor: move InstantSend impl. to src/instantsend/ and split sources for islock, database and masternode logic out of manager source
6360725 chore: resolve incomplete/missing copyright headers in unit tests (Kittywhiskers Van Gogh) d1de786 chore: cleanup unused headers from instantsend (dependent) sources (Kittywhiskers Van Gogh) b4d1bd2 refactor: `llmq::CInstantSendLock{,Ptr}` > `instantsend::InstantSendLock{,Ptr}` (Kittywhiskers Van Gogh) 8d78e7d refactor: remove need for mutual access to private members (Kittywhiskers Van Gogh) f22fb22 refactor: separate masternode mode logic into dedicated manager class (Kittywhiskers Van Gogh) 544791d refactor: move masternode mode logic to `instantsend/signer.{cpp,h}` (Kittywhiskers Van Gogh) 82dded4 refactor: move `CInstantSendDb` definition to `instantsend/db.{cpp,h}` (Kittywhiskers Van Gogh) 5e70456 refactor: move `CInstantSendLock` definition to `instantsend/lock.{cpp,h}` (Kittywhiskers Van Gogh) ac8dcdd refactor: move `CInstantSendManager` constructor to source file (Kittywhiskers Van Gogh) 9edd27b refactor: `llmq/instantsend.{cpp,h}` > `instantsend/instantsend.{cpp,h}` (Kittywhiskers Van Gogh) Pull request description: ## Motivation Currently, the `llmq` namespace includes the LLMQ subsystem itself and capabilities built on them, primarily InstantSend and ChainLocks. Both capabilities play a key part in block and validation logic (see `CChainHelper` passthrough functions, [source](https://github.com/dashpay/dash/blob/9310ebc43cdc4ccde7b3033f4d18139258d7c7ad/src/evo/chainhelper.cpp#L28-L60)). Currently, we have to setup all LLMQ infrastructure (i.e. `LLMQContext`) in order to validate on-disk information. This ceases to be feasible when extracting validation code that interacts with on-disk state into `libbitcoinkernel` through `bitcoin-chainstate` (see [bitcoin#24304](bitcoin#24304)) as this thinned down library is devoid of networking capabilities. As LLMQ is inherently an interactive system that is tied to networking capabilities, to extract on-disk state validation logic, we need to separate out networking from non-networking concerns. This pull request is the first step in extracting networking logic by first splitting out the monolithic InstantSend implementation into smaller concerns and then spinning off masternode-mode logic into a dedicated manager. Future work should aim to spit out non-masternode networking code into a separate concern and eventually thin down `llmq::CInstantSendManager` to be capable of running with a networking-disabled mode, which would be adequate for `libbitcoinkernel`. ## 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 6360725 Tree-SHA512: 174532789cc390d0c027016a5f72b4fe1979ac10597d8bfc50e2f8edb739cc26c1fd298f2ecc82b048026c8b8e560083dbae41105e8dcde57bb8d92df0621ca1
2 parents a59a72a + 6360725 commit 7a549c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1524
-1262
lines changed

src/Makefile.am

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ BITCOIN_CORE_H = \
230230
interfaces/ipc.h \
231231
interfaces/node.h \
232232
interfaces/wallet.h \
233+
instantsend/db.h \
234+
instantsend/instantsend.h \
235+
instantsend/lock.h \
236+
instantsend/signing.h \
233237
key.h \
234238
key_io.h \
235239
limitedmap.h \
@@ -243,7 +247,6 @@ BITCOIN_CORE_H = \
243247
llmq/dkgsessionhandler.h \
244248
llmq/dkgsessionmgr.h \
245249
llmq/ehf_signals.h \
246-
llmq/instantsend.h \
247250
llmq/options.h \
248251
llmq/params.h \
249252
llmq/quorums.h \
@@ -488,6 +491,10 @@ libbitcoin_node_a_SOURCES = \
488491
index/coinstatsindex.cpp \
489492
index/txindex.cpp \
490493
init.cpp \
494+
instantsend/db.cpp \
495+
instantsend/instantsend.cpp \
496+
instantsend/lock.cpp \
497+
instantsend/signing.cpp \
491498
llmq/blockprocessor.cpp \
492499
llmq/chainlocks.cpp \
493500
llmq/clsig.cpp \
@@ -498,7 +505,6 @@ libbitcoin_node_a_SOURCES = \
498505
llmq/dkgsessionhandler.cpp \
499506
llmq/dkgsessionmgr.cpp \
500507
llmq/ehf_signals.cpp \
501-
llmq/instantsend.cpp \
502508
llmq/options.cpp \
503509
llmq/quorums.cpp \
504510
llmq/signing.cpp \

src/bench/rpc_blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <bench/data.h>
77

88
#include <consensus/validation.h>
9+
#include <instantsend/instantsend.h>
910
#include <llmq/chainlocks.h>
1011
#include <llmq/context.h>
11-
#include <llmq/instantsend.h>
1212
#include <rpc/blockchain.h>
1313
#include <streams.h>
1414
#include <test/util/setup_common.h>

src/coinjoin/coinjoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <chainparams.h>
1010
#include <consensus/validation.h>
1111
#include <governance/common.h>
12+
#include <instantsend/instantsend.h>
1213
#include <llmq/chainlocks.h>
13-
#include <llmq/instantsend.h>
1414
#include <masternode/node.h>
1515
#include <masternode/sync.h>
1616
#include <messagesigner.h>

src/dsnotificationinterface.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616

1717
#include <evo/deterministicmns.h>
1818
#include <evo/mnauth.h>
19-
19+
#include <instantsend/instantsend.h>
2020
#include <llmq/chainlocks.h>
2121
#include <llmq/context.h>
2222
#include <llmq/dkgsessionmgr.h>
2323
#include <llmq/ehf_signals.h>
24-
#include <llmq/instantsend.h>
2524
#include <llmq/quorums.h>
2625

2726
CDSNotificationInterface::CDSNotificationInterface(CConnman& connman,

src/evo/chainhelper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
#include <consensus/params.h>
88
#include <evo/specialtxman.h>
9+
#include <instantsend/instantsend.h>
10+
#include <instantsend/lock.h>
911
#include <llmq/chainlocks.h>
10-
#include <llmq/instantsend.h>
1112
#include <masternode/payments.h>
1213

1314
CChainstateHelper::CChainstateHelper(CCreditPoolManager& cpoolman, CDeterministicMNManager& dmnman,

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@
8787
#include <evo/mnhftx.h>
8888
#include <flat-database.h>
8989
#include <governance/governance.h>
90+
#include <instantsend/instantsend.h>
9091
#include <llmq/context.h>
9192
#include <llmq/dkgsessionmgr.h>
9293
#include <llmq/options.h>
9394
#include <llmq/signing.h>
94-
#include <llmq/instantsend.h>
9595
#include <masternode/meta.h>
9696
#include <masternode/node.h>
9797
#include <masternode/sync.h>

0 commit comments

Comments
 (0)