Commit Graph

10945 Commits

Author SHA1 Message Date
PastaPastaPasta
da4b5fb16e Remove an unused function from governance object collateral code (#2480) 2018-11-23 15:43:23 +01: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
PastaPastaPasta
f4ef388dea Update PS help text for the new denom (#2471) 2018-11-23 15:41:00 +01:00
gladcow
a57e9dea74 Fix filtering of the lock votes for SPV nodes. (#2468)
* check request is not empty to use it for filtering

* Filter vote INVs by tx hash

* fix lock requests filtering

* Apply suggestions from code review

Co-Authored-By: gladcow <sergey@dash.org>
2018-11-23 15:40:19 +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
UdjinM6
df7d12b41f Add univalue test for real numbers (#2460) 2018-11-22 06:09:58 +01:00
UdjinM6
2b400f74b5 Base dsq/dstx thresholold on total number of up to date masternodes (#2465)
Mixing on a newer version with small number of upgraded masternodes
causes mixing txes to "stuck" - old nodes refuse to relay dstxes from new ones because
they come from the same masternodes too often. Basing threshold on the total number
of up to date masternodes and not only on a newer (enabled) ones should solve this.
This however will cause mixing to fail if there are not enough masternodes
on the needed protocol version (i.e. at least GetMinMasternodePaymentsProto())
but it's better to stop mixing than having funds kind of spent yet not confirmed
for a long time.
2018-11-22 06:09:35 +01:00
Alexander Block
5ffc31bce4
Forbid version=0 in special TXs (#2473) 2018-11-22 06:05:32 +01:00
Alexander Block
85157f9a9e
Few trivial fixes for DIP2/DIP3 (#2474)
* Fix wrong index for argument to protx_update_service when error is thrown

* Unify and fix variable name in TxToJSON

The UniValue variable name for TRANSACTION_COINBASE was wrong and is fixed
now. Also changed names for all other special TXs to unify names. This
should avoid such errors in the future when new "else if" branches are
copy/pasted.

* Use "proRegTx" instead of "proTx" as key TRANSACTION_PROVIDER_REGISTER payloads
2018-11-22 06:05:20 +01:00
Alexander Block
2ba1ff5216
Use ParseFixedPoint instead of ParseDoubleV in "protx register" commands (#2458) 2018-11-21 08:04:42 +01:00
Alexander Block
7cabbadefd
Implement context menu and extra info on double-click for DIP3 masternode list (#2459)
* Implement context menu and extra info on double-click for DIP3 masternode list

Menu items:
- "Copy ProTx hash"
- "Copy Collateral hash"

On double click:
Show simple message box with the json representation of the DMN.

* Fix review comments
2018-11-21 08:04:19 +01:00
InhumanPerfection
e049f9c1ea fix protx register rpc help (#2461) 2018-11-21 08:02:54 +01:00
PastaPastaPasta
eb2103760b trivail, clarifies help text for protx register (#2462) 2018-11-21 08:02:15 +01:00
UdjinM6
9232a455c8 Do not hold cs_main while emitting messages in WalletModel::prepareTransaction (#2463)
* Do not hold cs_main while emitting messages

Fixes potential deadlock:
```
POTENTIAL DEADLOCK DETECTED
Previous lock order was:
 (1) cs_deqsessions  privatesend-client.cpp:966
 (2) cs_main  privatesend-client.cpp:816
Current lock order is:
 (2) cs_main  qt/walletmodel.cpp:299
 wallet->cs_wallet  qt/walletmodel.cpp:299
 (1) cs_deqsessions  privatesend-client.cpp:350
```

* Keep CWalletTx* newTx in inner scope
2018-11-21 08:01:47 +01:00
strophy
76e93c7d7b Corrections to incorrect syntax in RPC help (#2466)
* Fix incorrect inline help for "protx update_registrar"

Initial ProRegTx does not define a field named "collateralAddress". It is not necessary to use the collateral address to receive payout, any Dash address can be defined here.

* Fix incorrect syntax for "protx revoke" inline help

"operatorKey" is required here
2018-11-21 07:57:47 +01:00
UdjinM6
12aba2592d Updating translations for de, es, fi, nl, pt, sk, zh_CN, zh_TW (#2451)
* Updating de, es, fi, nl, pt, sk, zh_CN, zh_TW

Known issues:
dash_zh_CN.ts: Mismatch between 'Start &all' and '启动全部(%A)'
dash_zh_CN.ts: Mismatch between 'Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.' and '打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。'
dash_zh_CN.ts: Mismatch between 'Too many %f denominations, removing.' and '太多面额化资金,正在移除。'
dash_zh_CN.ts: Mismatch between 'Initialization sanity check failed. %s is shutting down.' and '初始化完整性检查失败。% 即将

* Fix issues in zh_CN
2018-11-16 18:40:23 +01:00
Alexander Block
cf2b547b7c
Implement tab for DIP3 MN list (#2454)
* Implement tab for DIP3 MN list

* Update src/qt/masternodelist.cpp

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

* Change "x.xx% to UNSPECIFIED" to "x.xx% but not claimed" for opeartor reward
2018-11-16 18:19:49 +01:00
Alexander Block
102d127494
Merge pull request #2446 from codablock/pr_dip3_tests
Fix integration tests and add P2SH/multisig tests for DIP3 payees
2018-11-16 09:38:36 +01:00
Alexander Block
58b7041279
Merge pull request #2447 from codablock/pr_dip4_fixdiff
Fix "protx diff" and MNLISTDIFF P2P message to not always return all MNs
2018-11-16 09:37:35 +01:00
Alexander Block
79d7af5d16
Merge pull request #2448 from codablock/pr_dip3_p2shoperatorewards
Allow P2SH/multisig addresses for operator rewards
2018-11-16 09:37:07 +01:00
UdjinM6
624e50949e Remove few leftovers of -instantsenddepth 2018-11-15 21:56:13 +03:00
UdjinM6
88498ba139
Apply suggestions from code review
Co-Authored-By: codablock <ablock84@gmail.com>
2018-11-15 15:24:24 +01:00
Alexander Block
83aac461bc Allow P2SH/multisig addresses for operator rewards
There is no reason left to stick with the P2PKH limitation
2018-11-15 13:24:46 +01:00
Alexander Block
b5947f2997 Implement BuildSimplifiedDiff in CDeterministicMNList
And use it instead of BuildDiff in DIP4
2018-11-15 10:42:39 +01:00
Alexander Block
6edad37457 Use ForEachMN and GetMN in BuildDiff instead of directly accessing mnMap 2018-11-15 10:41:14 +01:00
Alexander Block
3c1f44c3a2 Make sure protx_update_registrar adds enough funds for the fees
FundSpecialTx must take the size of signature into account.
2018-11-15 08:05:38 +01:00
Alexander Block
f4ec3db067
Merge pull request #2442 from UdjinM6/spectx
Various fixes for special txes
2018-11-15 05:18:44 +01:00
Alexander Block
684f9ae0bf
Merge pull request #2445 from codablock/pr_dip3_removerestriction
Remove restriction of payeeAddress being the same as collateralAddress
2018-11-15 05:17:43 +01:00
Alexander Block
d130f25ac3 Fix check for number of params to protx_update_service (#2443) 2018-11-14 18:57:17 +01:00
Alexander Block
f5864254cf Do not use keyIDCollateralAddress anymore when spork15 is active 2018-11-14 18:44:39 +01:00
Alexander Block
5ccf556f3a GetMasternodeInfo with payee argument should do nothing when DIP3 is active
Also change ComputeBlockVersion to directly use mnList.GetMNPayee()
2018-11-14 18:44:39 +01:00
Alexander Block
927e8bd796 Also forbid reusing collateral key for owner/voting keys
We previously only checked for the payee key.
2018-11-14 18:44:39 +01:00
Alexander Block
826e7d063a Move internal collateral check to the else branch of the external collateral check 2018-11-14 18:44:39 +01:00
Alexander Block
dc404e7550 Allow P2SH for payout scripts 2018-11-14 18:44:39 +01:00
Alexander Block
9adf8ad738 Remove restriction that forced use of same addresses for payout and collateral 2018-11-14 18:44:39 +01:00
UdjinM6
6761fa49f1 More checks for tx type 2018-11-14 16:59:10 +03:00
UdjinM6
b843696638 Be more specific about tx version in conditions
We don't want to set rules for version 4+ txes atm.
2018-11-14 16:58:05 +03:00
UdjinM6
c975a986b2 no cs_main in specialtxes 2018-11-14 16:58:03 +03:00
UdjinM6
8bd5b231bf Log mempool payload errors instead of crashing via assert 2018-11-14 16:57:41 +03:00
UdjinM6
658b7afd18 Make error messages re payload a bit more specific 2018-11-14 16:57:41 +03:00
Alexander Block
4ad2f647c2 Use proTxHash instead of outpoint when calculating masternode scores (#2440)
* Track confirmedHash of masternodes

* Also include confirmedHash in DIP4

* Implement CalculateQuorum and CalculateScores in CDeterministicMNList

* Use new ProRegTx based scoring function in GetMasternodeScores

* Update test vectors for simplifiedmns_merkleroots tests
2018-11-13 15:24:14 +03:00
UdjinM6
adf9c87e2e
Fix protx/bls rpc help (#2438) 2018-11-13 15:23:52 +03:00
UdjinM6
579c83e881
Add coinbase_payload to getblocktemplate help (#2437) 2018-11-13 15:23:31 +03:00
Alexander Block
3685c85e7f Show BIP9 progress in getblockchaininfo (#2435)
* Implement VersionBitsCountBlocksInWindow

This gives the count of blocks that voted for the given BIP9 deployment

* Add additional information to BIP9 softforks returned by getblockchaininfo

* make sure progress doesn't exceed 1
2018-11-12 18:08:58 +03:00
UdjinM6
46462d6829
Add a column for IS lock status on Transactions tab (#2433)
* Drop colorizing for IS

* Add IS column

* Add IS filter
2018-11-12 18:08:31 +03:00
Alexander Block
c27e62935f
Allow reusing of external collaterals in DIP3 (#2427)
* Allow to reuse collaterals and addresses in ProRegTx

This also requires to move out the duplication check from CheckService to
the 2 individual ProTx check methods.

* Implement replacement logic for reused collaterals

* Add tests for new replacement logic
2018-11-10 10:54:16 +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
UdjinM6
5ecd91b054 Fix ps collateral/denom creation tx category confusion (#2430)
* fix ps collateral/denom creation tx confusion

* clarify the logic of detecting PrivateSendMakeCollaterals/PrivateSendCreateDenominations category
2018-11-10 10:53:29 +01:00
Alexander Block
0e9ad207ae
Update hardcoded seeds (#2429)
* Update seeds for mainnet

* Update seeds for testnet
2018-11-10 06:29:14 +01:00
PastaPastaPasta
42ee369b17 [Formatting] masternodelist.* clang+manual format (#2426)
* format

* clang suggested changes to be reverted

* Revert "clang suggested changes to be reverted"

This reverts commit 2c1e7744be.
2018-11-09 09:48:51 +03:00
UdjinM6
da3e3db4dd
Fix sub-command help for masternode, gobject and protx rpcs (#2425)
Fixes #2424
2018-11-09 09:48:26 +03:00
thephez
adad3fcfe3 RPC: protx help corrections (#2422)
* RPC - Correct protx register_prepare help example

Use collateral hash and index instead of address

* RPC - Change protx register help ECDSA address to BLS operator key

* RPC - protx register_prepare help correction

Should direct to protx register help, not protx register_fund

* RPC - protx help typo
2018-11-08 20:03:50 +03:00
UdjinM6
262454791c
Add 5th denom, drop deprecated logic and bump min PS version (#2318)
* Bump PS
- add 5th denom (0.001)
- always allow OP_RETURN in PS collaterals
- collateral amount is always 1/10 of the smallest denom
- bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70211

* drop backward compatibility in dsa/dsq serialization

* Use GetSmallestDenomination() in GetCollateralAmount()

* bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70212
2018-11-07 10:39:25 +03:00
UdjinM6
e961c71343
Translations 201811 (#2249)
* update en source

* remove pt_BR

it's no longer present on Transifex

* Update existing translations

NOTE: there are some mismatches in zh_CN

dash_zh_CN.ts: Mismatch between 'Start &all' and '启动全部(%A)'
dash_zh_CN.ts: Mismatch between 'Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.' and '打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。'
dash_zh_CN.ts: Mismatch between 'Too many %f denominations, removing.' and '太多面额化资金,正在移除。'
dash_zh_CN.ts: Mismatch between 'Initialization sanity check failed. %s is shutting down.' and '初始化完整性检查失败。% 即将关闭。'

* Add ar, ko, th

NOTE: there are 2 mismatches in ar

dash_ar.ts: Mismatch between '(of %1 GB needed)' and '(على 1% جيغابايت محتاجة)'
dash_ar.ts: Mismatch between 'Output debugging information (default: %u, supplying <category> is optional)' and 'معلومات تصحيح الخرج  <category>ا(ختياري)'

* update bg, it, ja, ko, nl, pl, th

* fix ru

* add tr

* fix
2018-11-07 10:39:06 +03:00
PastaPastaPasta
f0df5bffa6 Clang evo folder and activemasternode.* (#2418)
* clang + manual formatting

* clang activemasternode.*

* bump copyright

* weirdness correction
2018-11-06 11:54:23 +03:00
PastaPastaPasta
98bdf35f9d bump PS copyright (#2417) 2018-11-05 12:29:33 +03:00
PastaPastaPasta
e9bb822c10 Clang format PrivateSend files (#2373) 2018-11-05 12:29:07 +03:00
UdjinM6
1d56dffdaf
Unify help display logic for various "complex" rpc commands (#2415)
* Unify help display logic for various "complex" rpc commands

* add [[ noreturn ]] attribute and drop dummy returns
2018-11-05 12:28:38 +03:00
Alexander Block
9da9d575aa Allow collaterals for non-DIP3 MNs which were created after DIP3/BIP9 activation (#2412)
* Remove reference to now removed "protocolVersion"

* Allow to use non-DIP3 collaterals after DIP3 activation

This removes a rule which only made sense when we assumed all collaterals
would remain in DIP3 ProRegTx transactions after DIP3 activation.

As we allow to refer external collaterals now, this rule should vanish as
well.

* Sleep in case block time is ahead of real time

See comment. This was not a problem before as we had enough time passed
between the last block that caused this and the start-alias call.
Now we added another start-alias call which is directly after we generated
many blocks.
2018-11-04 14:55:50 +03:00
UdjinM6
23f169c44a
Drop custom PS logic for guessing fees etc. from SelectCoins (#2371)
* drop most of custom PS logic from SelectCoins and inject it into regular flow (i.e. SelectCoinsMinConf)

* different priority for different denoms

* move CompareByPriority higher

* update comment

Co-Authored-By: UdjinM6 <udjinm6@gmail.com>
2018-11-04 14:55:16 +03:00
thephez
02442673d2 Trivial: Correct protx diff RPC help (#2410) 2018-11-02 11:18:05 +03:00
Alexander Block
5e829a3b1b Update Chia bls-signature to latest version (#2409)
Brings in:
1. https://github.com/Chia-Network/bls-signatures/pull/41
2. https://github.com/Chia-Network/bls-signatures/pull/46
3. A few commits from https://github.com/codablock/bls-signatures are now
   merged into upstream.

This removes the need for manual initialization of the BLS library. This is
now done internally and in a thread-safe way.

Also switch to using tags instead of raw commit hashes. Makes testing
easier and also removes the risk of Github deleting commits due to
cleanup jobs.
2018-11-02 00:59:11 +03:00
thephez
1f56600c4b Trivial: Protx operator reward clarification (#2407)
Add decimal places to clarify:
1. Non-integers are valid (e.g. 3.25)
2. Granularity - anything beyond x.xx is rounded (e.g. 3.259 -> 3.26)

This is due to DIP3 allowing values 0-10000 for operator reward (1/10000
= 0.01%)
2018-11-02 00:58:36 +03:00
UdjinM6
7e8f07bb92
A couple of fixes for shutdown sequence (#2406)
* Do not run scheduled DoMaintenance if shutdown was requested

* Don't dump cache files if the load sequence was interrupted

* Stop privatesend and release keys before wallet flush

* fix typo
2018-11-02 00:58:17 +03:00
UdjinM6
9c455caea9
A couple of fixes for init steps (#2405)
* fLiteMode should be set via GetBoolArg before first usage

Also move related stuff to be closer to each other

* Cleanup Dash-specific init steps

* Move deterministicMNManager creation slightly higher for consistensy
2018-11-02 00:58:01 +03:00
thephez
7011fec1b4 RPC: Add help details for the bls RPC (#2403)
* RPC: Add help details for the bls RPC

* RPC: Refactor to match gobject RPC behavior

* RPC: Use command instead of strCommand for consistency within file

* RPC: BLS help cleanup

* RCP: Remove leading underscore on bls_help
2018-11-02 00:57:43 +03:00
Alexander Block
30a2b283a8 Sign ProRegTx collaterals with a string message instead of payload hash, split protx register into prepare/submit (#2395) 2018-11-02 00:57:10 +03:00
Alexander Block
70eb710b12
Undefine DOUBLE after include Chia BLS headers (#2400)
These cause compilation errors on some platforms.
Observed this when I tried to cross compile win32
locally on a Debian Stretch machine.
2018-10-31 10:58:02 +01:00
Alexander Block
052af81b4b
Ensure correct order of destruction for BLS secure allocator (#2401)
Uses the same trick as LockedPoolManager::Instance()
2018-10-31 10:57:14 +01:00
UdjinM6
c6cf4d9a47
Relay txes through MN network faster than through regular nodes (#2397)
* Half the delay for relaying txes to Masternode outbound peers comparing to regular ones

* No delay for relaying txes if our node is a Masternode
2018-10-30 13:00:04 +03:00
UdjinM6
4a78b161ff
PrivateSend spending txes should have "outgoing" icon on overview screen (#2396) 2018-10-30 12:59:50 +03:00
Anton Suprunchuk
50f133ad0a Add merkle tree and coinbase transaction to the protx diff rpc command (#2392) 2018-10-30 12:59:32 +03:00
Alexander Block
e34701295d Fix crash when deterministic MN list is empty and keep paying superblocks in this case (#2387)
* Don't crash when spork15 is enabled but no MNs have been registered

* Don't bail out when no masternode payee is found

We should pay superblocks even if no masternode payee is found.

* Add missing newline to LogPrint call

* Handle review comments
2018-10-30 12:59:03 +03:00
Alexander Block
9eb9c99d59 Bump version to 0.13.0 (#2386) 2018-10-26 19:43:08 +03: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
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
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
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
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
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
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
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
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