Commit Graph

476 Commits

Author SHA1 Message Date
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
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
UdjinM6
a4ff2a19a7
Fix some warnings and do a couple of other trivial cleanups (#2315)
* Fix various warnings

* A couple of trivial cleanups

* fix 2320
2018-09-28 10:55:11 +03:00
Alexander Block
6adc236d0e Only use dataDir in CEvoDB when not in-memory (#2291) 2018-09-14 18:53:09 +03:00
Alexander Block
2a95dd30c5 Fix locking issues in DIP3 unit tests (#2285)
* Don't use GetTransaction in CheckProUpRegTx

GetTransaction locks mempool.cs internally. This brings messes up the locking
order of cs_main, mempool.cs and CCheckQueue::ControlMutex.

* Lock cs_main in TestChainSetup::CreateBlock when updating CbTx
2018-09-12 14:13:00 +03:00
Alexander Block
bc7924d418 Add unit tests for DIP3 and DIP4 2018-09-05 18:40:53 +02:00
UdjinM6
a5e65aa373
Erase mnListCache entry on UndoBlock (#2254) 2018-09-03 13:18:20 +03:00
Alexander Block
88e7888de9 Try using cache in GetListForBlock before reading from disk (#2253)
* Try using cache in GetListForBlock before reading from disk

* Use std::list for vecDiff
2018-09-03 13:17:41 +03:00
Alexander Block
d3ac86206c Implement GETMNLISTDIFF and MNLISTDIFF P2P messages
Also add "protx diff" RPC
2018-09-03 10:46:52 +02:00
Alexander Block
bcc0719578 Calculate and enforce DIP4 masternodes merkle root in CbTx
Also add "coinbase_payload" field to block templates
2018-09-03 10:46:51 +02:00
Alexander Block
0a086898f5 Implement and enforce CbTx with correct block height and deprecate BIP34 2018-09-03 10:46:40 +02:00
Alexander Block
9653af2f30 Classes, validation and update logic for CProUpRevTX 2018-08-31 17:06:33 +02:00
Alexander Block
1c68d11077 Classes, validation and update logic for CProUpRegTX 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
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
Alexander Block
c566ce75d9 Update copyright in specialtx.h/cpp 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
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
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
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