Commit Graph

14979 Commits

Author SHA1 Message Date
Alexander Block
8aca3b0404 Also check duplicate addresses for CProUpServTX in CTxMemPool 2018-08-31 17:06:24 +02:00
Alexander Block
923fd67395 Implement CProUpServTx logic in CDeterministicMNManager 2018-08-31 17:06:24 +02:00
Alexander Block
6ec0d7aea5 Classes and basic validation of ProUpServTx 2018-08-31 17:06:24 +02:00
Alexander Block
255403e927 Include proTx data in json formatted transactions 2018-08-31 15:33:09 +02:00
Alexander Block
25545fc1e7 Split keyIDMasternode into keyIDOwner/keyIDOperator/keyIDVoting (#2248)
* Split keyIDMasternode into keyIDOwner/keyIDOperator/keyIDVoting

keyIDOwner is the key used for things which should stay in control of the
collateral owner, like proposal voting.

keyIDOperator is the key used for operational things, like signing network
messages, signing trigger/watchdog objects and trigger votes.

keyIDVoting is the key used for proposal voting

Legacy masternodes will always have the same key for all 3 to keep
compatibility.

Using different keys is only allowed after spork15 activation.

* Forbid reusing collateral keys for operator/owner keys and vice versa

* Bump SERIALIZATION_VERSION_STRING in CMasternodeMan
2018-08-31 16:31:59 +03:00
Alexander Block
5295c78cca Fix typo in "penalty" (#2247) 2018-08-31 12:33:37 +03:00
UdjinM6
74629e453d
Merge pull request #2246 from codablock/pr_dip3
First part of DIP3 implementation
2018-08-30 22:24:01 +03:00
Alexander Block
c566ce75d9 Update copyright in specialtx.h/cpp 2018-08-30 19:47:48 +02:00
Alexander Block
5e3abeca24 Implement "protx list" RPC 2018-08-30 19:47:48 +02:00
Alexander Block
2c172873aa Don't allow non-ProTx masternode collaterals after DIP3 activation 2018-08-30 19:47:48 +02:00
Alexander Block
5461e92bf4 Add spork to control deterministic MN lists activation 2018-08-30 19:47:48 +02:00
Alexander Block
9e8a867149 Implementation of deterministic MNs list 2018-08-30 19:47:48 +02:00
Alexander Block
76fd308947 Automatically lock ProTx collaterals when TX is added/loaded to wallet
Avoid accidential spending of ProTx collaterals.
2018-08-30 19:47:38 +02:00
Alexander Block
cdd723ede6 Conflict handling for ProRegTx in mempool 2018-08-30 19:47:38 +02:00
Alexander Block
c772423468 Implement "protx register" RPC 2018-08-30 19:47:38 +02:00
Alexander Block
958b84ace3 Implementation of ProRegTx with basic validation (no processing) 2018-08-30 19:47:30 +02:00
Alexander Block
c9a72e8880 Introduce CEvoDB for all evo related things, e.g. DIP3
Also add transaction handling to ConnectTip and DisconnectTip and a few
other places where blocks are processed.
2018-08-30 19:47:22 +02:00
Alexander Block
4531f6b896 Implement CDBTransaction and CScopedDBTransaction
Allows easier commit/rollback handling, especially useful when AcceptBlock
fails and things need to be reverted.
2018-08-29 15:49:31 +02:00
Alexander Block
e002c50b04 Add "immer" functional/immutable containers library (#2244)
Add "immer" functional/immutable containers library
2018-08-29 16:31:21 +03:00
Alexander Block
e225cebcdb Use previous block for CheckSpecialTx (#2243)
We actually can't use the current block as that one might not be fully
processed/built yet.
2018-08-29 16:26:16 +03:00
gladcow
1c25658044 Refactor masternode and gobject RPCs to support help command subCommand syntax (#2240)
* Support help for masternode rpc call subcommands

* Support help for gobject rpc call subcommands

* squash ifs for conditions to show help

* remove code duplication for masternode list and masternodelist help calls
2018-08-29 14:36:35 +03:00
Alexander Block
799e3c3126 Perform Jenkins builds in /dash-src all the time to fix caching issues (#2242) 2018-08-29 13:03:18 +03:00
UdjinM6
40eee1775f
Fix sync in regtest (again) (#2241)
Should only call SwitchToNextAsset() while being in specific state and not on every tick
2018-08-29 13:02:54 +03:00
UdjinM6
28ba2ad0fb
Merge pull request #2239 from codablock/pr_dip2
DIP2 / Special Transactions base implementation
2018-08-29 13:02:09 +03:00
Alexander Block
fb4d301a20 Add extraPayloadSize/extraPayload fields to RPC help 2018-08-29 11:45:53 +02:00
Alexander Block
8af7f62232 Account for extraPayload when calculating fees in FundTransaction 2018-08-29 11:36:14 +02:00
Alexander Block
b606bde9a9 Support version 3 transaction serialization in mininode.py 2018-08-29 11:36:14 +02:00
Alexander Block
61bbe54ab3 Add Get-/SetTxPayload helpers 2018-08-29 11:36:14 +02:00
Alexander Block
cebf71bbc3 Stubs for special TX validation and processing 2018-08-29 11:36:14 +02:00
Alexander Block
d6c5a72e2f Basic validation of version 3 TXs in CheckTransaction 2018-08-29 11:36:14 +02:00
Alexander Block
a3c4ee3fda DIP2 changes to CTransaction and CMutableTransaction 2018-08-29 11:36:14 +02:00
Alexander Block
d20100ecd4 DIP0003 deployment 2018-08-29 11:36:14 +02:00
Alexander Block
b6896387ae Move DIP1 transaction size checks out of ContextualCheckBlock and use ContextualCheckTransaction instead (#2238)
* Pass consensus params to ContextualCheckTransaction

As we do with ContextualCheckBlock

* Use ContextualCheckTransaction in ContextualCheckBlock instead of duplicating the check

* Fix pindexPrev parameter signature in ContextualCheckTransaction
2018-08-28 14:43:58 +03:00
Alexander Block
e415fd049a Revert CMasternodePayments::IsTransactionValid to the logic before the recent refactorings (#2237)
partially reverts #2216
2018-08-27 15:48:45 +03:00
Nathan Marley
73c2ddde7a extract sporkmanager from sporkmessage (#2234)
The SporkMessage is a lower-level construct which shouldn't be aware of
SporkManager. This commit moves the `sporkManager.IsSporkActive()` calls
outside the SporkMessage functions. This follows the dependency injection
pattern and makes it easier to test SporkMessage as well.
2018-08-22 17:46:27 +03:00
Alexander Block
8da88ecf68 Don't crash when formatting in logging throws exceptions (#2231)
* Don't crash when formatting in logging throws exceptions

* Preserve exception like output
2018-08-21 18:34:26 +03:00
gladcow
b92bd8997a Fix mninfo search by payee (#2233) 2018-08-21 17:08:42 +03:00
Nathan Marley
2997d6d268 add compressed option to masternode genkey (#2232)
* add compressed option to `masternode genkey`

* use ParseBoolV method

* adjust help message for masternode genkey
2018-08-21 17:08:11 +03:00
PastaPastaPasta
98ed90cbb4 adds rpc calls for setprivatesendrounds and setprivatesendamount (#2230)
* adds rpc calls for `setprivatesendrounds` and `setprivatesendamount`

* tabs -> spaces

* @gladcow change request

* Whops tab -> spaces

* @Udjin changes, not the CAmount -> int

* int stuff

* Throw error when rounds / amount isn't within range
2018-08-21 17:07:54 +03:00
gladcow
2e06f8133f fix missed format parameter (#2229) 2018-08-21 17:07:32 +03:00
Alexander Block
3d654b9814 Build bionic base image in Jenkinsfile.gitian & update docs (#2226)
* Build bionic base image in Jenkinsfile.gitian

We updated gitian builds to use bionic, so we should also update the Jenkinsfile

* Update docs
2018-08-14 22:36:15 +03:00
Alexander Block
50eb98d901 Prepare for DIP3 operator reward payments and switch to array in getblocktemplate (#2216)
* Prepare for DIP3 operator reward payments and switch to array in getblocktemplate

This commit allows to later split MN rewards into multiple recipients, e.g.
the owner reward and operator reward. It also updates the getblocktemplate
output to return an array of MN payments instead of a single entry.

This should allow MN miners and pool operators to prepare themself for the
upcoming changes in regard to operator rewards.

* txoutsMasternode -> voutMasternode

* More renaming

* Consider all masternode payments when looking for a known masternode
2018-08-14 12:58:38 +03:00
Alexander Block
c09f57bd78 Backport move to Ubuntu Bionic and GCC7 in Gitian builds (#2225)
* Add stdin, stdout, stderr to ignored export list

* Merge #13171: Change gitian-descriptors to use bionic instead

c1afe3232fa10e290fb355cf37ea4c7bc1084065 Change gitian-descriptors to use bionic instead (Chun Kuan Lee)

Pull request description:

  I have tested this with Ubuntu Bionic host with lxc 3.0.0, the gitian-build for Windows and MacOSX work fine, but there is an issue about it for Linux. Failed at check-symbol:
  ```
  test/test_bitcoin: symbol __divmoddi4 from unsupported version GCC_7.0.0
  test/test_bitcoin: symbol log2f from unsupported version GLIBC_2.27
  qt/bitcoin-qt: symbol __divmoddi4 from unsupported version GCC_7.0.0
  qt/bitcoin-qt: symbol log2f from unsupported version GLIBC_2.27
  ```
  I think this should be fixed in `./configure --enable-glibc-back-compat`

  Should not be merged before #13177 devrandom/gitian-builder#178

  Close #12511

Tree-SHA512: 257d75d5b6864e105279f7a7b992fbbd7903cdbe3300b66dacec0a783d267707d9dbbfe0e64a36983ca1eca50a2a5e1cdb222b6d3745ccc3e5fc5636c88b581f

* Use IN6ADDR_ANY_INIT instead of in6addr_any

This is the same fix as fc6a9f2ab1
Couldn't backport the original commit as we are missing some refactorings.
2018-08-13 23:21:42 +03:00
gladcow
1767e3457e Save/load spork cache (#2206)
* CSporkManager class serialization

* Read/write sporks.dat file

* Move mapSporks into CSporkManager and serialize it

* fix GetSporkByHash

* spork tests

* add missed cs lock

* clear mapSporksByHash in CSporkManager::Clear

* use spork active rpc call to hide spork inner logic

* set small pause between rpc calls in cycles
2018-08-13 23:21:21 +03:00
Alexander Block
7cf9572c26 Backport Bitcoin #11881: Remove Python2 support (#2224)
* Merge #11881: Remove Python2 support

1874058 Make base58 python contrib code work with python3 (Evan Klitzke)
bc6fdf2 Change all python files to use Python3 (John Newbery)

Pull request description:

  Following discussion here: https://github.com/bitcoin/bitcoin/pull/11843#issuecomment-351033742

  It's easier for maintainers if all python tools/scripts support only a single version of Python. There are only a few scripts that aren't explicitly python3 at this point, so this PR changes those remaining scripts to explicitly require python3.

Tree-SHA512: 5d38eef6e0fc7d8515e23a1f4c75e8b4160fd0fe23cba52a1f41689b114e54a9e503e0724829e8b41982ef98f2d113df80d9e238213b74f09ceaed0344a19e24

* Merge #12829: Python3 fixup

f50975b [contrib] fixup symbol-check.py Python3 support (John Newbery)
5de2b18 [contrib] fixup security-check.py Python3 support (John Newbery)

Pull request description:

  security-check.py and symbol-check.py were broken by #11881. Fix them.

Tree-SHA512: 86de3d6dc3292b1ae4cc04c2d7d7dbbf39c9270551d7b224b8d8b19e3184c30c897dbf823200403706d06bb405c0decad5cfd690cb2c0312992a235a4ffcf6bf
2018-08-13 19:07:52 +03:00
Alexander Block
4d3518fe04 Refactor MN payee logic in preparation for DIP3 (#2215)
* Refactor block payee filling/validation

1. Move out old budget validation into it's own function (IsOldBudgetBlockValueValid)
2. Refactor IsBlockValueValid to bail out early instead of using deep
   nested if/else blocks. IMHO, I feel that this makes the code much easier
   to read and less error prone.
3. Refactor/rename CreateSuperblock and CMasternodePayments::FillBlockPayee
   to be getters without actually modifying the coinbase TX. The coinbase
   is now only modified from the global FillBlockPayments function. Makes
   later changes in DIP3 easier (allowing superblock and MN rewards in same block)

* Use __func__ for logging in block payee code

* Fix code style nit
2018-08-12 18:27:09 +03:00
Alexander Block
d946f21bd9 Masternode related refactorings in preparation of DIP3 (#2212)
* Split CActiveMasternode into CActiveMasternodeInfo and CLegacyActiveMasternodeManager

* Use CKeyID instead of CPubKey whenever possible in masternode code

* Rename activeMasternode to activeMasternodeInfo and make it a struct

* Rename pubKeyIDXXX to keyIDXXX

* Bump SERIALIZATION_VERSION_STRING

* Fix build error after rebase

* Fix compilation warning/error with clang
2018-08-11 22:55:56 +03:00
Alexander Block
633879cd28 Only use version 1 and 2 transactions for sighash_tests (#2219)
Also regenerated sighash.json with the help of PRINT_SIGHASH_JSON
2018-08-11 01:36:36 +03:00
Alexander Block
2d4e18537c Some useful commits from the DIP3 PR in regard to integration tests (#2218)
* Allow changing budget parameters for regtest

* Lift some limitations for local addresses for masternodes in regtest

Needed to make masternodes works in regtest mode

* Add "masternode check" RPC to force invocation of CheckAndRemove

Useful in integration tests where MN lists must be predictable
2018-08-11 01:36:17 +03:00
Alexander Block
a959f60aa7 De-duplicate "gobject vote-alias" and "gobject "vote-many" code (#2217)
Use same code for both vote modes
2018-08-11 01:35:52 +03:00