Commit Graph

114 Commits

Author SHA1 Message Date
PastaPastaPasta
35f079cbf1 Remove unused code (#3097)
* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code, maybe need to revert / change the surrounding values

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* remove unused code

Signed-off-by: Pasta <pasta@dashboost.org>

* Revert "remove unused code"

This reverts commit 8ea0bbbc7b.
2019-09-22 23:45:22 +03:00
PastaPastaPasta
1acde17e8a Don't care about governance cache while the blockchain isn't synced yet (#3089)
`2019-09-14 05:31:13 CGovernanceManager::UpdateCachesAndClean -- Governance Objects: 0 (Proposals: 0, Triggers: 0, Other: 0; Erased: 0), Votes: 0
 59m
 60m
`

Signed-off-by: Pasta <pasta@dashboost.org>
2019-09-17 15:09:04 +03:00
UdjinM6
1905422561
Rework govobject/trigger cleanup a bit (#3070)
* No friends for `CGovernanceObject`

* Simplify CGovernanceTriggerManager::CleanAndRemove() logic and make sure CSuperblock::IsExpired() does not modify the state
2019-08-23 21:03:05 +03:00
Pasta
1a0d52814e
#10483 scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL
-BEGIN VERIFY SCRIPT-
sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h
sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp
sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp
sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp
sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp
sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp
-END VERIFY SCRIPT-

Signed-off-by: Pasta <pasta@dashboost.org>
2019-08-12 09:07:03 -05:00
Alexander Block
7a440d626b 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-07-09 08:59:57 +03:00
Alexander Block
85fcf32c97 Remove support for InstantSend locked gobject collaterals (#3019) 2019-07-08 18:17:30 +03:00
Wladimir J. van der Laan
2edd094a21
Merge #10189: devtools/net: add a verifier for scriptable changes. Use it to make CNode::id private.
0f3471f net: make CNode's id private (Cory Fields)
9ff0a51 scripted-diff: net: Use accessor rather than node's id directly (Cory Fields)
e50c33e devtools: add script to verify scriptable changes (Cory Fields)

skipped travis changes

Tree-SHA512: a0ff50f4e1d38a2b63109b4996546c91b3e02e00d92c0bf04f48792948f78b1f6d9227a15d25c823fd4723a0277fc6a32c2c1287c7abbb7e50fd82ffb0f8d994

pnode->id to pnode->GetId()

Signed-off-by: Pasta <pasta@dashboost.org>
2019-06-19 08:20:15 -05:00
UdjinM6
4739daddc8
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-13 12:03:20 +03:00
Alexander Block
864856688d 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-13 12:01:26 +03:00
PastaPastaPasta
d931cb723e Update copyright date (2019) (#2970)
Signed-off-by: Pasta <Pasta@dash.org>
2019-06-11 14:46:07 +03:00
UdjinM6
d28d318aad
Remove logic for handling objects and votes orphaned by not-yet-known MNs (#2954)
This should no longer happen now that we use deterministic masternode list.
2019-05-29 21:19:53 +03:00
Alexander Block
b74cd3e101
Only require valid collaterals for votes and triggers (#2947)
* Only require valid collaterals for votes and triggers

* Bump proto version

* Only announce votes from banned MNs to >= 70215 proto version nodes
2019-05-29 10:56:51 +02:00
PastaPastaPasta
29194b1f5a Backport Bitcoin#9424, Bitcoin#10123 and Bitcoin#10153 (#2918)
* Contains dashification. disables `-debug dash`
Merge #9424: Change LogAcceptCategory to use uint32_t rather than sets of strings.

6b3bb3d Change LogAcceptCategory to use uint32_t rather than sets of strings. (Gregory Maxwell)

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

31 -> 32

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

* Merge #10123: Allow debug logs to be excluded from specified component

3bde556 Add -debugexclude option to switch off logging for specified components (John Newbery)

Tree-SHA512: 30202e3f2085fc2fc5dd4bedb92988f4cb162c612a42cf8f6395a7da326f34975ddc347f82bc4ddca6c84c438dc0cc6e87869f90c7ff88105dbeaa52a947fa43

* bump to uint64_t due to added Dash codes

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

* bump to uint64_t due to added Dash codes cont.

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

* string -> BCLog format

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

* uint32_t -> uint64_t

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

* Fix CBatchedLogger

* Fix most fDebug-s

* Fix `debug` rpc

* Fix BENCH and RAND conflicts

* Add ALERT and use it

* Update LogPrint-s in dash-specific code

* Tweak few log categories

Specifically:
- use PRIVATESEND in `CPrivateSendClientManager::GetRandomNotUsedMasternode()`
- use ZMQ in `CZMQPublishRawGovernanceVoteNotifier::NotifyGovernanceVote()` and `CZMQPublishRawGovernanceObjectNotifier::NotifyGovernanceObject()`

* Drop no longer used MASTERNODE category

* Merge #10153: logging: Fix off-by-one for shrinkdebugfile default

faab624 logging: Fix off-by-one for shrinkdebugfile (MarcoFalke)

Tree-SHA512: d6153e06067906172ff0611af9e585a3ecf0a7d56925b6ad7c12e75aa802441047059b9b6f6c78e79916c3f2abc8f1998bfd2d5b84201ec6421f727c08da3c21

* Shift dash-specific log categories to start from `1ul << 32` to avoid potential future conflicts with bitcoin ones

* Fix `dash` category

* remove debugCategories

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

* Prepend "std::" to find call

* Check for BCLog::PRIVATESEND instead of logCategories != BCLog::NONE

* Use BCLog::MNPAYMENTS category instead of checking for logCategories != BCLog::NONE

* Move "End Dash" comment below "ALERT"

When adding new entries here, we'll otherwise get confused with ordering
and might end up forgetting that adding something Dash specific must
continue with the bit after 43.
2019-05-23 00:51:39 +03:00
PastaPastaPasta
32aa229c7f Reorganize Dash Specific code into folders (#2753)
* rename instantx.* file to instantsend.*

* Reorganize Dash Specific code into folders

add to privatesend folder the header files

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

add "masternode" to imports

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

add "masternode" to imports

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

add "masternode" to imports pt 2

Signed-off-by: Pasta <Pasta@dash.org>
2019-05-21 15:26:15 +02:00