* version: Bump PROTOCOL_VERSION and MIN_MASTERNODE_PROTO_VERSION
* version: Introduce LLMQ_DATA_MESSAGES_VERSION for QGETDATA/QDATA support
* test: Bump MY_VERSION to 70219 (LLMQ_DATA_MESSAGES_VERSION)
* llmq: Introduce CQuorumDataRequest as wrapper for QGETDATA requests
* llmq: Implement CQuorum::{SetVerificationVector, SetSecretKeyShare}
* llmq|net|protocol: Implement QGETDATA/QDATA P2P messages
* llmq: Restrict processing QGETDATA/QDATA to masternodes only
* llmq: Implement request limiting for QGETDATA/QDATA
* llmq: Implement CQuorumManger::RequestQuorumData
* rpc: Implement "quorum getdata" as wrapper around QGETDATA
Allows to trigger sending QGETDATA messages to connected peers by RPC.
* test: Handle QGETDATA/QDATA messages in mininode
* test: Add data structures to support QGETDATA/QDATA
* test: Add some helper in test_framework.py
* test: Implement tests for QGETDATA/QDATA in p2p_quorum_data.py
* test: Add p2p_quorum_data.py to BASE_SCRIPTS
* llmq|test: Add QWATCH support for QGETDATA/QDATA
* llmq: Store CQuorumPtr in cache, not CQuorumCPtr
* llmq: Fix cache usage after recent changes
* Use uacomment to create/find specific p2ps
* No need to use network adjusted time here, GetTime should be enough
* rpc: check proTxHash
* minor tweaks
* test: Adjustments after 4e27d6513e
* llmq: Rename and improve error lambda in CQuorumManager::ProcessMessage
* llmq: Process QDATA if -watchquorums is enabled
* test: Handle qwatch messages in mininode
* test: Add test for -watchquorums support
* test: Just some empty lines
* test: Properly stop the p2p network thread at the end of the test
* rpc: Adjust "quorum getdata" parameter descriptions
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
* rpc: Fix optionality of proTxHash in "quorum getdata" command
* test: Test optionality of proTxHash for "quorum getdata" command
* test: Be more specific about imports in p2p_quorum_data.py
* llmq|rpc: Add some comments about the request.GetDataMask checks
* test: Some more empty lines
* rpc: One more parameter description
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
* test: Unify assert statements / drop parentheses for all of them
* fix typo
Signed-off-by: pasta <pasta@dashboost.org>
* adjust some line wrapping to 80 chars
Signed-off-by: pasta <pasta@dashboost.org>
* tests: Seperate out into dif atomic methods, add logging
Signed-off-by: pasta <pasta@dashboost.org>
* test: Avoid restarting masternodes, just let available requests expire
Just takes a lot time and isn't required imo.
* test: Drop redundant code/tests after separation
This was introduced in 9e224ec2f2
* test: Merge three tests
"test_mnauth_restriction", "test_invalid_messages" and "test_invalid_unexpected_qdata" with the resulting name "test_basics" because i don't feel like DKG recovery thing should be part of a test called "test_invalid_messages" and giving it an own test probably wouldn't make a lot sense because it would still depend on "test_invalid_messages". I also think there is no need for a separated "test_invalid_unexpected_qdata".
* test: Rename test_ratelimiting_banscore -> test_request_limit
* test: Apply python style
* test: Wrap all at 120 characters
Thats the default "draw annoying warnings" setting for PyCharm (and IMO a reasonable line length).
* test: Move some variables
* test: Optimize for speed
* tests: use wait_until in get_mininode_id
* test: Don't use `!=` to check for `None`
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
* fix typos
Signed-off-by: pasta <pasta@dashboost.org>
* remove unneeded initialization
Signed-off-by: pasta <pasta@dashboost.org>
* make method const
Signed-off-by: pasta <pasta@dashboost.org>
* use default for trivial destructor
Signed-off-by: pasta <pasta@dashboost.org>
* governance: remove all typedefs for iterators, use auto instead
Signed-off-by: pasta <pasta@dashboost.org>
* remove redundant size_type
Signed-off-by: pasta <pasta@dashboost.org>
* Remove unused and singly used typedefs
Signed-off-by: pasta <pasta@dashboost.org>
* remove unused code
Signed-off-by: pasta <pasta@dashboost.org>
* mark constructor as explicit
Signed-off-by: pasta <pasta@dashboost.org>
* remove unused typedef
Signed-off-by: pasta <pasta@dashboost.org>
* remove unneeded initialization
Signed-off-by: pasta <pasta@dashboost.org>
* remove singly used typedef
Signed-off-by: pasta <pasta@dashboost.org>
* pass const reference, and don't copy for no reason
Signed-off-by: pasta <pasta@dashboost.org>
* make method const
Signed-off-by: pasta <pasta@dashboost.org>
* make method const
Signed-off-by: pasta <pasta@dashboost.org>
* make method const
Signed-off-by: pasta <pasta@dashboost.org>
* typo
Signed-off-by: pasta <pasta@dashboost.org>
* make constructor explicit
Signed-off-by: pasta <pasta@dashboost.org>
* Clang-Tidy: 'virtual' is redundant since the function is already declared 'override'
Signed-off-by: pasta <pasta@dashboost.org>
* Clang-Tidy: Prefer using 'override' or (rarely) 'final' instead of 'virtual'
Signed-off-by: pasta <pasta@dashboost.org>
* use default for trivial destructor
Signed-off-by: pasta <pasta@dashboost.org>
* remove unused include
Signed-off-by: pasta <pasta@dashboost.org>
* remove unneeded semicolon
Signed-off-by: pasta <pasta@dashboost.org>
* fix typos
Signed-off-by: pasta <pasta@dashboost.org>
* fix typo
Signed-off-by: pasta <pasta@dashboost.org>
* mark constructor explicit
Signed-off-by: pasta <pasta@dashboost.org>
* remove unused typedef
Signed-off-by: pasta <pasta@dashboost.org>
* remove commented out code
Signed-off-by: pasta <pasta@dashboost.org>
* mark constructor explicit
Signed-off-by: pasta <pasta@dashboost.org>
* remove unused spork
Signed-off-by: pasta <pasta@dashboost.org>
* remove boolean check where always true
Signed-off-by: pasta <pasta@dashboost.org>
* make method const
Signed-off-by: pasta <pasta@dashboost.org>
* Remove nCount completely
Signed-off-by: pasta <pasta@dashboost.org>
* Use default path
Signed-off-by: pasta <pasta@dashboost.org>
* llmq: Detach dash-q-cachepop from caller
There should be no reason to keep this tread attached
to its parent, if so, let me know.
* llmq: Avoid nullptr access for pindexStart in ScanQuorums
* llmq: Add cacheKey in ProcessCommitment
* llmq: Erase minable commitments if they have been processed
* llmq: Add CLLMQUtils::InitQuorumsCache
* llmq: Use unordered_lru_cache for quorumsCache and rename it
* llmq: Use unordered_lru_cache for hasMinedCommitmentCache and rename it
* llmq: Drop redundant check
* llmq: Rename nMaxCount2 -> nScanCommitments
* llmq: Refactor storeCache -> fCacheExists
* llmq: Rename maxCount -> nCountRequested
* llmq: Rename result -> vecResultQuorums
* llmq: Return an empty vector if the are zero elements requested
* unordered_lru_cache: Add max_size()
* llmq: Partially reuse existing cache if more than max is requested
* llmq: std::map<LLMQType, unordered_lru_cache<...>> for scanQuoumsCache
* llmq: Drop params
* llmq: Only emplace to cache if there is something available
* Check mnemonic passphrase size in SetMnemonic instead of CreateWalletFromFile
* Move processing of cmd-line options and recovery via hdseed out of GenerateNewHDChain
* Implement GenerateNewHDChainEncrypted and tweak EncryptHDChain to be able to generate new encrypted HD chains in an already encrypted wallet
* rpc: Implement upgradetohd rpc
* Address review comments
* tweak rpc response
* tests: Test various non-HD to HD wallet upgrade paths
* Apply suggestions from code review
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* Fix suggestions
* tests: Check upgradetohd return value
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* llmq: Add CDKGSessionManager::WriteEncryptedContributions
Allows to store each member's encrypted contributions of the DKG.
* llmq: Store each member's contributions in the llmq database
* llmq: Add CDKGSessionManager::GetEncryptedContributions
I decided to don't cache here since its probably very unlikely this is called twice in a short period with what we have planed for it so far. We can add caching if the requirement for it changes at some point?
* Merge #16509: test: Adapt test framework for chains other than "regtest"
faf36838bdba7393960fce6ad0c56dc1f93f5870 test: Avoid hardcoding the chain name in combine_logs (MarcoFalke)
fa8a1d7ba30040f8c74f93fc41a61276c255a6a6 test: Adapt test framework for chains other than "regtest" (MarcoFalke)
68f546635d5de2ccfedadeabc7bc79e12e5eca6a test: Fix “local variable 'e' is assigned to but never used” (Ben Woosley)
Pull request description:
This is required for various work in progress:
* testchains #8994
* signet #16411
* some of my locally written tests
While it will be unused in the master branch as of now, it will make all of those pull requests shorter. Thus review for non-regtest tests can focus on the actual changes and not some test framework changes.
ACKs for top commit:
jonatack:
ACK faf36838bdba7393960fce6ad0c56dc1f93f5870, ran tests and reviewed the code.
Tree-SHA512: 35add66c12cab68f2fac8f7c7d47c604d3f24eae9336ff78f83e2c92b3dc08a25e7f4217199bac5393dd3fb72f945bba9c001d6fbb8efd298c88858075fcb3d6
* Add devnet support for tests
* test: make sure devnet can connect to each other and start
* Partial merge bitcoin/bitcoin#16681: Tests: Use self.chain instead of 'regtest' in almost all current tests, revert one TODO while at it
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: Jorge Timón <jtimon@jtimon.cc>
* Use single-threaded scheduler for IS, CL and Governance notifications
* Pass shared_ptr-s instead of objects themselves for CL, IS and Governance notifiers in CMainSignals/CValidatibnInterface
* llmq: Create shared_ptr for clsig at the root of its lifetime
* llmq: Create shared_ptr for islock clsig at the root of its lifetime
* llmq: Create shared_ptr for recSig at the root of its lifetime
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
* bls: Adjust CBLSIESEncryptedBlob to match CBLSIESMultiRecipientBlobs
With this change a single encrypted object of CBLSIESMultiRecipientBlobs is has the same structure like CBLSIESEncryptedBlob
* bls: Add CBLSIESEncryptedObject constructor
* bls: Add CBLSIESMultiRecipientObjects::Get
Allows to query a individual encrypted object as CBLSIESEncryptedObject
* bls: Drop unneeded constructor call
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* Implement auto-recovery from hardforks
This should help users who fail to update their nodes/wallets in time when there is a hardfork.
* tests: tweak feature_llmq_chainlocks.py to check new behaviour
* tests: tidy up feature_llmq_chainlocks.py a bit
* Fix a couple of issues with multikey sporks cleanup
1. Should remove sporks with signatures from unknown signers from mapSporksActive
2. Should advance itSignerPair while doing (1)...
* tests: make sure sporks cleanup works as expected for multikey sporks
* tests: make sure multiple multikey sporks (and their cleanups) work together as expected
* Prettify node extra args
* Do not use CTxDSIn when we don't care about PS rounds
Also refactor CreateCollateralTransaction
* Track input rounds via CTxDSIn and not via CTxOut
* refactor: Create collateral transactions in CPrivateSendClientSession
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
* wallet: Update wallet utxo set when new keys are found for already known transactions
* Update src/wallet/wallet.cpp
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* Store CInputCoin-s instead of COutpoint-s in CompactTallyItem
* Calculate base size in CTransactionBuilder ctor based on actual scriptPubKey-s
It breaks on non-p2pkh otherwise.
* llmq: Refactor CQuorumManager::{BuildQuorumFromCommitment, GetQuorum}
Construct and cache new quorums inside BuildQuorumFromCommitment
* llmq: Make all methods of CQuorumManager const
* More accurate handling of the BLOCK_CONFLICT_CHAINLOCK flag
* Update test/functional/feature_llmq_chainlocks.py
Co-authored-by: thephez <thephez@users.noreply.github.com>
* tests: make sure that previous tip on the reorged node is marked conflicting after chainlock
* Apply suggestions from code review
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* Add masternode info to peer page
* Update src/qt/forms/debugwindow.ui
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* Use verifiedProRegTxHash to check if node is masternode
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* llmq: Split CSigShare creation/processing in CSigSharesManager
* rpc: Add "submit" parameter to "quorum sign"
* test: Add CSigShare and msg_qsigshare to messages.py
* test: Test the optional "submit" parameter of "quorum sign"
* random: Introduce std::shuffle alternative for FastRandomContext
3db746beb4
* random: change std::random_shuffle calls to std::shuffle
https://en.cppreference.com/w/cpp/algorithm/random_shuffle (deprecated in c++14)
* random: change FastRandomContext std::random_shuffle calls to shuffle
* random: change last std::shuffle calls to Shuffle
std::shuffle doesn't accept only two arguments so we use FastRandomContext()
* llmq: use inherited FastRandomContext
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* llmq: use inherited FastRandomContext
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* Make the linter happy :)
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* Do not store hashes in ProcessPendingMessageBatch and do not pass them to ReceiveMessage-s
* follow up: refactor/unify code in ProcessPendingMessageBatch
* rpc: Rename platformAllowedCommands => mapPlatformRestrictions
* rpc: Use std::multimap instead of std::map for mapPlatformRestrictions
* rpc|init: Move restrictions to CRPCTable and initialize them in seperate
This is to allow restrictions based on the currently active network.
* rpc: Allow multiple parameter of type UniValue for mapPlatformRestrictions
* rpc: Add "quorum {sign,verify}" to the platform-user whitelist
* test: Add "quorum {sign, verify}" tests, test some invalid combinations
* rpc|test: Add verifyislock to platform-user whitelist
* Always show full version precision
Signed-off-by: pasta <pasta@dashboost.org>
* add field "formattedversion" to `getnetworkinfo` that is the version, to include rc info, commit info, dirty, etc as available
Signed-off-by: pasta <pasta@dashboost.org>
* use `buildversion` instead of `formattedversion`
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* adjust unit tests
Signed-off-by: pasta <pasta@dashboost.org>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* llmq: Add an optional quorum hash to CSigningManager::AsyncSignIfMember
Allows to select the quorum to sign by its hash.
* rpc: Fix quorum selection of "quorum sign"
* test: Test the optional "quorumHash" parameter of "quorum sign"
* llmq: Move quorum checks up to avoid calling WriteVoteForId if they fail
* llmq: Drop hash parameter in PreVerifyMessage methods
* llmq: Drop some unused variables
* rpc: Drop unused variable
* llmq|net: Drop some unused CConnman parameter
* llmq: Drop some unused quorum parameter
* llmq: Drop some unused nodeId parameter
* Drop unused variables
* llmq: Drop more
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* rpc: Introduce `quorum verify`
* test: Test both "quorum not found" paths
* rpc: Check both "quorum not found" failures in one place
* rpc: Adjust description of "quorum verify"
* auto -> int
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
* tests: Test all rpc commands in rpc_platform_filter.py
* bugfix: test "debug 1" instead of "stop" to avoid interference with the regular test shutdown process
* Apply suggestions from code review
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* llmq: Fix GetVerifiedContribution to return false in case of failure
* llmq: Move GetVerifiedContribution into GetVerifiedContributions
* llmq: Drop GetVerifiedContribution
* llmq: Keep cache locked while building GetVerifiedContributions result
* llmq: Read from DB into vvecPtr directly