* Use CountMasternodes() in ClientModel::getMasternodeCountString
* Use CountMasternodes() for total count in masternode_count
* Fix CountMasternodes() to give correct number of masternodes with spork15 enabled
Also change CountEnabled to not call CountMasternodes anymore but instead
have its own implementation which uses GetValidMNsCount instead of GetAllMNsCount
* Apply review suggestions
This is moving up the RemoveAskFor call above the ProcessTxLockRequest
call. If ProcessTxLockRequest fails, we should not re-request the same
TX/IX from other nodes as it will continue to fail.
* Check resulting signature for validity when signing with BLS operator keys
* Support specifying proTxHash when using "gobject vote-alias"
The "alias-name" is now interpreted as proTxHash when deterministic MN lists
are active.
The classical "alias" as found in masternode.conf has no meaning after
spork15 activation.
* Don't use masternode.conf list in gobject_vote_many when spork15 is active
Keys don't match anymore so we should only rely on the deterministic list
and the local wallet's keys.
* Check for pwalletMain not being null in gobject_vote_many
* Allow to use vote-conf for non-proposal votes when spork15 is active
This fixes sentinel not being able to create triggers on testnet.
* Fix error message
* Fix no-wallet compilation and check for pwalletMain at runtime
All logging that happens in BuildNewListFromBlock is currently printed twice.
This is because BuildNewListFromBlock is called while processing the block
and also while calculating the DIP4 MN list commitment.
This commit adds the debugLogs to this method to allow omitting logs while
called from the DIP4 code.
In the future, we should make sure that this method is only called for the
currently mined block or for old blocks, but never for non-existing blocks
further in the future.
Specifically:
```
GUI: QMetaObject::connectSlotsByName: No matching signal for on_extraInfoDIP3_doubleClicked()
GUI: QMetaObject::connectSlotsByName: No matching signal for on_copyProTxHash_clicked()
GUI: QMetaObject::connectSlotsByName: No matching signal for on_copyCollateralOutpoint_clicked()
```
* Move deserialization of REJECT message fields out of if(fDebug)
* Ban nodes which keep requesting and then rejecting blocks
* Don't read/deserialize reject hash twice
* Only use ban score of 1
* Clear votes which were created before spork15 activation
* Reject incoming votes which were created pre-DIP3
* Only use voting keys for VOTE_SIGNAL_FUNDING
The other vote signals are meant to be emitted by sentinel and must thus
be signed with the operator key.
* Simplify GetMinVoteTime
* Review suggestions/fixes
* Add missing mutex in CGovernanceObject::RemoveOldVotes
* Don't fully remove protx commands when ENABLE_WALLET is not set
* Check for wallet support at run-time for protx commands
* Only show subcommands that require the wallet when ENABLE_WALLET is set
* Add and use CheckWalletOwnsKey which is able to check wallet support at runtime
* Properly handle disabled wallets in "protx list"
This now also handles the case where ENABLE_WALLET is not defined.
* Drop comment that doesn't fully apply anymore
* Deserialize CFinalCommitmentTxPayload instead of CFinalCommitment in TxToJSON
* Implement ToJson for CFinalCommitmentTxPayload and use it in TxToJSON
Otherwise the nVersion and nHeight members of it are not shown.
* Let GetMasternodeRank also return the block hash at the given height
* Add outpointConfirmedBlock to CTxLockVote and verify it
* Match order of parameters with member order
* Rename outpointConfirmedBlock to quorumModifierHash
* Add overload of GetMasternodeRank that does not return the block hash
* Allow to skip sig verification for CFinalCommitment::Verify
* Add CFinalCommitmentTxPayload and CheckLLMQCommitment and use it
As described in https://github.com/dashpay/dips/pull/31 (see discussion).
* Properly ban nodes for invalid commitments
* Add SPORK_17_QUORUM_DKG_ENABLED spork
* Implement CDummyDKG and CDummyCommitment until we have the real DKG merged
This is only used on testnet/devnet/regtest and will NEVER be used on
mainnet. It is NOT SECURE AT ALL!
See comment in quorums_dummydkg.h for more details.
* Test simple PoSe in DIP3 tests
* Generate 2 instead of 4 blocks per iteration in PoSe tests
4 was based on old chainparams where I used larger phases.
* Only sleep when necessary in PoSe tests
* Fix typo in comment
* Give PoSe tests more time and sync after fast-forward
* Sleep in wait_for_instant_lock when TX is not known yet
We'll otherwise stress the CPU quite a lot, which might in turn result in
instant send timeouts.
* Wait for all nodes to have the instant send lock
Otherwise individual nodes might end up not being able to catch up,
especially when it's the last iteration and we generate 6 blocks after it.
* Use getrawtransaction in wait_for_instant_lock instead of gettransaction
gettransaction fails if the TX is not owned by the wallet
* Give instant send tests more time after DIP3 activation
Signature verification changes to BLS when DIP3 gets activated, which is
much more resource hungry. Give instant send tests more time after DIP3
activation until we do proper batched verification of instant send
signatures.
* Allow specifing max number of outpoints to be returned per address in SelectCoinsGroupedByAddresses
Fixes CreateDenominated failure for addresses with huge amount of inputs
* Apply suggested fixes
Members which are not in the validMembers bitsets are now PoSe punished.
The maximum PoSe score is dynamic and mostly identical to the number of
registered MNs. Added PoSe scores for failures are then a percentage of
the maximum score, so that we can better control how often failures are
allowed per payment cycle. For LLMQ failures, this is 66% to allow
approximately 2 failures per payment cycle.
* Add LLMQ parameters to consensus params
* Add DIP6 quorum commitment special TX
* Implement CQuorumBlockProcessor which validates and handles commitments
* Add quorum commitments to new blocks
* Propagate QFCOMMITMENT messages to all nodes
* Allow special transactions in blocks which have no inputs/outputs
But only for TRANSACTION_QUORUM_COMMITMENT for now.
* Add quorum commitments to self-crafted blocks in DIP3 tests
* Add simple fork logic for current testnet
This should avoid a fork on the current testnet. It only applies to the
current chain which activated DIP3 at height 264000 and block
00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f.
When we revert the chain to retest the DIP3 deployment, this fork logic
can be removed again.
* Use quorumVvecHash instead of quorumHash to make null commitments unique
Implementation of https://github.com/dashpay/dips/pull/31
* Re-add quorum commitments after pruning mempool selected blocks
* Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements
Also add BEGIN/END markers for temporary code.
* Add comments/documentation to LLMQParams
* Move code which determines if a commitment is required into IsCommitmentRequired
This should make the code easier to read and also removes some duplication.
The also changes the error types that are possible from 3 to 2 now. Instead
of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is
only "bad-qc-not-allowed" now.
* Use new parameter from consensus parames for the temporary fork
* check request is not empty to use it for filtering
* Filter vote INVs by tx hash
* fix lock requests filtering
* Apply suggestions from code review
Co-Authored-By: gladcow <sergey@dash.org>
* Properly initialize confirmedHash in CSimplifiedMNListEntry
* Add consensus params for temporary hard-fork on testnet
This hard-fork is required on testnet as we have to fix a few consensus
bugs in DIP3/DIP4. It will also be required to introduce LLMQ commitments
to testnet.
* Add temporary fork-logic for testnet, which sets confirmedHash to null
...before fork activation. Otherwise we'd invalidate all DIP3 blocks on
testnet.
* Bump nTemporaryTestnetForkHeight to 273000