Commit Graph

15955 Commits

Author SHA1 Message Date
Alexander Block
2e0cf8a30b Add "instantsendlocks" to getmempoolinfo RPC (#3047) 2019-08-07 17:54:27 +02:00
Alexander Block
a8fb8252e9 Use fEnablePrivateSend instead of fPrivateSendRunning
Required due missing refactorings.
2019-08-07 16:07:22 +02:00
Alexander Block
a198a04e04 Show number of InstantSend locks in Debug Console (#2919)
* Implement GetInstantSendLockCount in CInstantSendManager

* Add islockCountChanged signal to client model

* Show number of InstantSend locks in debug console
2019-08-07 14:15:08 +02:00
Alexander Block
013169d63d Optimize on-disk deterministic masternode storage to reduce size of evodb (#3017)
* Implement CompactFull() in CDBWrapper

This allows to compact the whole DB in one go.

* Implement more compact version of CDeterministicMNListDiff

This introduces CDeterministicMNStateDiff which requires to only store
fields on-disk which actually changed.

* Avoid writing mnUniquePropertyMap to disk when storing snapshots

This map can be rebuilt by simply using AddMN for each deserialized MN.

* Implement Serialize/Unserialize in CScript

This allows us to directly use READWRITE() on scripts and removes the need
for the ugly cast to CScriptBase. This commit also changes all Dash specific
uses of CScript to not use the cast.

* Keep track of registeration counts and introduce internalID for masternodes

The "internalId" is simply the number of MNs registered so far when the
new MN is added. It is deterministic and stays the same forever.

* Use internalId as keys in MN list diffs

This reduces the used size on-disk.

* Two simple speedups in MN list diff handling

1. Avoid full compare if dmn or state pointers match in BuildDiff
2. Use std::move when adding diff to listDiff in GetListForBlock

* Implement upgrade code for old CDeterministicMNListDiff format to new format

* Track tipIndex instead of tipHeight/tipBlockHash

* Store and pass around CBlockIndex* instead of block hash and height

This allows us to switch CDeterministicMNManager::GetListForBlock to work
with CBlockIndex.

* Refactor CDeterministicMNManager::GetListForBlock to require CBlockIndex*

Instead of requiring a block hash. This allows us to remove blockHash and
prevBlockHash from CDeterministicMNListDiff without the use of cs_main
locks in GetListForBlock.

* Remove prevBlockHash, blockHash and nHeight from CDeterministicMNListDiff

* Remove access to determinisitcMNManager in CMasternodeMetaMan::ToString()

The deterministic MN manager is not fully initialized yet at the time this
is called, which results in an empty list being returned everytime.

* Better logic to determine if an upgrade is needed

Reuse the "best block" logic to figure out if an upgrade is needed. Also
use it to ensure that older nodes are unable to start after the upgrade
was performed.

* Return null block hash if it was requested with getmnlistdiff

* bump CGovernanceManager::SERIALIZATION_VERSION_STRING

* Check SERIALIZATION_VERSION_STRING before deserializing anything else

* Invoke Clear() before deserializing just to be sure
2019-08-07 12:19:49 +02:00
Alexander Block
9ac7a998be Add "isValidMember" and "memberIndex" to "quorum memberof" and allow to specify quorum scan count (#3009)
* Add "isValidMember" and "memberIndex" to output of "quorum memberof"

* Allow to specify how many quorums to scan for in "quorum memberof"
2019-08-07 12:19:49 +02:00
Alexander Block
99824a8792 Implement "quorum memberof" (#3004)
* Implement BuildQuorumInfo and call it from quorum_info

* Add type to result of BuildQuorumInfo

* Implement "quorum memberof"
2019-08-07 12:19:49 +02:00
UdjinM6
7ea319fd25 Bail out properly on Evo DB consistency check failures in ConnectBlock/DisconnectBlock (#3044) 2019-08-07 12:19:49 +02:00
UdjinM6
b1ffedb2dd Do not count 0-fee txes for fee estimation (#3037) 2019-08-07 12:19:49 +02:00
strophy
974055a9b6 Fix broken link in PrivateSend info dialog (#3031) 2019-08-07 12:19:49 +02:00
UdjinM6
781b165796 Merge pull request #3028 from PastaPastaPasta/backport-12588
Backport a couple of ZMQ fixes
2019-08-07 12:19:49 +02:00
Nathan Marley
5af6ce91d6 Add Dash Core Group codesign certificate (#3027) 2019-08-07 12:19:49 +02:00
Nathan Marley
873ab896ca Fix osslsigncode compile issue in gitian-build (#3026) 2019-08-07 12:19:49 +02:00
UdjinM6
ea8569e97b Backport #12783: macOS: disable AppNap during sync (and mixing) (#3024)
* Merge #12783: macOS: disable AppNap during sync

1e0f3c44992fb82e6bf36c2ef9277b0759c17c4c macOS: disable AppNap during sync (Alexey Ivanov)

Pull request description:

  Code based on pull/5804. Tested only on macOS 10.13.3 and should support 10.9+.

  What macOS versions bitcoin core currently supports?

Tree-SHA512: 85809b8d8d8a05169437b4268988da0b7372c29c6da3223ebdc106dc16dcb6d3caa5c52ace3591467005b50a63fd8b2ab1cb071cb4f450032932df25d5063315

* Refactor

* Drop `#include <memory>` from `src/qt/bitcoingui.h`

Was included by mistake.
2019-08-07 12:19:49 +02:00
Alexander Block
4286dde498 Remove support for InstantSend locked gobject collaterals (#3019) 2019-08-07 11:52:09 +02:00
Alexander Block
28a219ff0a
[v0.14.0.x] Update release notes for 0.14.0.2 (#3012)
* Update release notes for 0.14.0.2

* Review suggestions

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

* Add commits to release-notes.md
2019-07-03 15:56:09 +02:00
UdjinM6
f7c97186d0
Merge pull request #3011 from codablock/pr_v14_backports
[v0.14.0.x] Backport pending PRs
2019-07-03 14:11:17 +03:00
Alexander Block
d2ff63e8d3 Use std::unique_ptr for mnList in CSimplifiedMNList (#3014)
This allows much faster sorting as it avoids copying/swapping
expensive objects.
2019-07-03 08:49:42 +02:00
Alexander Block
321bbf5af4 Fix excessive memory use when flushing chainstate and EvoDB (#3008)
* Specialize Serialize(CSizeComputer&) for BLS objects

Speeds up size computation for BLS objects.

* Track memory usage in CDBTransaction and CEvoDB

* Take memory used by CEvoDB/CDBTransaction into account when flushing

* Implement specialized SerReadWrite for immer maps

This allows to use READWRITE and fixes compilation errors with CSizeComputer

* Log EvoDB memory usage independently

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
2019-07-02 16:25:28 +02:00
Alexander Block
0410259dd5 Fix 2 common Travis failures which happen when Travis has network issues (#3003)
* Retry downloading of depends sources 3 times

* Manually invoke apt-get update and install instead of using addon

This allows us to use travis_retry on these operations.

* Add exception for depends/Makefile in .gitignore

* Remove --retry from curl call

This avoids future confusion as we don't rely on curl anymore to properly
retry downloads. curls does only retry on transient errors, while Travis
might cause all kinds of errors which circumvent the retry logic of curl.
2019-07-02 06:41:10 +02:00
Alexander Block
8d763c1440 Only load signingActiveQuorumCount + 1 quorums into cache (#3002)
No need to load 25 quorums when we're scanning for the larger quorums which
only have 4 active quorums. This avoids loading thousands of masternode
lists unnecessarily.
2019-07-02 06:40:47 +02:00
UdjinM6
2dc1b06ec7 Remove skipped denom from the list on tx commit (#2997)
* Remove skipped denom from the list on tx commit

Regardless of the tx type (PS or not).

* Update src/privatesend/privatesend-client.cpp

Co-Authored-By: Alexander Block <ablock84@gmail.com>
2019-07-02 06:40:28 +02:00
Alexander Block
dff2c851d5
Update manpages for 0.14.0.2 (#2999) 2019-06-26 06:03:05 +02:00
Alexander Block
d7d005270d
Merge pull request #2989 from codablock/pr_v14_backports
[v0.14.0.x] Backport pending PRs
2019-06-24 12:51:03 +02:00
Alexander Block
fb6f0e04df
Bump version to 0.14.0.2 and copy release notes (#2991) 2019-06-24 12:50:35 +02:00
UdjinM6
46c4f58441 Use Travis stages instead of custom timeouts (#2948) 2019-06-21 12:01:36 +02:00
Alexander Block
49c37b82ae Back off for 1m when connecting to quorum masternodes (#2975)
* Implement GetAddressInfo in CAddrMan

* Back off for 1m when connecting to quorum masternodes
2019-06-21 11:24:14 +02:00
Alexander Block
c1f756fd90 Multiple speed optimizations for deterministic MN list handling (#2972)
* Generalize CBLSLazyWrapper so that it can be used of pubkeys and secret keys

* Implement == and != operators for CBLSLazyWrapper

* Implement cached hash for CBLSLazyWrapper

* Use CBLSLazyPublicKey for CDeterministicMNState::pubKeyOperator

* Speed up GetProjectedMNPayees by sorting the MN list by last paid

Instead of updating a temporary list for each projected height and calling
GetMNPayee() on it.

* Cache intermediate lists in GetListForBlock

This avoids re-loading and applying diffs again and again.

* Only update masternode list UI max once every 3 seconds

This avoids updating the UI on every block, which turned out to be very
expensive.

* Fix compilation

* Drop time restrictions for mn list update in ClientModel

They are fully handled by MasternodeList now.
2019-06-21 09:47:13 +02:00
UdjinM6
11699f540f Process/keep messages/connections from PoSe-banned MNs (#2967)
* Process/keep/count votes from PoSe-banned MNs

* Process dstx from PoSe-banned MNs

* Recognize PoSe-banned MNs as MNs
2019-06-21 09:46:24 +02:00
UdjinM6
c5415e746a Fix UI masternode list (#2966)
NotifyMasternodeListChanged is called before the tip is updated which means we can't rely on GetListAtChainTip() and have to pass the list into CClientUIInterface
2019-06-21 09:45:50 +02:00
Alexander Block
05adda99fe Update release notes with latest commits (#2958) 2019-05-30 13:15:37 +03:00
Alexander Block
a2baa93ec5 Only require valid collaterals for votes and triggers (#2947) (#2957)
* Only require valid collaterals for votes and triggers

* Bump proto version

* Only announce votes from banned MNs to >= 70215 proto version nodes
2019-05-30 11:00:49 +03:00
Alexander Block
b293e6ddee [v0.14.0.x] Fix off-by-one error in InstantSend mining info removal when disconnecting blocks (#2951)
* Refactor checks for disconnected blocks and conflicts in CInstantSendManager::SyncTransaction

* Fix off-by-one when calling RemoveInstantSendLockMined
2019-05-29 18:34:26 +03:00
Alexander Block
276b6e3a82 [v0.14.0.x] bump version to 0.14.0.1 and prepare release notes (#2952)
* Bump version to 0.14.0.1

* Run gen-manpages.sh to update versions

* Prepare 0.14.0.1 release notes

Changelog is still missing and will be added later
2019-05-29 18:34:13 +03:00
UdjinM6
8c743968bd
Update release notes v14 (#2927) 2019-05-17 20:03:37 +03:00
UdjinM6
612a90e8c3
Set CLIENT_VERSION_IS_RELEASE to true (#2926) 2019-05-17 12:16:31 +03:00
UdjinM6
9482f77e57
Update help text via gen-manpages.sh (#2929) 2019-05-17 12:16:02 +03:00
UdjinM6
211a39d19b 0.14 release notes draft (#2896)
* move 0.13.3 releas notes

* 0.14 release notes draft

* apply suggestions

* Apply suggestions

* update with latest commits

* Add recent commits

* Add LLMQ-IS description
2019-05-16 10:13:47 +02:00
UdjinM6
84162021a3 Fix duplicate -instantsendnotify invocation (#2925) 2019-05-16 10:13:02 +02:00
Alexander Block
38aab0c5e3
Add blocks conflicting with ChainLocks to block index (#2923)
* Print hash of block which conflicts with a ChainLock

* Allow specifying custom block status in `AddToBlockIndex`

* Add blocks (headers) to block index even if they conflict with chainlocks
2019-05-16 10:12:36 +02:00
Alexander Block
394bec4838 Skip processing in SyncTransaction when chain is not synced yet (#2920)
Applies to CInstantSendManager and CChainLocksHandler. This fixes extremely
high RAM usage on reindex and resync, which happens to many/all transactions
being kept track of non-locked TXs (nonLockedTxs) and TXs per
block (blockTxs).
2019-05-13 13:35:46 +03:00
UdjinM6
c8a80b2792
Set DIP0008 mainnet activation params (#2915) 2019-05-13 13:35:03 +03:00
PastaPastaPasta
040abafe3a [0.14] Bump chainparams (#2910)
* Bump nMinimumChainWork and defaultAssumeValid for mainnet

Signed-off-by: Pasta <Pasta@dash.org>

add back 0x

Signed-off-by: Pasta <Pasta@dash.org>

* Bump nMinimumChainWork and defaultAssumeValid for testnet

Signed-off-by: Pasta <Pasta@dash.org>

add back 0x 2nd time

Signed-off-by: Pasta <Pasta@dash.org>

* Add a checkpoint for 0.14

Signed-off-by: Pasta <Pasta@dash.org>

* add testnet checkpoint 0.14

Signed-off-by: Pasta <Pasta@dash.org>

* update mainnet ChainTxData

Signed-off-by: Pasta <Pasta@dash.org>

formatting fix mainnet chaintxdata

Signed-off-by: Pasta <Pasta@dash.org>

update mainnet ChainTxData to specific block

Signed-off-by: Pasta <Pasta@dash.org>

* update testnet chainTxData

Signed-off-by: Pasta <Pasta@dash.org>

update testnet ChainTxData to specific block

Signed-off-by: Pasta <Pasta@dash.org>
2019-05-13 11:02:30 +02:00
Alexander Block
240238b190
Fix db leaks in LLMQ db (#2914)
* Store rs_t key time in big endian

Also implement ConvertInvalidTimeKeys to convert old entries. We can remove
this later when we know that most MNs have run this code on testnet.

The way we stored the time field in the past lead to CleanupOldRecoveredSigs
iterating the keys in a strange order, causing no deletion at all and the
LLMQ DB filling up.

* Write batch in CleanupOldRecoveredSigs when it gets too large

This avoids RAM filling up and OOM getting triggered.

* Keep track of when a vote was written to the DB and clean up after week

Instead of only deleting when the corresponding recovered sig is deleted.
It sometimes happens that a masternode votes on something but a recovered
sig is never created, which leaves us with a vote that will never be
deleted.

* Apply suggestions from code review

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
2019-05-13 10:41:48 +02:00
Alexander Block
56f31195d2
Fall back to ReadBlockFromDisk when blockTxs is not filled yet (#2908)
* Fall back to ReadBlockFromDisk when blockTxs is not filled yet

This handles the case where a MN is freshly started and SyncTransaction
was not been called for older transactions/blocks.

* Also update txFirstSeenTime

* Properly handle txids == nullptr
2019-05-10 15:54:40 +02:00
Alexander Block
4dc5c0e9ed
Bump "keepOldConnections" by one for all LLMQ types (#2909)
And for llmq5_60, set it to 3 instead of 24 (which was incorrect from the
beginning).

Increasing all LLMQs "keepOldConnections" by one is required because we
don't use the tip when scanning active quorums, but a block that is 8 blocks
in the past. This however means that we need to keep connections for one
additional quorum alive.

This fixes an issue with signing sessions randomly failing with timeouts.
2019-05-10 11:26:39 +02:00
Alexander Block
7696a6fc89
Print inputs on which we voted and quorums used for signing (#2907)
* Print inputs on which we voted

Also print the corresponding requestId. This makes debugging InstantSend
issues easier.

* Print quorum hash when signing a share

* Remove unused nodesByAddress map in CSigSharesManager::SendMessages

Not related to this PR, but a simple cleanup that should have no
side effects.
2019-05-10 11:24:04 +02:00
Alexander Block
a173e6836c Implement integration tests for DKG error handling (#2905)
* Allow modifying simulate DKG error rates via RPC

* Don't lie to yourself :)

* Add some missing new-lines in LogPrintf calls

* More fine grained control over which messages to expect in mine_quorum

* Implement llmq-dkgerrors.py integration tests

These test DKG errors and malicious behavior.
2019-05-08 12:13:27 +03:00
UdjinM6
89f6f75910
Implement zmq notifications for chainlocked blocks (#2899)
* Unify zmq message order

* Implement `zmqpubhashchainlock` and `zmqpubrawchainlock`
2019-05-08 12:12:54 +03:00
Alexander Block
66a2cdeafc Properly handle conflicts between ChainLocks and InstantSend (#2904)
* Move code to write archived ISLOCKs into its own method

We'll need this from another method as well later.

* Return ISLOCK instead of conflicting txid in GetConflictingTx/GetConflictingLock

* Implement GetInstantSendLocksByParent and RemoveChainedInstantSendLocks

These allow to easily delete multiple chains (actually trees) of ISLOCKs
in one go.

* Implement RemoveConflictedTx and call it from RemoveMempoolConflictsForLock

Also add "retryChildren" parameter to RemoveNonLockedTx so that we can
skip retrying of non-locked children TXs.

* Properly handle/remove conflicted TXs (between mempool and new blocks)

* Track non-locked TXs by inputs

* Implement and call ResolveBlockConflicts

* Also call ResolveBlockConflicts from ConnectBlock

But only when a block is known to have a conflict and at the same time is
ChainLocked, which causes the ISLOCK to be pruned.

* Split out RemoveChainLockConflictingLock from ResolveBlockConflicts

* Implement "quorum getrecsig" RPC

* Include decoded TX data in result of create_raw_tx

* Implement support for CLSIG in mininode.py

* Fix condition for update of nonLockedTxs.pindexMined

* Only add entries to nonLockedTxsByInputs when AddNonLockedTx is called for the first time

* Implement support for ISLOCK in mininode.py

* Implement tests for ChainLock vs InstantSend lock conflict resolution

* Handle review comment

Bail out (continue) early
2019-05-07 15:14:33 +03:00
UdjinM6
b63f7dd39a
Fix a crash in masternode winners when count is too large (#2902) 2019-05-06 17:58:59 +03:00