Commit Graph

299 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
b92d2dd66a
Merge #10545: Use list initialization (C++11) for maps/vectors instead of boost::assign::map_list_of/list_of
3fb81a8 Use list initialization (C++11) for maps/vectors instead of boost::assign::map_list_of/list_of (practicalswift)

Tree-SHA512: 63a9ac9ec5799472943dce1cd92a4b14e7f1fe12758a5fc4b1efceaf2c85a4ba71dad5ccc50813527f18b192e7714c076e2478ecd6ca0d452b24e88416f872f7
2019-07-08 10:24:30 -05:00
Wladimir J. van der Laan
42985c31bb
Merge #10463: Names: BIP9 vs versionbits
b463bc9 scripted-diff: s/BIP9DeploymentInfo/VBDeploymentInfo/ (Jorge Timón)
29c0719 Rename -bip9params to -vbparams (shaolinfry)

Tree-SHA512: a8a2bf6e24a4a7fc82f784c78c0cd92472e9ba55ce3fb22dafef3eccdcfccb2da5a6078fbeec1a8a4b6ab1f1b226976c5aba964dd5e3d029a21b109a7c044374
2019-07-08 10:23:19 -05:00
Pasta
9e2235a4bc
add initializing to regtest
Signed-off-by: Pasta <pasta@dashboost.org>
2019-07-02 10:34:23 -05:00
Alexander Block
e740604f60 No need for zero initialization of devnet params 2019-06-26 12:45:10 -05:00
Wladimir J. van der Laan
50652674b5 Merge #8855: Use a proper factory for creating chainparams
c1082a7 Chainparams: Use the factory for pow tests (Jorge Timón)
2351a06 Chainparams: Get rid of CChainParams& Params(std::string) (Jorge Timón)
f87f362 Chainparams: Use a regular factory for creating chainparams (Jorge Timón)

Tree-SHA512: 359c8a2a1bc9d02db7856d02810240ada28048ac088f878b575597a7255cdb0ffdd1a647085ee67a34c6a7e7ed9e6cfdb61240cf6e75139619b640dbb096072c
2019-06-26 12:45:10 -05:00
Wladimir J. van der Laan
a1770b0c25 Merge #7692: Remove p2p alert system
cfd519e Add release note documentation (BtcDrak)
6601ce5 protocol.h/cpp: Removes NetMsgType::ALERT (Thomas Kerin)
ad72104 Formatting (BtcDrak)
1b77471 Remove alert keys (BtcDrak)
01fdfef Remove `-alerts` option (BtcDrak)
9206634 Update alert notification and GUI (BtcDrak)
bbb9d1d Remove p2p alert handling (BtcDrak)

manual fixes

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

remove sendalert.cpp

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

CAlertNotify -> AlertNotify

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

remove alert.h

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

remove vAlertPubKey for DevNet

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

remove src/main.cpp
2019-06-21 19:33:53 -05:00
UdjinM6
89d8f7a37d
Merge pull request #2763 from PastaPastaPasta/backports-0.15-pr8
Backports 0.15 pr8
2019-05-17 12:22:18 +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
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
Wladimir J. van der Laan
eea8027380
Merge #9987: Remove unused code
8dc957a Remove unused code (practicalswift)

Tree-SHA512: c7bb286e3b92e42fec8aa1ac2491fd38be36602efca16b4bdc4e9d5ada75c11d99e7713092ec13794abd69d5ef2c732b86209a6d01710e5ebf6fc51b8a65c92a

resolve usage of `MiningRequiresPeers()`

remove `fMiningRequiresPeers`
2019-05-06 14:51:44 -05:00
UdjinM6
8ffdcbf999
A bunch of mostly trivial tweaks/fixes (#2889)
* Trivial: vout->txout

* Re-use SetHexStr in few more places

* Tweak log output

* fix v13 release notes links

* Drop no longer used stuff

* Few more trivial fixes

* Adjust few rpc help strings

* Apply review suggestions
2019-04-30 15:48:21 +03:00
UdjinM6
03021fa53c
Harden DIP3 activation (#2881)
* Harden DIP3 activation height

Also drop all related but no longer used parts.

* Pass current block index to GetCommitmentsFromBlock

* Allow to change dip3 activation height for tests

And fix them.
2019-04-25 18:39:04 +03:00
UdjinM6
992922c495 Specify DIP3 enforcement block height/hash for mainnet params 2019-04-03 12:15:41 +03:00
Alexander Block
010752d4eb Set fAllowMultiplePorts to true for testnet (#2817)
On testnet it's quite usual to have multiple MNs on the same IP. Now that
we have LLMQs and DKGs which require deterministic intra quorum connections,
we must allow them to connect to each other even if the IPs are shared very
often.
2019-03-30 17:55:34 +03:00
Alexander Block
7b76e7abb2
Implement BIP9 style deployment for DIP8/ChainLocks and fix a bug with late headers (#2793)
* Also update bestChainLockWithKnownBlock in AcceptedBlockHeader

* Implement BIP9 style DIP8 deployment

* Fix ChainLocks tests

* Apply suggestions from code review

Co-Authored-By: codablock <ablock84@gmail.com>
2019-03-22 11:51:50 +01:00
UdjinM6
43d1ddefdc Merge branch 'master' into mergemaster132develop
Resolved conflicts:
	configure.ac
	doc/Doxyfile
	doc/guide-startmany.md
	src/clientversion.h
	src/evo/deterministicmns.cpp
	src/evo/providertx.cpp
	src/qt/masternodelist.cpp
	src/qt/masternodelist.h
	src/rpc/masternode.cpp
	src/rpc/rpcevo.cpp
	src/validation.cpp
2019-03-15 15:53:58 +03:00
Alexander Block
a69a5cf4a0 Use smaller (3 out of 5) quorums for regtest/Travis (#2774)
* Require only 3 out of 5 signatures for old InstantSend in regtest mode

* Use LLMQs of size 5 with threshold of 3 for regtest

* Fix wrong check for out-of-range bits in CFixedBitSet

* Reduce number of masternodes in masternode/LLMQ tests

* Add missing \n to LogPrintf call

* Use correct indexes for isolated/receiver/sender nodes

The way it was before resulted in nodes 1-3 being unused and 6-8 being used
for these 3 special nodes even though these are masternodes.

* Avoid stopping/starting isolated node in p2p-instantsend.py

It's enough to disable networking for this node.
2019-03-15 11:48:24 +03:00
PastaPastaPasta
9dd16cdbe7 Bump minChainWork and AssumeValid to block #1033120 (#2750) 2019-03-08 10:21:33 +03:00
Alexander Block
e2f99f4ae1 Set llmqForInstantSend for mainnet and testnet 2019-03-07 21:15:09 +01:00
Alexander Block
83dbcc483f Implement CInstantSendManager and related P2P messages 2019-03-07 21:14:31 +01:00
Alexander Block
f305cf77b6 Multiple fixes and optimizations for LLMQs and ChainLocks (#2724)
* Indicate success when signing was unnecessary

* Fix typo in name of LLMQ_400_60

* Move RemoveAskFor call for CLSIGs into ProcessNewChainLock

In case we got INV items for the same CLSIG that we recreated through
HandleNewRecoveredSig, (re-)requesting of the CLSIG from other peers
becomes unnecessary.

* Move Cleanup() call in CChainLocksHandler::UpdatedBlockTip up

We bail out early in a few situations from this method, so that Cleanup()
might not be called while its at the bottom.

* Bail out from CChainLocksHandler::UpdatedBlockTip if we already got the CLSIG

* Call RemoveAskFor when QFCOMMITMENT was received

Otherwise we might end up re-requesting it for a very long time when the
commitment INV was received shortly before it got mined.

* Call RemoveSigSharesForSession when a recovered sig is received

Otherwise we end up with session data in node states lingering around until
a fake "timeout" occurs (can be seen in the logs).

* Better handling of false-positive conflicts in CSigningManager

The old code was emitting a lot of messages in logs as it treated sigs
for exactly the same session as a conflict. This commit fixes this by
looking at the signHash before logging.

Also handle a corner-case where a recovered sig might be deleted between
the HasRecoveredSigForId and GetRecoveredSigById call.

* Don't run into session timeout when sig shares come in slow

Instead of just tracking when the first share was received, we now also
track when the last (non-duplicate) share was received. Sessios will now
timeout 5 minutes after the first share arrives, or 1 minute after the last
one arrived.
2019-02-27 16:10:12 +03:00
UdjinM6
252ee89c34
Implement new algo for quorum connections (#2710)
Instead of trying to manually figure out params for different quorum/ring sizes, connect to nodes at indexes (i+2^k)%n where k: 0..floor(log2(n-1))-1, n: size of the quorum/ring
2019-02-19 13:05:39 +03:00
Alexander Block
7e4257254c
Allow to override llmqChainLocks with "-llmqchainlocks" on devnet (#2683) 2019-02-05 15:46:05 +01:00
Alexander Block
6da341379d Use smaller LLMQs for ChainLocks on testnet and devnet (#2669)
* Move llmqChainLocks initialization closer to other LLMQ related assignments

* Use smaller LLMQs for ChainLocks on testnet and devnet

We very often don't have enough MNs on testnet so we should use a smaller
quorum quorum for ChainLocks.
2019-01-30 21:52:41 +03:00
Alexander Block
f6828b19b6
Merge pull request #2643 from codablock/pr_llmq_chainlocks
Implement LLMQ based ChainLocks
2019-01-29 15:59:05 +01:00
UdjinM6
25cb14b615 Fix confusion between dip3 activation and enforcement (#2651)
* Fix confusion between dip3 activation and enforcement

* drop DIP0003ActivationHeight for now
2019-01-29 15:54:38 +01:00
PastaPastaPasta
f123248f1c update copyright (#2648)
* update copyright

* Update copyright in configure.ac and COPYING
2019-01-29 15:53:14 +01:00
Alexander Block
29532ba196 Implement and enforce ChainLocks 2019-01-28 12:24:15 +01:00
Alexander Block
7ee31cbd65 Speed up integration tests with masternodes (#2642)
* Implement copy_datadir to allow easy copying of state from one node to another

* Instead of starting with a fresh datadir for MNs, reuse a copy of the faucet

* Start masternodes in parallel instead of waiting for the previous to finish

* Allow specifying of window and threshold with -bip9params

* Implement -dip3activationheight for regtests

* Implement fast DIP3 activation in DashTestFramework

* Speed up activation of DIP3 in dip3-deterministicmns.py

* Update qa/rpc-tests/test_framework/test_framework.py

Co-Authored-By: codablock <ablock84@gmail.com>

* Always assign fast_dip3_activation
2019-01-23 19:36:51 +03:00
Alexander Block
e7981e468d Remove fLLMQAllowDummyCommitments from consensus params (#2636)
This should have been removed together with removal of the dummy DKG
2019-01-22 14:16:30 +03:00
Alexander Block
43fd1b352f Implement CSigningManager to process and propagage recovered signatures 2019-01-21 14:42:08 +01:00
Alexander Block
5958f8b81d Remove dkgRndSleepTime from consensus params and make sleeping it non-random 2019-01-10 07:07:58 +01:00
Alexander Block
6836f8c38b Implement LLMQ DKG 2019-01-09 12:16:12 +01:00
PastaPastaPasta
5c5932eb93 [PrivateSend] Allow more than 3 mixing participants (#2612) 2019-01-07 13:21:10 +03:00
Alexander Block
0c9fb69687 Harden spork15 on testnet (#2586)
* Replace IsDeterministicMNsSporkActive with IsDIP3Active

IsDIP3Active will now use a fixed parameter from consensus params.
Values for DIP0003Height/DIP0003Hash need to be updated when spork15
activates on mainnet.

Also enforce correct block hash on testnet/mainnet for DIP3 activation
block.

* Remove SPORK_15_DETERMINISTIC_MNS_ENABLED

* Replace all uses of IsDeterministicMNsSporkActive with IsDIP3Active

* Remove DIP3 upgrade-path tests and directly start with DIP3 enabled tests

* Make -masternodeprivkey non-mandatory

This code will vanish later.
2018-12-28 19:13:44 +03:00
Alexander Block
3861c6a82e Add BIP9 deployment for DIP3 on mainnet (#2585) 2018-12-28 16:03:17 +03:00
Alexander Block
79d543e896 Don't check for nSuperblockStartHash on testnet 2018-12-13 20:30:41 +01:00
Alexander Block
24ebcbd12c Remove checkpoints above block 4000 2018-12-13 15:07:40 +01:00
Alexander Block
ab3fe4fa86 Update nMinimumChainWork and defaultAssumeValid for block 4000 2018-12-13 15:07:38 +01:00
Alexander Block
b2d3e220b5 Change DIP0003 deployment to start today 2018-12-13 14:31:09 +01:00
Alexander Block
d6fa7026c9 Change CSV, DIP0001 and BIP147 deployments to start today 2018-12-13 14:31:05 +01:00
Alexander Block
431ef26280 Bump nPowKGWHeight for testnet and cause a fork at height 4001
This will reset testnet so that we can start with a clean state.
2018-12-13 13:57:08 +01:00
Alexander Block
9d33d216b7 Remove temporary code which forked testnet at block 274000 2018-12-13 13:55:46 +01:00
Alexander Block
a4f5ba38b6
Implement CDummyDKG and CDummyCommitment until we have the real DKG merged (#2492)
* Add SPORK_17_QUORUM_DKG_ENABLED spork

* Implement CDummyDKG and CDummyCommitment until we have the real DKG merged

This is only used on testnet/devnet/regtest and will NEVER be used on
mainnet. It is NOT SECURE AT ALL!

See comment in quorums_dummydkg.h for more details.

* Test simple PoSe in DIP3 tests

* Generate 2 instead of 4 blocks per iteration in PoSe tests

4 was based on old chainparams where I used larger phases.

* Only sleep when necessary in PoSe tests

* Fix typo in comment

* Give PoSe tests more time and sync after fast-forward
2018-11-26 16:53:20 +01:00
Alexander Block
80656038fa Bump nTemporaryTestnetForkHeight to 274000 (#2498) 2018-11-26 16:23:29 +03:00
Alexander Block
22b5952c5a
Implement and enforce DIP6 commitments (#2477)
* Add LLMQ parameters to consensus params

* Add DIP6 quorum commitment special TX

* Implement CQuorumBlockProcessor which validates and handles commitments

* Add quorum commitments to new blocks

* Propagate QFCOMMITMENT messages to all nodes

* Allow special transactions in blocks which have no inputs/outputs

But only for TRANSACTION_QUORUM_COMMITMENT for now.

* Add quorum commitments to self-crafted blocks in DIP3 tests

* Add simple fork logic for current testnet

This should avoid a fork on the current testnet. It only applies to the
current chain which activated DIP3 at height 264000 and block
00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f.

When we revert the chain to retest the DIP3 deployment, this fork logic
can be removed again.

* Use quorumVvecHash instead of quorumHash to make null commitments unique

Implementation of https://github.com/dashpay/dips/pull/31

* Re-add quorum commitments after pruning mempool selected blocks

* Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements

Also add BEGIN/END markers for temporary code.

* Add comments/documentation to LLMQParams

* Move code which determines if a commitment is required into IsCommitmentRequired

This should make the code easier to read and also removes some duplication.

The also changes the error types that are possible from 3 to 2 now. Instead
of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is
only "bad-qc-not-allowed" now.

* Use new parameter from consensus parames for the temporary fork
2018-11-23 15:42:09 +01:00
Alexander Block
d40a5ce31f
Properly initialize confirmedHash in CSimplifiedMNListEntry (#2479)
* Properly initialize confirmedHash in CSimplifiedMNListEntry

* Add consensus params for temporary hard-fork on testnet

This hard-fork is required on testnet as we have to fix a few consensus
bugs in DIP3/DIP4. It will also be required to introduce LLMQ commitments
to testnet.

* Add temporary fork-logic for testnet, which sets confirmedHash to null

...before fork activation. Otherwise we'd invalidate all DIP3 blocks on
testnet.

* Bump nTemporaryTestnetForkHeight to 273000
2018-11-23 10:40:46 +01:00
Alexander Block
76a38f6ceb
Update defaultAssumeValid, nMinimumChainWork and checkpoints (#2428)
* Update defaultAssumeValid and nMinimumChainWork for mainnet

* Update defaultAssumeValid and nMinimumChainWork for testnet

* Add checkpoint for mainnet

* Add checkpoint for testnet
2018-11-10 10:54:01 +01:00
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