Commit Graph

15118 Commits

Author SHA1 Message Date
Alexander Block
28a6007a40 Prepare DIP3 for testnet and reuse DIP3 deployment for autoix deployment (#2389)
* Add BIP9 parameters for DIP3 deployment on testnet

* Remove autoix BIP9 deployment and reuse DIP3 deployment

* Add BIP9CheckMasternodesUpgraded to chain params

This controls if miners should check for upgraded masternodes first before
adding BIP9 bits to the block version. This only makes sense in network
where masternodes are up and running before BIP9 activation, which is not
necessarely the case in regtest and devnet.

Also refactor ComputeBlockVersion to use fCheckMasternodesUpgraded instead
of the inverse fAssumeMasternodeIsUpgraded. It is set to false by default
and only set to true in CreateNewBlock.

* Check for upgraded masternodes for DIP3 activation (only mainnet and testnet)

* Bump PROTOCOL_VERSION and DMN_PROTO_VERSION

We probably have nodes with 70211 already running on testnet.
2018-10-26 19:42:52 +03:00
Alexander Block
e66c4e184f Don't revert to INV based block announcements when the previous block is the devnet genesis block (#2388)
Assume that the other node already has the previous block if it matches
the devnet genesis block.
2018-10-26 19:42:28 +03:00
Alexander Block
b5142ee2ce Implement RemoveAskFor to indicate that we're not interested in an item anymore (#2384)
* Implement RemoveAskFor to indicate that we're not interested in an item anymore

When an INV item is received from the first node, the item is requested
immediately. If the same item is received from another node, an entry is
added to mapAskFor which marks the item for re-requesting in case the first
node did not respond. When the item is received from the first node,
the item was previously never removed from mapAskFor. Only the later getdata
loop in SendMessages would then gradually remove items from the map. This
is quite delayed however as the entries in mapAskFor have a timeout value.

RemoveAskFor allows to remove all entries from mapAskFor and setAskFor
when we are not interested in the item anymore (e.g. because we received
it already).

* Call RemoveAskFor whenever we receive a message

* Only pass hash instead of CInv object to RemoveAskFor
2018-10-26 19:42:11 +03:00
Alexander Block
8f9b004cab Support "fast" mode when calling sync_masternodes (#2383)
This will call "mnsync next" multiple times to force finishing of mnsync.
Also reduce sleep time to 200ms.
2018-10-26 19:41:40 +03:00
Alexander Block
fcea333ba8
Rewrite handling of too long depends builds in .travis.yml (#2385)
The old solution was unnecessarily complicated and resulted in failed tests
to be shown as successful (the exit code was ignored).
2018-10-26 12:15:43 +02:00
Alexander Block
d1debfc267
Implement mt_pooled_secure_allocator and use it for BLS secure allocation (#2375)
* Add pooled_secure_allocator and mt_pooled_secure_allocator

* Use mt_pooled_secure_allocator for BLS secure allocation

The old solution relied on thread-local-storage and was thus not compatible
to libc6 2.11 (which is the minimum supported version we use).

Also, the old solution turned out to be erroneous. It would have crashed
or memory leaked when ownership of CBLSPrivateKey would be handled over
to another thread.

* Add new header files to Makefile.am

* Fix copyright headers of new files

* Bail out early from secure deallocation

* Clean up global BLS keys when shutting down
2018-10-26 07:04:22 +02:00
UdjinM6
0692de1c58 Fix prepare_masternodes/create_masternodes in DashTestFramework (#2382)
Specify masternodeblsprivkey which is required in masternode mode now.
This should fix IS test failures which occur because of `Warning: You should specify a masternodeblsprivkey in the configuration. Please see documentation for help.` init error (there are other issues, so auto-IS test are still going to fail).
2018-10-26 07:03:48 +02:00
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