Commit Graph

15311 Commits

Author SHA1 Message Date
Alexander Block
733cd95123
Remove global fDIP0003ActiveAtTip and fix wrong use of VersionBitsState in auto IX (#2380)
* Remove global fDIP0003ActiveAtTip flag and always use VersionBitsState

fDIP0003ActiveAtTip was used much more often when introduced but turned out
to be not very useful in most places. Always use VersionBitsState now.

* Fix wrong use of VersionBitsState auto IX

* Make sure isAutoLockBip9Active flag is reset in case of chain reorgs
2018-10-26 07:03:33 +02:00
Alexander Block
25b6dae9ea
Code style and RPC help string cleanups for DIP2/DIP3 (#2379)
* Fix code style in DIP2/DIP3 code (single statement ifs with curly braces)

* Fix DIP3 RPC help strings

* Handle review comments

* Handle more review comments
2018-10-26 07:03:14 +02:00
PastaPastaPasta
6433a944a0 [Trivial] typo Groupped -> Grouped (#2374) 2018-10-25 17:32:08 +03:00
PastaPastaPasta
59932401bb Change internal references of Darksend to PrivateSend (#2372)
* Change all references to darksend to privatesend

* comment references to darksend
2018-10-25 17:31:32 +03:00
Alexander Block
e3df910822 Allow referencing other TX outputs for ProRegTx collateral (#2366)
* Pass CCoinsView reference to special TX handling methods

* Allow referencing other TX outputs for ProRegTx collateral

* Remove "collateralAmount" from "protx register"

* Rename "protx register" to "protx fund_register"

* Remove UpdateSpork15Value from CDeterministicMNManager

Was not used/implemented anymore

* Lock masternode collaterals after chain/DIP3 is fully initialized

Otherwise detection of collaterals does not work.

* Implement new "protx register" RPC which uses existing collaterals

* Remove "masternode info" RPC

It is not consistent with other "masternode" RPCs anymore as it requires
the ProRegTx hash while all other RPCs work with the collateral.

* Load sporks from disk cache before initializing the chain

Otherwise spork15 is not loaded when we check it for the first time.

* Implement "protx info" RPC

* Use "protx info" instead of "masternode info" in DIP3 tests

* Test external collaterals for ProTx

* Handle review comments

* Don't pass CCoinView reference when it's not used

* Revert "Pass CCoinsView reference to special TX handling methods"

This reverts commit 28688724e1.

* Use GetUTXOCoin instead of now removed coinsView

Also remove collateral height check as GetUTXOCoin only returns confirmed
coins.

* Add conflict handling for external collaterals to mempool

* Handle review comments (squashed Github suggestions)

Co-Authored-By: codablock <ablock84@gmail.com>
2018-10-25 17:29:50 +03:00
thephez
0ad2906c54 Clarify addlocked description in getbalance RPC (#2364)
* Trivial - Typo in getbalance RPC

* Clarify addlocked description in getbalance RPC

Co-Authored-By: thephez <thephez@gmail.com>
2018-10-25 17:29:00 +03:00
Alexander Block
e3046adb3e
Clear devNetParams and mimic behavior of other param types (#2367)
* Clear devNetParams and mimic behavior of other param types

Mainnet, testnet and regtest params are global and thus zero initialized,
we should mimic the same for devnet params.

Not doing so results in all kinds of issues on devnet.

* Remove unnecessary <string.h> includein chainparamsbase.cpp
2018-10-25 09:17:37 +02:00
thephez
fdfb077428 Update ProRegTx serialization order (#2378)
Makes consistent with both DIP-3 and the order above
2018-10-25 09:17:02 +02:00
Alexander Block
1c25356ff8
Allow to use low difficulty and higher block rewards for devnet (#2369)
* Allow to use low difficulty and higher block rewards for devnet

Configurable through -minimumdifficultyblocks, -highsubsidyblocks and -highsubsidyfactor

* Fix review comments

* Handle review comments
2018-10-25 09:16:38 +02:00
Alexander Block
de426e962a
Give tail calls enough time to print errors (#2376) 2018-10-25 09:16:13 +02:00
Alexander Block
0402240a2e
Bump CMAKE_CXX_STANDARD to 14 in CMakeLists.txt (#2377)
We still don't really use this file (it won't even work), but it's good
to have CLion not brable about unknown stuff all the time.
2018-10-25 09:15:49 +02:00
Alexander Block
53e12b7b40
Don't bail out from ProcessMasternodeConnections in regtest (#2368)
We actually do masternode testing now and we will rely on this behavior
2018-10-24 13:31:45 +02:00
Alexander Block
3c9237aa40
Use VersionBitsState instead of VersionBitsTipState to avoid cs_main lock (#2370)
It wasn't even locked, which causes AssertLockHeld to fail.
2018-10-24 13:31:22 +02:00
PastaPastaPasta
c4351fd328 revert 737, DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN (#2362) 2018-10-23 14:16:17 +03:00
Alexander Block
eaa856eb78 Remove nProtocolVersion and add mode/type fields to DIP3 (#2358)
* Remove nProtocolVersion fields from deterministic masternode lists

This field was part of my initial implementation from DIP3. One of the last
changes of DIP3 was then to remove this field, which I did not bring back
into code yet. This commit removes it now.

We use PROTOCOL_VERSION now in cases were compatibility in the the pre-DIP3
list is needed.

* Add type and mode fields in DIP3 special TXs

These were added to DIP3 but not in-code yet.

* Add DMN_PROTO_VERSION
2018-10-23 14:15:38 +03:00
gladcow
1c9ed7806a GDB automation with Python script to measure memory usage in dashd (#1609)
* standart STL containers and Masternode-related classes processing

* masternode-related classes

* fix st containers processing,  use reflection to process simple classes

* Content descrioption in README.md

* Increase python scripts performance

Use gdb objects instead strings and type info for creating Pyton wrappers

* fixed simple classes list

* addition to README

* fix nits

* missed `the`

Co-Authored-By: gladcow <sergey@dash.org>

* fix nits

Co-Authored-By: gladcow <sergey@dash.org>

* fixed grammatical issues

Co-Authored-By: gladcow <sergey@dash.org>

* fixed phrase construction

Co-Authored-By: gladcow <sergey@dash.org>

* missed point

Co-Authored-By: gladcow <sergey@dash.org>

* fixed grammatical issues

Co-Authored-By: gladcow <sergey@dash.org>

* remove double space

Co-Authored-By: gladcow <sergey@dash.org>

* fixed grammatical issues

Co-Authored-By: gladcow <sergey@dash.org>
2018-10-23 14:15:08 +03:00
Alexander Block
d998dc13ed
Add cmake to non-mac gitian descriptors (#2360)
Needed since we added Chia bls-signatures
2018-10-23 10:23:14 +02:00
Nathan Marley
266dd32323 mkdir -p to allow re-start of failed chia build (#2359)
Adds -p option so that `mkdir` does not error if build dir already exists.

Before this change, if chia_bls build failed for some previous reason (e.g. b/c cmake was not installed), the chia_bls build would always fail in the future because the `build` directory already exists. Previous error message:

```
$ make -j4
Configuring chia_bls...
mkdir: cannot create directory ‘build’: File exists
make: *** [/Users/nmarley/projects/dash/depends/work/build/x86_64-apple-darwin18.0.0/chia_bls/b24c15cef6567a855e901b4774d1d22efb063ea9-e5023308c2a/./.stamp_configured] Error 1
```
2018-10-21 22:46:10 +03:00
Alexander Block
c9d2745188 Use BLS keys for the DIP3 operator key (#2352)
* Use BLS keys for operator keys

* Add "bls generate" RPC to generate BLS keys

* Use unique_ptr to store blsKeyOperator and blsPubKeyOperator

Needed because the Chia BLS library crashes when keys are created before
the library is initialized, even if keys are not used. This is the case here
as we have static instances here.

* Remove unnecessary CheckSignature calls

This seems to be some garbage I left in by mistake.

* Fixed review comments

* Fix rpc help for operator keys

All keys that are used as examples are random. None of the secret keys
belongs to any of the public keys.

* Use .GetHash() instead of ::SerializeHash() for BLS pubkeys in txmempool.cpp

* Rename mapProTxBlsPubKeys to mapProTxBlsPubKeyHashes
2018-10-21 22:45:16 +03:00
-k
3313bbd515 Backport bitcoin #13623 Migrate gitian-build.sh to python (#2319)
* backport python version of gitian-build from bitcoin

rename gitian-build script

fix release notes typo

0.12.3-backports

* change gitian host IP address

* docker/etc fixes

* use docker as default virtualization tech

* add checksum to depends download stage

* add SDK download

checksum added

* remove SDK check

* fix verification
2018-10-21 22:39:05 +03:00
Alexander Block
7b76bbb575 Update Chia BLS libs to latest master (#2357)
* Undefine ERROR before including chia BLS stuff to avoid warnings

* Update Chia BLS libs to latest master
2018-10-20 17:08:54 +03:00
Alexander Block
e2de632f8c Move handling of size != SerSize into SetBuf/GetBuf (#2356)
* Move handling of size >= SerSize into SetBuf/GetBuf

Instead of performing this in the individual implementations of
InternalSetBuf and InternalGetBuf

* Assert that size if GetBuf is always SerSize
2018-10-20 17:08:40 +03:00
UdjinM6
a450553847
Fix qt configure to detect clang version correctly (#2344)
> /usr/bin/xcrun -sdk macosx clang -v
Apple LLVM version 10.0.0 (clang-1000.11.45.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Before:
> XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`; echo "$XCRUN" | sed -n 's/.*version \([0-9]\).*/\1/p'
1

After:
> XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`; echo "$XCRUN" | sed -n 's/.*version \([0-9]*\).*/\1/p'
10
2018-10-20 17:08:23 +03:00
gladcow
11a0cbf84d InstantSend-related tests refactoring (#2333)
* create base class for dash-specific tests

* use common base class in p2p-autoinstantsend.py

* use common base class in p2p-instantsend.py

* rename check_IX_lock to wait_for_instantlock
2018-10-20 17:08:02 +03:00
gladcow
81d60bc283 Fix the issue with transaction amount precision in IS tests (#2353)
* fix issue with trx amounts precision in autoix-mempool.py

* fix issue with trx amounts precision in p2p-autoinstantsend.py

* fix issue with trx amounts precision in p2p-instantsend.py

* Rallback adding empty line

* Rallback adding empty line
2018-10-18 16:24:30 +03:00
UdjinM6
90ad75911a
Fix auto-IS and tests (#2331)
* fix CTxLockRequest::GetMinFee()

* Force regular IS txes to include MIN_FEE * n_inputs fee on creation regardless of auto-IS status

* set_autoix_spork_state should bump mocked time

* make sure IS fee matches the expected one

* turn off spork16 and test all types of txes again
2018-10-15 14:59:57 +03:00
UdjinM6
f7b0b57596
Pick rounds with the most inputs available to mix first (#2278)
* Alternative solution: pick rounds with the most inputs available to mix first

* randomly skip some inputs when we have at least one of this denom already

* More randomization in PrepareDenominate

* fix `vecSteps[nBit] >= 1 ?` and adjust speed/privacy ratio for more speed i.e. `GetRandInt(5) == 0`

* fix typos

* no comments
2018-10-15 14:58:47 +03:00
InhumanPerfection
b99d94a0f4 Minor build documentation updates (#2343)
* update fedora required packages

* fix ccache path

* fix formatting

* glibc back compat
2018-10-15 14:53:38 +03:00
UdjinM6
6867827a53
Merge pull request #2296 from codablock/pr_blsstuff
Add BLS libraries, wrappers, helpers and benchmarks
2018-10-15 14:53:16 +03:00
Alexander Block
4641916984 Review fixes 2018-10-12 20:53:57 +02:00
Alexander Block
9c8e4ac76b Move bls stuff from crypto/ to bls/ 2018-10-12 19:39:26 +02:00
Spencer Lievens
43e757bee5 Amend SERIALIZATION_VERSION_STRING string for spork cache (#2339) 2018-10-11 17:34:52 +03:00
Spencer Lievens
bed1ded8be Remove duplicated check (#2336) 2018-10-11 17:34:03 +03:00
Nathan Marley
89f744d064 pack of small cleanup fixes / optimizations (#2334)
* remove vector, extra loop in cleanup function

This commit removes 2 loops and a vector which I don't believe are necessary in
CMasternode::FlagGovernanceItemsAsDirty. I could be missing something, but
can't think of any good reason why this was implemented this way.

* use range operator to range over vectors

* remove deprecated wire message types

* mn: simplify govobj map mgmt a bit

* remove extra semicolons

* invert if/else condition and drop else

* remove if/else logic from Qt

This is the entire purpose of the Get<X>String methods on MNP class.

* Revert "remove deprecated wire message types"

This reverts commit 9de88a3fda.

* Revert "remove if/else logic from Qt"

This reverts commit c0f43c9b85.
2018-10-11 17:33:48 +03:00
gladcow
9603c52900 Trivial: Codestyle fixes in InstantSend code (#2332) 2018-10-11 17:33:22 +03:00
UdjinM6
727e940c0c
Fix recently introduced PS bugs (#2330)
* backward compatibility fix for dsq

* fix StartNewQueue
2018-10-11 17:32:51 +03:00
PastaPastaPasta
8deb8e90f2 Modernize Gov Methods (#2326)
* governance.* formatting and copyright bump

* manual changes gov.cpp

* Modernize ConvertVoteOutcome, ConvertSignalToString and  ConvertOutcomeToString

* move breaks

* add braces instead of inlining

* Revert "Modernize ConvertVoteOutcome, ConvertSignalToString and  ConvertOutcomeToString"

This reverts commit 41bc3d3d86.

* Modernize ConvertVoteOutcome, ConvertSignalToString and  ConvertOutcomeToString

* fix bugs

* make "NONE" lowercase

* revert merge error

* @InhumanPerfection comments fix

* whoops
2018-10-11 17:32:31 +03:00
UdjinM6
b3fc236af5
Fix mnodeman.cs vs cs_vPendingMasternodes vs cs_main deadlock (#2200)
Decouple cs_vPendingMasternodes from mnodeman.cs to fix the issue. Also drop deprecated/unused stuff in mnv preparation while at it.
2018-10-11 17:32:05 +03:00
Alexander Block
80fd096b07 Add ECDSA benchmarks 2018-10-10 08:49:10 +02:00
Alexander Block
78675d9bb0 Add BLS and DKG benchmarks 2018-10-10 08:49:10 +02:00
Alexander Block
3ee27c1681 Add highly parallelized worker/helper for BLS/DKG calculations 2018-10-10 08:49:10 +02:00
Alexander Block
aa3b0aa8a4 Add simple helpers/wrappers for BLS+AES based integrated encryption schemes (IES) 2018-10-10 08:49:10 +02:00
Alexander Block
9ccf6f584d Implement wrappers around Chia BLS lib
# Conflicts:
#	configure.ac
2018-10-10 08:49:09 +02:00
Alexander Block
3039d44d39 Add Chia bls-signatures library to depends 2018-10-07 19:36:03 +02:00
Alexander Block
f3dcb6916c Add cmake to ci/Dockerfile.builder 2018-10-04 16:46:48 +02:00
Alexander Block
057d7445eb Add libgmp to depends 2018-10-04 16:46:48 +02:00
Alexander Block
b0d0093d73 Add helper to rename all threads of a ctpl::thread_pool 2018-10-04 16:46:48 +02:00
Alexander Block
47a1622552 Add ctpl header only library
A simple C++ thread pool library

https://github.com/vit-vit/CTPL
Commit: 437e135dbd94eb65b45533d9ce8ee28b5bd37b6d
2018-10-04 16:46:48 +02:00
Alexander Block
eaef902025 Don't use boost range adaptors in CDeterministicMNList (#2327)
These cause crashes when used in for loops. Reason is very likely that
temporary CDeterministicMNList objects are destroyed before entering the
loop while the adaptors rely on these objects.

Discovered in one of our devnets while calling "protx list"
2018-10-02 12:03:05 +03:00
Nathan Marley
07208a4ae2 document spork system with doxygen comments (#2301)
This is an initial shot at an on-going WIP, which will add documentation via
Doxygen comments to (especially) Dash-specific features in the codebase.
2018-10-02 12:02:27 +03:00