Commit Graph

15974 Commits

Author SHA1 Message Date
Alexander Block
9b49bfda81 Only track last seen time instead of first and last seen time (#3165)
This avoids timeouts on parts of the network
2019-11-19 12:25:23 +01:00
UdjinM6
ad720eef19 Merge #17118: build: depends macOS: point --sysroot to SDK (#3161)
a0daea459cf4812fbdda9a7ead131a73f5856c09 [build] depends macOS: point --sysroot to SDK (Sjors Provoost)

Pull request description:

  Fixes errors like `fatal error: 'unistd.h' file not found` when building depends on macOS.

  Replaces #14352 (which doesn't work on Catalina).

ACKs for top commit:
  jonasschnelli:
    utACK a0daea459cf4812fbdda9a7ead131a73f5856c09

Tree-SHA512: 995b1e1e84e635b32d1d4038bc63730c94a7c318b7240f6d62825977e5c97fe52c5aa5a0f39070beb0df8271dd294b36d6b5cf7f09ad07494fb15d5bd4d77f68
2019-11-19 12:25:23 +01:00
Alexander Block
909d6a4ba5 Simulate BlockConnected/BlockDisconnected for PS caches 2019-11-19 12:25:23 +01:00
UdjinM6
db7f471c7d Few fixes related to SelectCoinsGroupedByAddresses (#3144)
* Fix cache usage in SelectCoinsGroupedByAddresses

* Reset cache flags in SelectCoinsGroupedByAddresses when a block is (dis)connected

* MakeCollateralAmounts should call SelectCoinsGroupedByAddresses with a limited number of inputs
2019-11-19 12:25:23 +01:00
UdjinM6
1acd4742c4 Various fixes for mixing queues (#3138)
* Always check for expired queues on masternodes

* Check if a queue is too old or too far into the future

Instead of only checking that it's to old

* Check that no masternode can spam us with dsqs regardless of dsq readiness
2019-11-19 12:25:23 +01:00
Alexander Block
0031d6b04d Also consider txindex for transactions in AlreadyHave() (#3126)
This avoids many false negatives where TXs are announced to us which are
already mined and then were spent later.
2019-11-19 12:25:23 +01:00
UdjinM6
c4be5ac4df Ignore recent rejects filter for locked txes (#3124)
* Ignore recent rejects filter for locked txes

If we had a conflicting tx in the mempool before the locked tx arrived and the locked one arrived before the corresponding islock (i.e. we don't really know it's the one that should be included yet), the locked one is going to be rejected due to a mempool conflict. The old tx is going to be removed from the mempool by an incoming islock a bit later, however, we won't be able to re-request the locked tx until the tip changes because of the recentRejects filter. This patch fixes it.

* Add some explanation
2019-11-19 12:25:23 +01:00
Alexander Block
f2d401aa85 Make orphan TX map limiting dependent on total TX size instead of TX count (#3121) 2019-11-19 12:25:23 +01:00
UdjinM6
87ff566a04 Update/modernize macOS plist (#3074)
* Use 4-digit version numbers for macOS bundles

* Drop deprecated CFBundleGetInfoString and use NSHumanReadableCopyright instead
2019-11-18 15:30:15 +01:00
UdjinM6
2141d5f9d9 Fix bip69 vs change position issue (#3063)
* Fix bip69 vs change position issue

* Drop `setbip69enabled` rpc
2019-11-18 15:29:49 +01:00
UdjinM6
75fddde67f Partially revert 3061 (#3150)
Turned out that this causes SelectCoinsMinConf to (unnecessary) lean towards selecting mempool txes which can cause "too long mempool chain" error even when there are more funds to spend.
2019-11-18 15:28:34 +01:00
UdjinM6
c74f2cd8b2 Fix SelectCoinsMinConf to allow instant respends (#3061)
* Modify tests to check for instant respends

This should fail atm...

* Fix SelectCoinsMinConf to allow instant respends

Now tests should pass again.
2019-11-18 15:28:19 +01:00
Alexander Block
2e7ec23693
[0.14.0.x] Remove check for mempool size in CInstantSendManager::CheckCanLock (#3119)
* Remove check for mempool size in CInstantSendManager::CheckCanLock

This should not have been here at all and is already removed in develop.
Recent InstantSend failures on mainnet were partly related to this check.

* Skip autois tests for new IS system
2019-09-30 09:56:25 +02:00
Alexander Block
7d8eab2641
Add 0.14.0.3 change log to release-notes.md (#3055) 2019-08-14 04:51:13 +02:00
Alexander Block
f2443709b3
Update release-notes.md for 0.14.0.3 (#3054) 2019-08-13 19:33:52 +02:00
Alexander Block
8aa45cfb0d
Merge pull request #3046 from codablock/pr_v14_backports
[v0.14.0.x] Backport pending PRs
2019-08-13 19:33:21 +02:00
Alexander Block
788d42dbcf
Bump version to 0.14.0.3 and copy release notes (#3053) 2019-08-12 20:08:33 +02:00
Alexander Block
17ba23871c Re-verify invalid IS sigs when the active quorum set rotated (#3052)
* Split ProcessPendingInstantSendLocks into two methods

* Split SelectQuorumForSigning into SelectQuorumForSigning and GetActiveQuorumSet

* Implement retrying of IS lock verification when the LLMQ active set rotates
2019-08-12 09:37:22 +02:00
Alexander Block
8c49d9b545 Remove recovered sigs from the LLMQ db when corresponding IS locks get confirmed (#3048)
* Remove unused overload of RemoveInstantSendLock

* Move deletion of recovered sigs into own method

* Remove recovered sigs for fully confirmed IS locks

* Also remove rs_t entries when removing recovered sigs from the outside

CleanupOldRecoveredSigs already does this as the last step, but when
RemoveRecoveredSig is called from the outside (e.g. from InstantSend),
these keys are not removed. This PR fixes this by storing the write time
into rs_r and later uses it to remove the rs_t entry.

Old entries will be incompatible with this (1 byte written in the past,
4 bytes written now). This checked by comparing the data size with
sizeof(uint32_t).

* Add TODO
2019-08-12 09:37:14 +02:00
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