Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] zPIV v2: zPoS dzPIV ezPIV external backup and budget fixes #582

Merged
merged 139 commits into from
May 1, 2018

Conversation

Fuzzbawls
Copy link
Collaborator

The combined efforts from the developer's private repository over the past few months. Far too much to detail here, but the various new features, or heavily changed features will be detailed in the 3.1 release notes in a subsequent PR.

presstab and others added 30 commits March 30, 2018 21:48
This allows for more transaction types using zPIV, including using zPIV without actually spending it (for example if needing to show proof of zPIV for voting or for masternode collateral).
Requiring that v2 zPIV use serials that have the first byte as 00 will make zPIV v2 serials unique from v1 serials. This prevents a 'serial troller' from reminting with someone elses v2 serial and simply changing the version flag to v1 when they spend the zerocoin, which would negate any of the additional v2 requirements.

It is unlikely that many (if any) serials were minted with the first byte as 00. Note that if there are existing v1 zPIV with 00 prefixed serials, it would make them unspendable since the owner would not have an associated private key.
This is mostly depreciated code since the removal of coinjoin style
privacy (Obfuscation), but the missing boolean variable in these two
calls was causing compiler warnings on newer versions of gcc for always
evaluating to true.

The use of a static `false` was taken from upstream DASH.
- don't print masternode ip in the logs
- join fHelp and wrong command clauses
- use more descriptive names for pubkeys variables
- change "result" to "success" and make it a boolean value
- use array for resultsObj in createmasternode all
- use lowercase for json objects
- add detailed output example to decodemasternodebroadcast help
- fix rpcserver.cpp indentation
- New spork key added
- Sporks signed with the old key are valid until a pre-determined time
- No NEW spork changes can be signed with the old key
`nStartupTime` is initalized before the P2P network initialization takes
place, making the use of `GetAdjustedTime()` cause a lock ordering
segfault under certain situations.
These locks address compiler warnings when compiling with clang's
`-Wthread-safety-analysis`
This slipped in from some other testing i was doing, shouldn't be
included yet.
These were left out, and break Travis/Gigian building due to them not
being included in the dist tarball.
Sporks are uint64, but the input variable was being parsed as an int,
causing an out-of-range error for larger values.
@Sieres
Copy link

Sieres commented May 1, 2018

ACK

Well done team!

@PIVX-Project
Copy link
Collaborator

ACK

Great Job everyone.. :)

@h0wXD
Copy link

h0wXD commented May 1, 2018

ACK

Nice work guys!!!

@Fuzzbawls Fuzzbawls merged commit 55e840c into PIVX-Project:master May 1, 2018
Fuzzbawls added a commit that referenced this pull request May 1, 2018
…et fixes

55e840c [Qt] Update Translations for 3.1.0 Release (Fuzzbawls)
fe82aa9 Set zPIV v2 activation block to 1153160. (presstab)
3b22072 Change spork key validity period. Minor spork code refactor. (presstab)
caaedd9 Add mainnet checkpoint block 1142400. (presstab)
eaa5a2b [Core] Initialzed seed for rand()   (trivial change) (Mrs-X)
7ce4598 Guard against non-integer input for GUI's custombackupthreshold (Fuzzbawls)
a95864b Display -backuppath, -zpivbackuppath, -custombackupthreshold in wallet repair menu (rejectedpromise)
38992c3 [Budget] Spread out voting on finalized budget for testnet also. (Mrs-X)
46ec20e Cleanup log spam & add additional check to archive zpiv stake orphans. (presstab)
1e3fdea Simplify and document -custombackupthreshold (Fuzzbawls)
c034fde Factor out components of ListMints() so that it is more legible. (presstab)
59b0478 Add minimum zPIV maturity consideration to GetMintMaturityHeight(). (presstab)
e2d9b0a Update copyright headers (Fuzzbawls)
206c483 Fix compilation (Warrows)
fafc084 [Budget] Handling of too few votes for finalized budget fixed (Mrs-X)
511d591 Remove/replace logging that is not necessary. (presstab)
d07e1a8 [Output] Log network message receives as "net" debug category (Fuzzbawls)
13e239b [Staking] Exit CreateCoinStake loop if wallet locked/shutdown (Fuzzbawls)
e969980 [Wallet] Refactor ListMints to more quickly detect orphan/failed stakes (Fuzzbawls)
0156b6f Use unique_ptr for stake input list. (presstab)
1182a7e Update hard-coded seeds (Fuzzbawls)
77accb2 Do not rely on chainActive with contextual checks. (presstab)
9adf458 [Fix] fix translation build error (rejectedpromise)
446ce40 Use smart pointers to keep better track of memory. (presstab)
8bd49be Fix first run initialization of zwallet with encrypted wallet.dat file (Fuzzbawls)
8046a52 custom wallet backup paths (rejectedpromise)
7a4e7fd [Wallet] Fix ListMints when returning only unused mints (Fuzzbawls)
0b3562c [Budget] Improved double-payment-handling. (Mrs-X)
7328ca5 Save searched dzpiv to DB. Less verbosity. (presstab)
19a0a21 Add multithreading to RPC searchdzpiv. (presstab)
7323ecb More efficient scanning during zapwallettxes. (presstab)
8bb4ecf Fix segfault on importzerocoins RPC. (presstab)
707a1fa Readd zPIV tx's during -zapwallettxs (presstab)
3d92b78 Make sure that mintpool checks all mints. (presstab)
2149f34 Do not archive zpiv orphans on IDB. (presstab)
623e5c8 dzpivstate RPC call. Displays state of deterministic zpiv wallet. (presstab)
0de37d9 [Crypto] minor changes on BigNum uses (warrows)
0bfebbd [Crypto] Fix %= and /= bignum operators (warrows)
b223f08 [Crypto] Remove BigNum constructor implicitly calling SetHex (warrows)
1b0cf3d [Crypto] Bignum getcompact return correct result (warrows)
22b12f8 [Budget] Additional log for Budget debugging (Mrs-X)
7a42439 [Budget] Fix double-payment issue and replace "zPiv" by "zPIV" strings (Mrs-X)
d22a456 Make zpiv unarchiving work with zpivtracker. (presstab)
6fdc6f4 [tests] Fix zPIV determinism test (warrows)
bd7cecb [Staking] Fix Stake Split Threshold for PIV staking (Fuzzbawls)
5454f3c Remove the no longer supported obfuscation RPC command (Fuzzbawls)
38f226e Teach EnsureWalletIsUnlocked() to accept unlock for anon only (Fuzzbawls)
3809ec4 Make all RPC commands use the same styling format (Fuzzbawls)
68f5017 Add better help text to all zerocoin related RPC commands (Fuzzbawls)
241b85a More description for spend that fails without using zpiv control dialog. (presstab)
d518369 Require v1 zPIV to use security level 100. (presstab)
2809f0e [Qt] Fix zPIV spend's nCount (Fuzzbawls)
91072a3 Handle zPIV seed db transition. (presstab)
1afe3b2 Create rejectedpromise-key.gpg (rejectedpromise)
25421b4 [RPC] Fix clang error with vMintsToFind (Fuzzbawls)
b90220f [GUI] Minor tooltip change (Mrs-X)
7139c20 Mark orphan zPIV stake input as not used. (presstab)
80435d7 [Budget] Add debug info to CFinalizedBudget::IsTransactionValid() (Mrs-X)
d9f1fc9 [Budget] Add debug info to CBudgetManager::IsTransactionValid() (Mrs-X)
84ed322 [Budget] Remove obsolete finalized budgets + better debug info (Mrs-X)
a65d61a [Budget] Fix 'Couldn't find opReturn' error 1 (Mrs-X)
0ea334c [Budget] Add debug to find 'Couldn't find opReturn' error (Mrs-X)
00faff5 [Qt] Fix another instance of a wayward eye (Fuzzbawls)
379c857 Encryption of zpiv seeds (rejectedpromise)
48ee1e3 [Wallet] Fix compilation on windows (Warrows)
e830bf3 [Qt] Fix normal PIV transaction record amount (Warrows)
dd8a410 [Qt] Fix mn reward showing as zPIV stake (warrows)
6b0b6d0 [Qt] Properly set involvesWatchAddress in the transaction record (Fuzzbawls)
153974a Fix checking if mint is in chain. (presstab)
c81961b Use correct params for spend when checking serial in miner. (presstab)
5d147d5 Remove balance check from CreateCoinStake(). (presstab)
b4a8f9b zpivTracker better check for orphans. Also no redundant adding wtx's. (presstab)
d8dac2e Fix QT transaction record when staking zpiv that was not deterministic. (presstab)
0b94a23 Do not try to add all zpiv stakes on init. (presstab)
03e0197 Fix MintPool logprint. (presstab)
01bfbcf Load only the mintpool for the current seed, prevent the generation of mints already in the mintpool, and prevent the zpivwallet count from being updated when an error occurs during zpiv minting. (Anthony)
c3c6357 Fix timing inconsistency with mature/unconfirmed zpiv balances (Fuzzbawls)
7f3ebf6 Don't exit early in ReconsiderZerocoins (Fuzzbawls)
161ea63 Fix mature zPIV balance calculation (Fuzzbawls)
d7eb1c3 Add -reindexzerocoin arg to wipe zerocoindb and reindex blockchain. (presstab)
2e3ab2d Make sure mints are added to zerocoinDB even when it is a zcspend. (presstab)
bea9c16 Make zPiv wallet consistently use nCount as the last count used and remove comparison against nCountLastGenerated that resulted in adding to the mintpool every time the wallet got opened. (Anthony Posselli)
85e8a14 Remove uneeded lock on createcoinstake(). (presstab)
973c661 Remove AddToWallet() from miner.cpp. (presstab)
cdb0bab Fix segfault on chainparams. (presstab)
3d7d5e5 Handle generating witness from mint less than checkpointed value. (presstab)
9e44bf0 Use 1 second GUI update time. (presstab)
bfb491e Correct confirmation count on qt transaction records. (presstab)
413638c Fix parsing of QT transaction records on fresh import of seed. (presstab)
ffe32a1 [P2P] Guard CInv::ToString against unknown types (Fuzzbawls)
41122af [Wallet] Fix GetImmatureZerocoinBalance (Fuzzbawls)
2b896d1 [Staking] Fix MintableCoins and fMintableCoins (Fuzzbawls)
78691eb [GUI] Update GUI depending on SPORK_16 without restart (Mrs-X)
097bda6 [Core] Guard against a segfault in serialization (warrows)
73abc88 [Qt] Fix zPIV transactions details (warrows)
e365b06 Use unique databasing for dzpiv and do not database private info. (presstab)
2ac69b7 Check for existence of zpivTracker in ListMintedCoins(). (presstab)
bea2bdf Do not database zerocoinmint too early. (presstab)
4b7c9ba Database mints generated by the mintpool. (presstab)
c697920 Add zpivTracker. (presstab)
26fff8f Working model for deterministic zPIV. (presstab)
06b43c8 [Budget] Finalization fixes (Mrs-X)
1736e9a Fix zPIV mint databasing. (presstab)
9acf15d minor style change (gpdionisio)
31d9af7 Sign "old" strMessage before nBlockZerocoinV2 (gpdionisio)
d6de894 GetOldStrMessage() / GetNewStrMessage(): check against both (gpdionisio)
8c4d5b1 [QT] Fix zPIV stake transaction record (warrows)
fd4249f [Wallet] Stop removing spent zPIV hashes from map (warrows)
3e214f3 [Qt] Show correct data for MN reward on a zPIV stake block (warrows)
a36c277 [RPC] Fix spork command input length (Fuzzbawls)
7b956ed Fix typo in ban reason output (Fuzzbawls)
396502f Load mint version based on serial parsing. (presstab)
67b0649 [Build] Add missing files to src/Makefile.am (Fuzzbawls)
cf32160 Remove extra typedef (Fuzzbawls)
d834654 Clean up apparent locking issues (Fuzzbawls)
309324e Clean up lockorder data of destroyed mutexes (Fuzzbawls)
ee6a28f [Wallet] use GetTime() for nStartupTime (Fuzzbawls)
03b3712 [P2P] Add new spork key and handling logic (Fuzzbawls)
9cb0a86 Style Changes (gpdionisio)
2edcfec use error() instead of LogPrintf() (gpdionisio)
f50ee7e factor out GetStrMessage() - define MIN_PEER_MNANNOUNCE (gpdionisio)
914fb2c restore protocolVersion (lowered for testing purposes) (gpdionisio)
4ab9352 broke up the RPC commands in create/decode/relay (gpdionisio)
5fd451f implemented masternode_broadcast (gpdionisio)
24b4b3e Change Masternode mess. format (fix signatures) - bump PROTOCOL_VERSION (gpdionisio)
06ee9a4 [Budget] Change finalization collateral to 5 PIV (Mrs-X)
e387107 Fix coinbase check. Add override specifiers. Proper init for SetDec. (presstab)
c8fdf7d [zPIV] Adjust testnet v2 starting block (Fuzzbawls)
bbac132 [Wallet] Add missing variable to 2 AvailableCoins() calls (Fuzzbawls)
6b8088e [P2P] Update ActiveProtocol for 70913 protocol version (Fuzzbawls)
5d00c91 Make RPC export/import zerocoins compatible with v2. (presstab)
89595d0 Add description for -pivstake= and -zpivstake=. (presstab)
2651228 Change zpiv stake to use serial hash. (presstab)
5a3bfe1 Switch to a new accumulator with the correct modulus. (presstab)
53ff40b change to using first nibble as 0xF for v2 serial mark. (presstab)
78a7904 V2 zPIV must have serials that have the 1st byte as 00. (presstab)
5a9692a Validate that the correct spend type is used for zPIV spend and zPIV stake. (presstab)
977a520 Add libzerocoin::SpendType enum. (presstab)
3b778f5 Staking zPiv. (presstab)

Tree-SHA512: e51a9c2a13ecd7c39696d49da91647e02bbe42652e45ef4c270f67259faf9ea38d2703d1f1ea67ed818844fd64e6e16b57a7d069ec265cd7855ed32ec0b84da3
@ghost ghost removed the review label May 1, 2018
@Fuzzbawls Fuzzbawls deleted the 3.1-port branch January 10, 2020 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants