Commit Graph

15346 Commits

Author SHA1 Message Date
Salisbury
1270b71229 Use a verbosity instead of two verbose parameters (#2506) 2018-12-03 16:49:21 +01:00
Alexander Block
22dcec71a8
Punish nodes which keep requesting and then rejecting blocks (#2518)
* 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
2018-12-03 16:48:48 +01:00
Alexander Block
0224914200
Print the state object when ProcessSpecialTxsInBlock fails in ConnectBlock (#2516)
Currently, when any DIP2/3/6 validation fails, there is no error message
printed that shows what exactly went wrong.
2018-12-03 16:48:29 +01:00
Alexander Block
0c1b683a06 Clear votes which were created before spork15 activation and use operator key for non-funding votes (#2512)
* 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
2018-11-29 21:51:53 +03:00
Alexander Block
f6f6d075dc Still support "protx list" and "protx diff" when wallet is disabled at compile time (#2511)
* 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
2018-11-29 21:51:31 +03:00
Alexander Block
5a3f64310b Deserialize CFinalCommitmentTxPayload instead of CFinalCommitment in TxToJSON (#2510)
* 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.
2018-11-29 21:51:04 +03:00
Alexander Block
5da4c97284 Use "registered" as default for "protx list" (#2513)
"wallet" was confusing too many users as it shows an empty list if the local
wallet does not own any keys for any MN.
2018-11-29 15:31:37 +03:00
Alexander Block
f96563462b
Fix check for nTemporaryTestnetForkDIP3Height (#2508)
This caused a crash when performing a full-sync.
2018-11-29 09:12:51 +01:00
Alexander Block
fc6d651c43
Fix crashes in "protx" RPCs when wallet is disabled (#2509) 2018-11-29 09:12:41 +01:00
Alexander Block
35550a3f93
Add quorumModifierHash to instant send lock vote (#2505)
* 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
2018-11-28 11:43:28 +01:00
Alexander Block
812834dc5f
Put height into mined commitments and use it instead of the special handling of quorumVvecHash (#2501)
* 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
2018-11-27 08:04:08 +01:00
UdjinM6
ed53fce470 Revert "Apply similar logic to vecMasternodesUsed" (#2503)
This reverts commit ebb1200052.
2018-11-27 08:03:41 +01:00
thephez
ba49a4a160 Trivial: protx fund_register RPC help corrections (#2502) 2018-11-27 05:12:11 +01:00
Alexander Block
a4f5ba38b6
Implement CDummyDKG and CDummyCommitment until we have the real DKG merged (#2492)
* 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
2018-11-26 16:53:20 +01:00
Alexander Block
a18ca49a22
Disconnect peers with version < 70212 after DIP3 activation via BIP9 (#2497)
* Disconnect peers with version < 70212 after DIP3 activation via BIP9

* Send REJECT and log when diconnecting peers after DIP3 activation
2018-11-26 16:23:17 +01:00
Alexander Block
c248c48e4d
Try to fix a few sporadic instant send failures in DIP3 tests (#2500)
* 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.
2018-11-26 16:22:54 +01:00
Alexander Block
7a709b81d8 Perform less instant send tests in DIP3 tests (#2499)
These take quite some time on Travis.
2018-11-26 16:23:46 +03:00
Alexander Block
80656038fa Bump nTemporaryTestnetForkHeight to 274000 (#2498) 2018-11-26 16:23:29 +03:00
UdjinM6
69bffed72f
Do not sort resulting vector in SelectCoinsGroupedByAddresses (#2493)
Apply specific sort in each case separately instead (when needed).
2018-11-26 16:22:39 +03:00
Alexander Block
245c3220e9
Sync blocks before creating TXs (#2496) 2018-11-26 13:40:36 +01:00
InhumanPerfection
bb11f1a638 Fix recent changes in DSA conditions (#2494)
* pr2487 bugfix

* push reject msg
2018-11-25 23:52:56 +03:00
UdjinM6
6480ad1d5f
Should check dsq queue regardless of the mixing state (#2491) 2018-11-25 16:35:52 +03:00
Alexander Block
66612cc4b5 Add 0 entry to vTxSigOps when adding quorum commitments (#2489)
This fixes a crash observed on Travis. The same crash is likely to happen
outside of Travis as well later.
2018-11-25 16:27:56 +03:00
UdjinM6
67483cd340
Fix dsq/dsa conditions (#2487)
* Apply new dsq rules in StartNewQueue and DSACCEPT

* Apply similar logic to vecMasternodesUsed

* Add extra check for DSACCEPT
2018-11-25 16:27:43 +03:00
UdjinM6
9d4df466b9
Fix CreateDenominated failure for addresses with huge amount of inputs (#2486)
* 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
2018-11-25 16:27:31 +03:00
Alexander Block
0123517b48 Implement PoSe based on information from LLMQ commitments (#2478)
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.
2018-11-25 16:27:18 +03:00
-k
a4ea816b20 use aqua gui theme (#2472) 2018-11-25 16:27:04 +03:00
PastaPastaPasta
45421b1a3a Add IS parameter for gobject prepare (#2452)
* Add IS parameter for gobject prepare

* Update if statement

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>

* Update src/rpc/governance.cpp

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>

* Update src/rpc/governance.cpp

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
2018-11-25 16:26:50 +03:00
UdjinM6
65528e9e7b Bump masternodeman cache version (#2467) 2018-11-23 18:15:38 +01:00
Alexander Block
f5beeafa14
Also restart MNs which didn't have the collateral moved, but do it later (#2483) 2018-11-23 16:45:56 +01:00
Alexander Block
fa8f4a10cc
Include masternodeProTxHash in CTxLockVote (#2484)
* Introduce proTxHash to CActiveMasternodeInfo

* Include masternodeProTxHash in CTxLockVote
2018-11-23 16:33:45 +01:00
UdjinM6
aa495405b3 [GUI] Realign tx filter widgets (#2485)
Also hide watch-only filter when no watch-only addresses are used (corresponding column already has this kind of behaviour).
2018-11-23 16:23:15 +01:00
PastaPastaPasta
da4b5fb16e Remove an unused function from governance object collateral code (#2480) 2018-11-23 15:43:23 +01:00
Alexander Block
22b5952c5a
Implement and enforce DIP6 commitments (#2477)
* 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
2018-11-23 15:42:09 +01:00
UdjinM6
6c190d1bb3 Fix make deploy error on macos (#2475) 2018-11-23 15:41:39 +01:00
PastaPastaPasta
f4ef388dea Update PS help text for the new denom (#2471) 2018-11-23 15:41:00 +01:00
gladcow
a57e9dea74 Fix filtering of the lock votes for SPV nodes. (#2468)
* 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>
2018-11-23 15:40:19 +01:00
Alexander Block
d40a5ce31f
Properly initialize confirmedHash in CSimplifiedMNListEntry (#2479)
* 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
2018-11-23 10:40:46 +01:00
UdjinM6
df7d12b41f Add univalue test for real numbers (#2460) 2018-11-22 06:09:58 +01:00
UdjinM6
2b400f74b5 Base dsq/dstx thresholold on total number of up to date masternodes (#2465)
Mixing on a newer version with small number of upgraded masternodes
causes mixing txes to "stuck" - old nodes refuse to relay dstxes from new ones because
they come from the same masternodes too often. Basing threshold on the total number
of up to date masternodes and not only on a newer (enabled) ones should solve this.
This however will cause mixing to fail if there are not enough masternodes
on the needed protocol version (i.e. at least GetMinMasternodePaymentsProto())
but it's better to stop mixing than having funds kind of spent yet not confirmed
for a long time.
2018-11-22 06:09:35 +01:00
Alexander Block
5ffc31bce4
Forbid version=0 in special TXs (#2473) 2018-11-22 06:05:32 +01:00
Alexander Block
85157f9a9e
Few trivial fixes for DIP2/DIP3 (#2474)
* Fix wrong index for argument to protx_update_service when error is thrown

* Unify and fix variable name in TxToJSON

The UniValue variable name for TRANSACTION_COINBASE was wrong and is fixed
now. Also changed names for all other special TXs to unify names. This
should avoid such errors in the future when new "else if" branches are
copy/pasted.

* Use "proRegTx" instead of "proTx" as key TRANSACTION_PROVIDER_REGISTER payloads
2018-11-22 06:05:20 +01:00
Alexander Block
2ba1ff5216
Use ParseFixedPoint instead of ParseDoubleV in "protx register" commands (#2458) 2018-11-21 08:04:42 +01:00
Alexander Block
7cabbadefd
Implement context menu and extra info on double-click for DIP3 masternode list (#2459)
* Implement context menu and extra info on double-click for DIP3 masternode list

Menu items:
- "Copy ProTx hash"
- "Copy Collateral hash"

On double click:
Show simple message box with the json representation of the DMN.

* Fix review comments
2018-11-21 08:04:19 +01:00
InhumanPerfection
e049f9c1ea fix protx register rpc help (#2461) 2018-11-21 08:02:54 +01:00
PastaPastaPasta
eb2103760b trivail, clarifies help text for protx register (#2462) 2018-11-21 08:02:15 +01:00
UdjinM6
9232a455c8 Do not hold cs_main while emitting messages in WalletModel::prepareTransaction (#2463)
* Do not hold cs_main while emitting messages

Fixes potential deadlock:
```
POTENTIAL DEADLOCK DETECTED
Previous lock order was:
 (1) cs_deqsessions  privatesend-client.cpp:966
 (2) cs_main  privatesend-client.cpp:816
Current lock order is:
 (2) cs_main  qt/walletmodel.cpp:299
 wallet->cs_wallet  qt/walletmodel.cpp:299
 (1) cs_deqsessions  privatesend-client.cpp:350
```

* Keep CWalletTx* newTx in inner scope
2018-11-21 08:01:47 +01:00
strophy
76e93c7d7b Corrections to incorrect syntax in RPC help (#2466)
* Fix incorrect inline help for "protx update_registrar"

Initial ProRegTx does not define a field named "collateralAddress". It is not necessary to use the collateral address to receive payout, any Dash address can be defined here.

* Fix incorrect syntax for "protx revoke" inline help

"operatorKey" is required here
2018-11-21 07:57:47 +01:00
Alexander Block
614ff70b4c
Let ccache compress the cache by itself instead of compressing ccache.tar (#2456)
The cache can become quite large and uncompressing/recompressing it is slow.
Better to let ccache handle compression as it will then only perform it
on files which are actually used.
2018-11-19 07:31:13 +01:00
Alexander Block
40fa1bb492
Add platform dependent include_directories in CMakeLists.txt (#2455)
This gives much better auto-completion and code analysis in CLion.

Also add src/qt/forms to include path.
2018-11-19 07:30:58 +01:00