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

[Staking] Prevent potential negative out values during stake splitting #952

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

CaveSpectre11
Copy link

On the rare occasion that a small UTXO wins a stake; and that user has (by lack of understanding, or by error) configured a very small StakeSplitThreshold; they can end up in a situation where their extremely lucky stake win fails at consensus because of the way the stake split is calculated.

The logic split the block reward between the two outputs; along with the input. However if that input is significantly small, and the block reward is significantly weighted to the masternode; then the potential for a negative (and thus very very large) output would be created in the second side of the split. This is due to the fact that the full masternode reward is taken out of the "previous" output (vout[i - 1]).

This is a rare, if not relatively impossible, scenario with PIVX at it's current state, but the potential grows much larger when coin parameters are re-arranged; e.g. small stakes with a heavy weight onto the masternode reward. i.e. a stake split of 5, with a block reward of 10, and 90% to the masternode. 15 ends up split into vout[1] and vout[2], both receiving 7.5; yet FillBlockPayee will subtract 9 from vout[2]; resulting in a negative wrapped to a large positive.

This logic simply puts the reward that will be deducted from into the second vout. So with the above numbers; vout[1] is split to 2.5, vout[2] is initially 12.5 and then after the unknown (at that time) masternode fee of 9, is reduced to 3.5; no longer going negative.

Of course this is an extreme example; but the potential still exists.

Alternatively, restrictions could be placed on setstakesplitthreshold to prevent the user from setting a threshold dangerously low; or a minstake could be setup to prevent a stake small enough to be a problem from being considered. However, this seems like the best solution to the problem; by handling it without adding a lot of logic to collect the chain parameters and set limits that make sense to whatever chosen configuration is used.

@random-zebra
Copy link

Concept ACK. Nice find!
However, with this fix the stake wouldn't be equally split between the outputs (the staker reward would be added only to the last one).
I wonder if it wouldn't make more sense to, instead, subtract the masternode payout "equally" (except for a reminder) from all coinstake outputs.

Something like this in CMasternodePayments::FillBlockPayee maybe?

//subtract mn payment from the stake reward
if (i > 2) {
    // stake has been split in (i-1) outputs
    CAmount quotient = masternodePayment / (i-1);
    CAmount reminder = masternodePayment - quotient * (i-1);
    for(unsigned int j=1; j<i; j++)
        txNew.vout[j].nValue -= quotient;
    txNew.vout[i-1].nValue -= reminder;

} else {
    txNew.vout[1].nValue -= masternodePayment;
}

@CaveSpectre11
Copy link
Author

Something like this in CMasternodePayments::FillBlockPayee maybe?

Yea, I like that idea. Actually brings up an interesting question; since the FillBlockPayee logic is setup to handle an unknown number of outputs; whereas the CreateCoinStake() is specifically if outputs == 3 (a split into two outputs. So in this situation it doesn't -need- to handle more than distributing between the two.

However, the logic you describe leaves code that functionally will work; and won't require changes if we ever decide to have CreateTxOuts check how many multiples of nStakeSplitThreshold nTotal is, and add an output to split respectively (ok, now my mind is churning, I'll look at that this weekend. e.g. staking 10k w/ 2k threshold would result in ten 1k outputs, 9999 w/ 2k would result in nine 1111 outputs, etc)

@random-zebra
Copy link

Actually It's not even needed to use a conditional there.
As when i == 2 we have quotient = masternodePayment and reminder = 0.

@CaveSpectre11
Copy link
Author

Actually It's not even needed to use a conditional there.
As when i == 2 we have quotient = masternodePayment and reminder = 0.

True; although the underlying efficiency process in my head sees the division and I would opt for the conditional to fast path the majority of the callers; sending only those that need special processing (those being split) into the mathematical slow path.

@CaveSpectre11 CaveSpectre11 force-pushed the StakeSplit branch 2 times, most recently from f120d09 to afad193 Compare July 17, 2019 01:21
@CaveSpectre11
Copy link
Author

CaveSpectre11 commented Jul 17, 2019

Logic moved to FillBlockPayee() to get an even split across all the outputs (per @random-zebra suggestion). A few things to note:

  1. While the common path (one output) could be run through the split scheme, with the division being by one, no remainder, and the for loop passed one time; that's an order of magnitude work added to the common path. By differentiating, the most common case only has one conditional added, rather than all the extra logic for the split case.
  2. CreateTxOuts() currently only splits into two outputs, but the logic in FillBlockPayee() supports any number of outputs. Rather than restricting FillBlockPayee() to the limitation of CreateTxOuts(), the "any number of outputs" logic is preserved, for the future potential of changing CreateTxOuts() to split into several outputs (splitting once, rather than repetitive halving).

@CaveSpectre11
Copy link
Author

Split off additional change to #967 & rebased

@CaveSpectre11 CaveSpectre11 changed the title [Minting] Prevent potential negative out values during stake splitting [Staking] Prevent potential negative out values during stake splitting Jul 30, 2019
Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Community Developer Contributions automation moved this from In progress to Reviewer approved Aug 3, 2019
Copy link

@Warrows Warrows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 139d333

Copy link

@Mrs-X Mrs-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 139d333 and merging...

@Mrs-X Mrs-X merged commit 139d333 into PIVX-Project:master Aug 5, 2019
Community Developer Contributions automation moved this from Reviewer approved to Accepted Aug 5, 2019
Mrs-X added a commit that referenced this pull request Aug 5, 2019
…ake splitting

139d333 Minting: Prevent potential negative out values (Cave Spectre)

Pull request description:

  On the rare occasion that a small UTXO wins a stake; and that user has (by lack of understanding, or by error) configured a very small StakeSplitThreshold; they can end up in a situation where their extremely lucky stake win fails at consensus because of the way the stake split is calculated.

  The logic split the block reward between the two outputs; along with the input.  However if that input is significantly small, and the block reward is significantly weighted to the masternode; then the potential for a negative (and thus very very large) output would be created in the second side of the split.  This is due to the fact that the full masternode reward is taken out of the "previous" output (`vout[i - 1]`).

  This is a rare, if not relatively impossible, scenario with PIVX at it's current state, but the potential grows much larger when coin parameters are re-arranged; e.g. small stakes with a heavy weight onto the masternode reward.  i.e. a stake split of 5, with a block reward of 10, and 90% to the masternode.   15 ends up split into vout[1] and vout[2], both receiving 7.5; yet FillBlockPayee will subtract 9 from vout[2]; resulting in a negative wrapped to a large positive.

  This logic simply puts the reward that will be deducted from into the second vout.  So with the above numbers; vout[1] is split to 2.5, vout[2] is initially 12.5 and then after the unknown (at that time) masternode fee of 9, is reduced to 3.5; no longer going negative.

  Of course this is an extreme example; but the potential still exists.

  Alternatively, restrictions could be placed on setstakesplitthreshold to prevent the user from setting a threshold dangerously low; or a minstake could be setup to prevent a stake small enough to be a problem from being considered.  However, this seems like the best solution to the problem; by handling it without adding a lot of logic to collect the chain parameters and set limits that make sense to whatever chosen configuration is used.

ACKs for top commit:
  random-zebra:
    ACK 139d333
  Warrows:
    utACK 139d333
  Mrs-X:
    utACK 139d333 and merging...

Tree-SHA512: 2b8b91adeb5b5f053e60087f3f3b350228491a6be4970180d68475c11610f95fa62fb9e2583f8fff7e7b567fec3d2105ffa48246cc4addb3914cfb37ee3e312d
@CaveSpectre11 CaveSpectre11 deleted the StakeSplit branch August 9, 2019 01:21
@Fuzzbawls Fuzzbawls added the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Aug 16, 2019
@random-zebra random-zebra modified the milestones: 4.0.0, 3.4.0 Aug 25, 2019
@Fuzzbawls Fuzzbawls added Block Generation Mining/Staking related issues and removed Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes labels Aug 26, 2019
random-zebra added a commit that referenced this pull request Sep 17, 2019
…output splitting

2e41db5 [Staking] Revise stakesplit to multi-split (Cave Spectre)

Pull request description:

  ### **Release notes**
  - [Staking] Staking inputs are now split into 2 or more outputs based on the stake split threshold

  ### **Note**
  For ease of rebasing; and for cleaner testing; this PR is built on top of PR #952 and will need adjustments if PR #952 has changes.

  ### **Background**
  The common function of `stakesplitthreshold` is to break a stake that has grown large into two outputs, splitting them in half.  It is assumed the size of the split is based on the users amount of coins they are staking, and they desire their staking UTXOs to be sized between their stake split threshold and 2 times that stake split threshold.

  This design falters when a stake UTXO is a multiple of the stake split threshold; causing repetitive halving until all outputs reach below twice the stake split threshold.

  For example, with a stake split threshold of 2000; a UTXO will grow until it hits 4000 coins, at which point it will split to 2000 coins.  However if the UTXO was 10,000 coins; it would split to two 5000 coin UTXOs, which would then split on the next stake for each of them; to 2500 coins.

  This becomes more problematic when considering the impact to the coin owners staking odds.  After a split; the coins will not stake until they mature.  So when that 10k splits into two 5k blocks, they won't stake for another 101 transactions.   After 101 transactions, the 10k is now being staked, until the next split; at which point only 5k is staking for the next 101 transactions.

  This issue comes up in a variety of scenarios;  A large transaction from an exchange or a payment received, Unlocking a masternode for staking, auto combine rewards (especially with PR #953) sweeping up a lot of dust bunnies into a big UTXO; just to name a few.

  ### **Multi-Split**
  Multi-Split will now use the stake split threshold to determine how many multiples of the threshold is contained in the input transaction; and split accordingly.  In the theoretical example above; that first stake of 10k will now be split into 5 outputs of 2000.4.  When one of those outputs receives a stake, instead of only the other 5k being staked for the 101 transactions to maturity; now 8k will remain staked for the maturity period of the UTXO (post split) being unavailable for staking.

  For a real example, with a stake split threshold of 1500, and a UTXO of 4708.1557; the current stake split algorithm would break that into two outputs of approximately 2355.07785.  With this new logic; it will be broken into 3 outputs instead of two; each sized 1570.0519 (4708.1557 input + 2 stake = 4710.1557 / 3 outputs = 1570.0519.

  _See this test transaction in [testnet block 1171496](https://testnet.pivx.link/block/1171496)_

  In order to limit the potential size growth of the staking transaction; the number of splits is limited.  This limit is a calculation based on the MAX_STANDARD_TX_SIZE, and is meant to limit the staking transaction to less than 10% of that size.  With an assumed per vout size of 190, rounded up, and converted to a bit shift for speed; MAX_STANDARD_TX_SIZE is shifted right 11 bits.  In simpler math:
   The limit is effectively MAX_STANDARD_TX_SIZE divided by 2048, creating a maximum limit of outputs for the stake split to 48 (with the current MAX_STANDARD_TX_SIZE of 100k).

  An example of this test can be seen in [testblock 1171785](https://testnet.pivx.link/block/1171785), where a UTXO of 13114.83882369 coins was used for a stake; and the stake split threshold was set to 100.  The logic would have split this into 131 outputs of 131.116 and change, however the maximum threshold is reached, and thus it is split into 47 outputs of 273.26747549, with the 48th output having the .17 uPiv remainder added and resulting in that final output of 273.26747566.

  As the stake splitting is contained within the wallet software itself; there is **no protocol change with this PR**; the consensus is already built to look at the last vout for the masternode payment, and look at the total value of a variable number of outputs to confirm that an overmint is not occurring.

ACKs for top commit:
  random-zebra:
    ACK 2e41db5
  Fuzzbawls:
    utACK 2e41db5
  furszy:
    utACK [2e41db5](2e41db5)

Tree-SHA512: 35f612a5042de964bd3fda040ff2e3ea24de81300ecdc7d9d322757471df45cc4c7cb3d7905554ec41b607bb8364a94ced372c93ac7963c7729653d88cf32765
2a5A1Ghu1 added a commit to theohmproject/ohmcoin that referenced this pull request Oct 28, 2020
* Ohmcoin 3.0 (#63)

* Fix croscompile for win32

* Update Segwit and Zerocoin (#47)

* Added all of the code for the update

* Fix URL Path

* Fixed default directory path

* Change masternode declarations to karmanode

* change to ohmcoin

* Create .gitignore

* Update .gitignore

* Update .gitignore

* karmanodefy

* Update proposallist.cpp

* Missing class

* Docs Masternode to karmanode

* Change mn(masternode) to kn(karmanode)

* Update doc and comment collateral

* More doc updates

* Fixed Karmanode references in proposal related files.

* Ckarmanode -> CKarmanode

* Karmanodefy Budget System

* Porotocol and Version Bump

* Protocol Enforcement

* Fix typo

* Spork fixes

* Fix Spork Typo

* Develop (#48)

* Added all of the code for the update

* Fix URL Path

* Fixed default directory path

* Change masternode declarations to karmanode

* change to ohmcoin

* Create .gitignore

* Update .gitignore

* Update .gitignore

* karmanodefy

* Update proposallist.cpp

* Missing class

* Docs Masternode to karmanode

* Change mn(masternode) to kn(karmanode)

* Update doc and comment collateral

* More doc updates

* Fixed Karmanode references in proposal related files.

* Ckarmanode -> CKarmanode

* Karmanodefy Budget System

* Porotocol and Version Bump

* Protocol Enforcement

* Fix typo

* Spork fixes

* Update README.md

* Fixes issues when building in 10.15

This will need to be built against different brew formulas that will be provided on release... This is also a temporary solution once fixes are made for building against updated dependencies.

* Qt Frontend Performace

Limits amount of txs loaded

* Added Qt Dependencies for Cross Compile

* Update spork.h

* [Qt][Bug] Load the most recent instead of the first transactions

PIVX-Project/PIVX@ec72107

* Fix QT and Boost bugs

phoreproject/Phore#140

* Update Seeders

* Update Budget and Regtest

* More Budget and Regtest

* Too Expressive

removed arrant parenthesis

* Added select coin strategy

phoreproject/Phore@5928d0b

* allow openssl1.0/1.1 to coexist

phoreproject/Phore@d1b6037

* Prevent RPC calls during warmup

* Changed for loop copies to references, and added stake logging

phoreproject/Phore@3e7f6cf

* Fixed masternode edit deleting two masternodes in list

* Fix staking assertion

phoreproject/Phore@0a6a243

* Added Python test for transaction too large issue

phoreproject/Phore@5b08df9

* Added benchmark in mutex lock

phoreproject/Phore@be2f913

* Fix bugs in mnemonic selection and mint maturity

phoreproject/Phore@c118242

* Revert "Fix bugs in mnemonic selection and mint maturity"

This reverts commit 2f242b0.

* Replaced mapNextTx with smaller map to reduce memory usage.

phoreproject/Phore@3a7c813

* Move ThreadStakeMinter out of net.cpp

phoreproject/Phore@5568806

* Revert "Changed for loop copies to references, and added stake logging"

This reverts commit 113aeea.

* Add missing QPainterPath include

PIVX-Project/PIVX@2e226ad

* Lighter Icons

* Update Checkpoints

* Switch Sporks

* Update Placeholder Address

* Ohmify

* Merge Block Changes (#56)

* Version 3.0.0.1 dev (#53)

* Version 3.0.0.1 dev
- Increase time between blocks at block 2977924 or when network has reached 95% upgrade threshold
- Change block time to 4 minutes
- Set  block reward to 6 on activation of new time
- Adjust new block enforce policy to 24 hour span

* fix flag check for; add fIgnoreLegacyBlocks

* move variable out of if statement, fix compile.

* Improve2 (#54)

* WIP: upgrade network upgrade features; testnet fixes..

* add this back for now..

* add missed file, optional.h

* more imports

* adjust imports for consensus.h

* correction

* fix moar missing imports

* add missing vars and fixes

* missing header declare

* changes..

* update makefile

* need this here too..

* fixed compile

* further fixed.

* Zerocoin is not active; Actually use new block version parameter..

* Don't do this, zerocoin not active..

* remove or fix zerocoin at some later point.

* zerocoin is off.

* Adjust new block version update to use protocol version
Prepare for removal of zercoin; refactoring..
Implement sporks to enforce new version lock ins.

* fix compile issues

* get height for tip

* get consensus params

* add missing spork info

* Version 3.0.2.0

* Fixes Wallet Lock Issue (#55)

* Fix block height condition

* Combine Spork 24 into 23

Co-authored-by: Ra's Al Ghul <contact@ohmcoin.org>
Co-authored-by: squidicuz <squid@sqdmc.net>

* [REST] improve performance for JSON calls

bitcoin/bitcoin@30973e9

JSON calls do not use the raw data generated for
the .bin and .hex calls. By moving the raw data
creation into the .bin and .hex switch branches,
JSON calls become faster.

* Bump Version

* [Model][Performance] Unnecessary double cs_wallet and cs_main lock.

PIVX-Project/PIVX@9d94ea6

* Delete pkg.m4

Delete arrant pkg.m4 file never was needed

* Update Mac version

* Drop QT4 Support

* [BUILD][MacOS] Make Clean Images

* [Refactor][Move Only] Nonwallet RPC Move to Sub-Dir

* [Refactor][Move Only] Wallet Move to Sub-Dir

* Add Memusage

* [REFACTOR] Drop BOOST_FOREACH/REVERSE_FOREACH

* [REFACTOR] Move PAIRTYPE to std::pair & Q_FOREACH/foreach to for

* [LEVELDB]Use std::atomic instead of MemoryBarrier

* Update Copyright

* [Tests] Fix chain ordering in budget tests

PIVX-Project/PIVX#595

* [Doc] Change aarch assert sign output folder

PIVX-Project/PIVX#585

* [Wallet] Adjust staking properties to lower orphan rates.

PIVX-Project/PIVX#617

* [Wallet] Write new transactions to wtxOrdered properly

PIVX-Project/PIVX#597

* [Travis] Add separate job to check doc/logprint/subtree

Further getting up to date with pivx PIVX-Project/PIVX#639

* [Build] Make sure Boost headers are included for libzerocoin

PIVX-Project/PIVX#622

* [Build] Remove unnecessary BOOST dependency

PIVX-Project/PIVX#605

* [Bug] Fix CKarmanodeConfig::read

rebase from upstream. Windows doesn't initialize CService properly
during startup before the masternode.conf file is read.

PIVX-Project/PIVX@9837f53

* Add getaccumulatorvalues RPC

Return the accumulator values associated with a particular block height.

PIVX-Project/PIVX@8a6d425

* [GUI] Fix wrongly displayed balance on Overview tab

PIVX-Project/PIVX#598

* [Wallet] Fix double locked coin when wallet and MN are on same machine

PIVX-Project/PIVX#656

* [Qt] Add Tor service icon to status bar

Tor Icon is displayed when the client is initialized with a successful
tor service connection.

Icon is hidden otherwise.

PIVX-Project/PIVX@f9e18aa

* [Staking] Prevent potential negative out values during stake splitting

PIVX-Project/PIVX#952

* [QT] Set AA_EnableHighDpiScaling attribute early

Set AA_EnableHighDpiScaling attribute early

bitcoin/bitcoin@099e4b9

* [BUILD] Update bitcoin_qt.m4

* [QT] clean up initialize/shutdown signals

qt: clean up initialize/shutdown signals

 - Change initializeResult(int) to initializeResult(bool) to avoid
   implicit type conversion.
 - Use EXIT_FAILURE and EXIT_SUCCESS instead of magic numbers.
 - Remove the argument from shutdownResult(int); it was called with a
   constant argument.

bitcoin/bitcoin#9834

* [Refactor] Set to nullptr after delete

bitcoin/bitcoin#10027

* [Main] Unify shutdown proceedure in init rather than per-app

and

[Startup][Refactor][Backport] Memory allocation fail handler + init step 1 refactored.

PIVX-Project/PIVX#1029

PIVX-Project/PIVX#769

* [GUI] Make "For anonymization and staking only" checked by default

PIVX-Project/PIVX#521

* [Trivial] Remove CMasternode::SliceHash

PIVX-Project/PIVX#1513

* [REST] improve performance for JSON calls

bitcoin/bitcoin@30973e9

JSON calls do not use the raw data generated for
the .bin and .hex calls. By moving the raw data
creation into the .bin and .hex switch branches,
JSON calls become faster.

* Bump Version

* [Model][Performance] Unnecessary double cs_wallet and cs_main lock.

PIVX-Project/PIVX@9d94ea6

* Delete pkg.m4

Delete arrant pkg.m4 file never was needed

* Update Mac version

* Drop QT4 Support

* [BUILD][MacOS] Make Clean Images

* [Refactor][Move Only] Nonwallet RPC Move to Sub-Dir

* [Refactor][Move Only] Wallet Move to Sub-Dir

* Add Memusage

* [REFACTOR] Drop BOOST_FOREACH/REVERSE_FOREACH

* [REFACTOR] Move PAIRTYPE to std::pair & Q_FOREACH/foreach to for

* [LEVELDB]Use std::atomic instead of MemoryBarrier

* Update Copyright

* [Tests] Fix chain ordering in budget tests

PIVX-Project/PIVX#595

* [Doc] Change aarch assert sign output folder

PIVX-Project/PIVX#585

* [Wallet] Adjust staking properties to lower orphan rates.

PIVX-Project/PIVX#617

* [Wallet] Write new transactions to wtxOrdered properly

PIVX-Project/PIVX#597

* [Travis] Add separate job to check doc/logprint/subtree

Further getting up to date with pivx PIVX-Project/PIVX#639

* [Build] Make sure Boost headers are included for libzerocoin

PIVX-Project/PIVX#622

* [Build] Remove unnecessary BOOST dependency

PIVX-Project/PIVX#605

* [Bug] Fix CKarmanodeConfig::read

rebase from upstream. Windows doesn't initialize CService properly
during startup before the masternode.conf file is read.

PIVX-Project/PIVX@9837f53

* Add getaccumulatorvalues RPC

Return the accumulator values associated with a particular block height.

PIVX-Project/PIVX@8a6d425

* [GUI] Fix wrongly displayed balance on Overview tab

PIVX-Project/PIVX#598

* [Wallet] Fix double locked coin when wallet and MN are on same machine

PIVX-Project/PIVX#656

* [Qt] Add Tor service icon to status bar

Tor Icon is displayed when the client is initialized with a successful
tor service connection.

Icon is hidden otherwise.

PIVX-Project/PIVX@f9e18aa

* [Staking] Prevent potential negative out values during stake splitting

PIVX-Project/PIVX#952

* [QT] Set AA_EnableHighDpiScaling attribute early

Set AA_EnableHighDpiScaling attribute early

bitcoin/bitcoin@099e4b9

* [BUILD] Update bitcoin_qt.m4

* [QT] clean up initialize/shutdown signals

qt: clean up initialize/shutdown signals

 - Change initializeResult(int) to initializeResult(bool) to avoid
   implicit type conversion.
 - Use EXIT_FAILURE and EXIT_SUCCESS instead of magic numbers.
 - Remove the argument from shutdownResult(int); it was called with a
   constant argument.

bitcoin/bitcoin#9834

* [Refactor] Set to nullptr after delete

bitcoin/bitcoin#10027

* [Main] Unify shutdown proceedure in init rather than per-app

and

[Startup][Refactor][Backport] Memory allocation fail handler + init step 1 refactored.

PIVX-Project/PIVX#1029

PIVX-Project/PIVX#769

* [GUI] Make "For anonymization and staking only" checked by default

PIVX-Project/PIVX#521

* [Trivial] Remove CMasternode::SliceHash

PIVX-Project/PIVX#1513

Co-authored-by: Crypto Pliskin <13294167+2a5A1Ghu1@users.noreply.github.com>
Co-authored-by: Ra's Al Ghul <contact@ohmcoin.org>
2a5A1Ghu1 added a commit to theohmproject/ohmcoin that referenced this pull request Oct 28, 2020
* Fix croscompile for win32

* Update Segwit and Zerocoin (#47)

* Added all of the code for the update

* Fix URL Path

* Fixed default directory path

* Change masternode declarations to karmanode

* change to ohmcoin

* Create .gitignore

* Update .gitignore

* Update .gitignore

* karmanodefy

* Update proposallist.cpp

* Missing class

* Docs Masternode to karmanode

* Change mn(masternode) to kn(karmanode)

* Update doc and comment collateral

* More doc updates

* Fixed Karmanode references in proposal related files.

* Ckarmanode -> CKarmanode

* Karmanodefy Budget System

* Porotocol and Version Bump

* Protocol Enforcement

* Fix typo

* Spork fixes

* Fix Spork Typo

* Develop (#48)

* Added all of the code for the update

* Fix URL Path

* Fixed default directory path

* Change masternode declarations to karmanode

* change to ohmcoin

* Create .gitignore

* Update .gitignore

* Update .gitignore

* karmanodefy

* Update proposallist.cpp

* Missing class

* Docs Masternode to karmanode

* Change mn(masternode) to kn(karmanode)

* Update doc and comment collateral

* More doc updates

* Fixed Karmanode references in proposal related files.

* Ckarmanode -> CKarmanode

* Karmanodefy Budget System

* Porotocol and Version Bump

* Protocol Enforcement

* Fix typo

* Spork fixes

* Update README.md

* Fixes issues when building in 10.15

This will need to be built against different brew formulas that will be provided on release... This is also a temporary solution once fixes are made for building against updated dependencies.

* Qt Frontend Performace

Limits amount of txs loaded

* Added Qt Dependencies for Cross Compile

* Update spork.h

* [Qt][Bug] Load the most recent instead of the first transactions

PIVX-Project/PIVX@ec72107

* Fix QT and Boost bugs

phoreproject/Phore#140

* Update Seeders

* Update Budget and Regtest

* More Budget and Regtest

* Too Expressive

removed arrant paranthesis

* Added select coin strategy

phoreproject/Phore@5928d0b

* allow openssl1.0/1.1 to coexist

phoreproject/Phore@d1b6037

* Prevent RPC calls during warmup

* Changed for loop copies to references, and added stake logging

phoreproject/Phore@3e7f6cf

* Fixed masternode edit deleting two masternodes in list

* Fix staking assertion

phoreproject/Phore@0a6a243

* Added Python test for transaction too large issue

phoreproject/Phore@5b08df9

* Added benchmark in mutex lock

phoreproject/Phore@be2f913

* Fix bugs in mnemonic selection and mint maturity

phoreproject/Phore@c118242

* Revert "Fix bugs in mnemonic selection and mint maturity"

This reverts commit 2f242b0.

* Replaced mapNextTx with smaller map to reduce memory usage.

phoreproject/Phore@3a7c813

* Move ThreadStakeMinter out of net.cpp

phoreproject/Phore@5568806

* Revert "Changed for loop copies to references, and added stake logging"

This reverts commit 113aeea.

* Add missing QPainterPath include

PIVX-Project/PIVX@2e226ad

* Lighter Icons

* Update Checkpoints

* Switch Sporks

* Update Placeholder Address

* Ohmify

* Merge Block Changes (#56)

* Version 3.0.0.1 dev (#53)

* Version 3.0.0.1 dev
- Increase time between blocks at block 2977924 or when network has reached 95% upgrade threshold
- Change block time to 4 minutes
- Set  block reward to 6 on activation of new time
- Adjust new block enforce policy to 24 hour span

* fix flag check for; add fIgnoreLegacyBlocks

* move variable out of if statement, fix compile.

* Improve2 (#54)

* WIP: upgrade network upgrade features; testnet fixes..

* add this back for now..

* add missed file, optional.h

* more imports

* adjust imports for consensus.h

* correction

* fix moar missing imports

* add missing vars and fixes

* missing header declare

* changes..

* update makefile

* need this here too..

* fixed compile

* further fixed.

Co-authored-by: Jon <squid@sqdmc.net>

* Zerocoin is not active; Actually use new block version parameter..

* Don't do this, zerocoin not active..

* remove or fix zerocoin at some later point.

* zerocoin is off.

* Adjust new block version update to use protocol version
Prepare for removal of zercoin; refactoring..
Implement sporks to enforce new version lock ins.

* fix compile issues

* get height for tip

* get consensus params

* add missing spork info

* Version 3.0.2.0

Co-authored-by: Crypto Pliskin <13294167+2a5A1Ghu1@users.noreply.github.com>

* Fixes Wallet Lock Issue (#55)

* Fix block height condition

* Combine Spork 24 into 23

Co-authored-by: squidicuz <squid@sqdmc.net>

* [REST] improve performance for JSON calls

bitcoin/bitcoin@30973e9

JSON calls do not use the raw data generated for
the .bin and .hex calls. By moving the raw data
creation into the .bin and .hex switch branches,
JSON calls become faster.

* Bump Version

* [Model][Performance] Unnecessary double cs_wallet and cs_main lock.

PIVX-Project/PIVX@9d94ea6

* Delete pkg.m4

Delete arrant pkg.m4 file never was needed

* Update Mac version

* Drop QT4 Support

* [BUILD][MacOS] Make Clean Images

* [Refactor][Move Only] Nonwallet RPC Move to Sub-Dir

* [Refactor][Move Only] Wallet Move to Sub-Dir

* Add Memusage

* [REFACTOR] Drop BOOST_FOREACH/REVERSE_FOREACH

* [REFACTOR] Move PAIRTYPE to std::pair & Q_FOREACH/foreach to for

* [LEVELDB]Use std::atomic instead of MemoryBarrier

* Update Copyright

* [Tests] Fix chain ordering in budget tests

PIVX-Project/PIVX#595

* [Doc] Change aarch assert sign output folder

PIVX-Project/PIVX#585

* [Wallet] Adjust staking properties to lower orphan rates.

PIVX-Project/PIVX#617

* [Wallet] Write new transactions to wtxOrdered properly

PIVX-Project/PIVX#597

* [Travis] Add separate job to check doc/logprint/subtree

Further getting up to date with pivx PIVX-Project/PIVX#639

* [Build] Make sure Boost headers are included for libzerocoin

PIVX-Project/PIVX#622

* [Build] Remove unnecessary BOOST dependency

PIVX-Project/PIVX#605

* [Bug] Fix CKarmanodeConfig::read

rebase from upstream. Windows doesn't initialize CService properly
during startup before the masternode.conf file is read.

PIVX-Project/PIVX@9837f53

* Add getaccumulatorvalues RPC

Return the accumulator values associated with a particular block height.

PIVX-Project/PIVX@8a6d425

* [GUI] Fix wrongly displayed balance on Overview tab

PIVX-Project/PIVX#598

* [Wallet] Fix double locked coin when wallet and MN are on same machine

PIVX-Project/PIVX#656

* [Qt] Add Tor service icon to status bar

Tor Icon is displayed when the client is initialized with a successful
tor service connection.

Icon is hidden otherwise.

PIVX-Project/PIVX@f9e18aa

* [Staking] Prevent potential negative out values during stake splitting

PIVX-Project/PIVX#952

* [QT] Set AA_EnableHighDpiScaling attribute early

Set AA_EnableHighDpiScaling attribute early

bitcoin/bitcoin@099e4b9

* [BUILD] Update bitcoin_qt.m4

* [QT] clean up initialize/shutdown signals

qt: clean up initialize/shutdown signals

 - Change initializeResult(int) to initializeResult(bool) to avoid
   implicit type conversion.
 - Use EXIT_FAILURE and EXIT_SUCCESS instead of magic numbers.
 - Remove the argument from shutdownResult(int); it was called with a
   constant argument.

bitcoin/bitcoin#9834

* [Refactor] Set to nullptr after delete

bitcoin/bitcoin#10027

* [Main] Unify shutdown proceedure in init rather than per-app

and

[Startup][Refactor][Backport] Memory allocation fail handler + init step 1 refactored.

PIVX-Project/PIVX#1029

PIVX-Project/PIVX#769

* [GUI] Make "For anonymization and staking only" checked by default

PIVX-Project/PIVX#521

* [Trivial] Remove CMasternode::SliceHash

PIVX-Project/PIVX#1513

* [REST] improve performance for JSON calls

bitcoin/bitcoin@30973e9

JSON calls do not use the raw data generated for
the .bin and .hex calls. By moving the raw data
creation into the .bin and .hex switch branches,
JSON calls become faster.

* Bump Version

* [Model][Performance] Unnecessary double cs_wallet and cs_main lock.

PIVX-Project/PIVX@9d94ea6

* Delete pkg.m4

Delete arrant pkg.m4 file never was needed

* Update Mac version

* Drop QT4 Support

* [BUILD][MacOS] Make Clean Images

* [Refactor][Move Only] Nonwallet RPC Move to Sub-Dir

* [Refactor][Move Only] Wallet Move to Sub-Dir

* Add Memusage

* [REFACTOR] Drop BOOST_FOREACH/REVERSE_FOREACH

* [REFACTOR] Move PAIRTYPE to std::pair & Q_FOREACH/foreach to for

* [LEVELDB]Use std::atomic instead of MemoryBarrier

* Update Copyright

* [Tests] Fix chain ordering in budget tests

PIVX-Project/PIVX#595

* [Doc] Change aarch assert sign output folder

PIVX-Project/PIVX#585

* [Wallet] Adjust staking properties to lower orphan rates.

PIVX-Project/PIVX#617

* [Wallet] Write new transactions to wtxOrdered properly

PIVX-Project/PIVX#597

* [Travis] Add separate job to check doc/logprint/subtree

Further getting up to date with pivx PIVX-Project/PIVX#639

* [Build] Make sure Boost headers are included for libzerocoin

PIVX-Project/PIVX#622

* [Build] Remove unnecessary BOOST dependency

PIVX-Project/PIVX#605

* [Bug] Fix CKarmanodeConfig::read

rebase from upstream. Windows doesn't initialize CService properly
during startup before the masternode.conf file is read.

PIVX-Project/PIVX@9837f53

* Add getaccumulatorvalues RPC

Return the accumulator values associated with a particular block height.

PIVX-Project/PIVX@8a6d425

* [GUI] Fix wrongly displayed balance on Overview tab

PIVX-Project/PIVX#598

* [Wallet] Fix double locked coin when wallet and MN are on same machine

PIVX-Project/PIVX#656

* [Qt] Add Tor service icon to status bar

Tor Icon is displayed when the client is initialized with a successful
tor service connection.

Icon is hidden otherwise.

PIVX-Project/PIVX@f9e18aa

* [Staking] Prevent potential negative out values during stake splitting

PIVX-Project/PIVX#952

* [QT] Set AA_EnableHighDpiScaling attribute early

Set AA_EnableHighDpiScaling attribute early

bitcoin/bitcoin@099e4b9

* [BUILD] Update bitcoin_qt.m4

* [QT] clean up initialize/shutdown signals

qt: clean up initialize/shutdown signals

 - Change initializeResult(int) to initializeResult(bool) to avoid
   implicit type conversion.
 - Use EXIT_FAILURE and EXIT_SUCCESS instead of magic numbers.
 - Remove the argument from shutdownResult(int); it was called with a
   constant argument.

bitcoin/bitcoin#9834

* [Refactor] Set to nullptr after delete

bitcoin/bitcoin#10027

* [Main] Unify shutdown proceedure in init rather than per-app

and

[Startup][Refactor][Backport] Memory allocation fail handler + init step 1 refactored.

PIVX-Project/PIVX#1029

PIVX-Project/PIVX#769

* [GUI] Make "For anonymization and staking only" checked by default

PIVX-Project/PIVX#521

* [Trivial] Remove CMasternode::SliceHash

PIVX-Project/PIVX#1513

Co-authored-by: Ra's Al Ghul <buddilla@users.noreply.github.com>
Co-authored-by: Andrew LaChasse <buddilla@buddillalappy.local>
Co-authored-by: squidicuz <squid@sqdmc.net>
2a5A1Ghu1 added a commit to theohmproject/ohmcoin that referenced this pull request Nov 2, 2020
* Ohmcoin performance Updates (#70)

* Fix croscompile for win32

* Update Segwit and Zerocoin (#47)

* Added all of the code for the update

* Fix URL Path

* Fixed default directory path

* Change masternode declarations to karmanode

* change to ohmcoin

* Create .gitignore

* Update .gitignore

* Update .gitignore

* karmanodefy

* Update proposallist.cpp

* Missing class

* Docs Masternode to karmanode

* Change mn(masternode) to kn(karmanode)

* Update doc and comment collateral

* More doc updates

* Fixed Karmanode references in proposal related files.

* Ckarmanode -> CKarmanode

* Karmanodefy Budget System

* Porotocol and Version Bump

* Protocol Enforcement

* Fix typo

* Spork fixes

* Fix Spork Typo

* Develop (#48)

* Added all of the code for the update

* Fix URL Path

* Fixed default directory path

* Change masternode declarations to karmanode

* change to ohmcoin

* Create .gitignore

* Update .gitignore

* Update .gitignore

* karmanodefy

* Update proposallist.cpp

* Missing class

* Docs Masternode to karmanode

* Change mn(masternode) to kn(karmanode)

* Update doc and comment collateral

* More doc updates

* Fixed Karmanode references in proposal related files.

* Ckarmanode -> CKarmanode

* Karmanodefy Budget System

* Porotocol and Version Bump

* Protocol Enforcement

* Fix typo

* Spork fixes

* Update README.md

* Fixes issues when building in 10.15

This will need to be built against different brew formulas that will be provided on release... This is also a temporary solution once fixes are made for building against updated dependencies.

* Qt Frontend Performace

Limits amount of txs loaded

* Added Qt Dependencies for Cross Compile

* Update spork.h

* [Qt][Bug] Load the most recent instead of the first transactions

PIVX-Project/PIVX@ec72107

* Fix QT and Boost bugs

phoreproject/Phore#140

* Update Seeders

* Update Budget and Regtest

* More Budget and Regtest

* Too Expressive

removed arrant paranthesis

* Added select coin strategy

phoreproject/Phore@5928d0b

* allow openssl1.0/1.1 to coexist

phoreproject/Phore@d1b6037

* Prevent RPC calls during warmup

* Changed for loop copies to references, and added stake logging

phoreproject/Phore@3e7f6cf

* Fixed masternode edit deleting two masternodes in list

* Fix staking assertion

phoreproject/Phore@0a6a243

* Added Python test for transaction too large issue

phoreproject/Phore@5b08df9

* Added benchmark in mutex lock

phoreproject/Phore@be2f913

* Fix bugs in mnemonic selection and mint maturity

phoreproject/Phore@c118242

* Revert "Fix bugs in mnemonic selection and mint maturity"

This reverts commit 2f242b0.

* Replaced mapNextTx with smaller map to reduce memory usage.

phoreproject/Phore@3a7c813

* Move ThreadStakeMinter out of net.cpp

phoreproject/Phore@5568806

* Revert "Changed for loop copies to references, and added stake logging"

This reverts commit 113aeea.

* Add missing QPainterPath include

PIVX-Project/PIVX@2e226ad

* Lighter Icons

* Update Checkpoints

* Switch Sporks

* Update Placeholder Address

* Ohmify

* Merge Block Changes (#56)

* Version 3.0.0.1 dev (#53)

* Version 3.0.0.1 dev
- Increase time between blocks at block 2977924 or when network has reached 95% upgrade threshold
- Change block time to 4 minutes
- Set  block reward to 6 on activation of new time
- Adjust new block enforce policy to 24 hour span

* fix flag check for; add fIgnoreLegacyBlocks

* move variable out of if statement, fix compile.

* Improve2 (#54)

* WIP: upgrade network upgrade features; testnet fixes..

* add this back for now..

* add missed file, optional.h

* more imports

* adjust imports for consensus.h

* correction

* fix moar missing imports

* add missing vars and fixes

* missing header declare

* changes..

* update makefile

* need this here too..

* fixed compile

* further fixed.

Co-authored-by: Jon <squid@sqdmc.net>

* Zerocoin is not active; Actually use new block version parameter..

* Don't do this, zerocoin not active..

* remove or fix zerocoin at some later point.

* zerocoin is off.

* Adjust new block version update to use protocol version
Prepare for removal of zercoin; refactoring..
Implement sporks to enforce new version lock ins.

* fix compile issues

* get height for tip

* get consensus params

* add missing spork info

* Version 3.0.2.0

Co-authored-by: Crypto Pliskin <13294167+2a5A1Ghu1@users.noreply.github.com>

* Fixes Wallet Lock Issue (#55)

* Fix block height condition

* Combine Spork 24 into 23

Co-authored-by: squidicuz <squid@sqdmc.net>

* [REST] improve performance for JSON calls

bitcoin/bitcoin@30973e9

JSON calls do not use the raw data generated for
the .bin and .hex calls. By moving the raw data
creation into the .bin and .hex switch branches,
JSON calls become faster.

* Bump Version

* [Model][Performance] Unnecessary double cs_wallet and cs_main lock.

PIVX-Project/PIVX@9d94ea6

* Delete pkg.m4

Delete arrant pkg.m4 file never was needed

* Update Mac version

* Drop QT4 Support

* [BUILD][MacOS] Make Clean Images

* [Refactor][Move Only] Nonwallet RPC Move to Sub-Dir

* [Refactor][Move Only] Wallet Move to Sub-Dir

* Add Memusage

* [REFACTOR] Drop BOOST_FOREACH/REVERSE_FOREACH

* [REFACTOR] Move PAIRTYPE to std::pair & Q_FOREACH/foreach to for

* [LEVELDB]Use std::atomic instead of MemoryBarrier

* Update Copyright

* [Tests] Fix chain ordering in budget tests

PIVX-Project/PIVX#595

* [Doc] Change aarch assert sign output folder

PIVX-Project/PIVX#585

* [Wallet] Adjust staking properties to lower orphan rates.

PIVX-Project/PIVX#617

* [Wallet] Write new transactions to wtxOrdered properly

PIVX-Project/PIVX#597

* [Travis] Add separate job to check doc/logprint/subtree

Further getting up to date with pivx PIVX-Project/PIVX#639

* [Build] Make sure Boost headers are included for libzerocoin

PIVX-Project/PIVX#622

* [Build] Remove unnecessary BOOST dependency

PIVX-Project/PIVX#605

* [Bug] Fix CKarmanodeConfig::read

rebase from upstream. Windows doesn't initialize CService properly
during startup before the masternode.conf file is read.

PIVX-Project/PIVX@9837f53

* Add getaccumulatorvalues RPC

Return the accumulator values associated with a particular block height.

PIVX-Project/PIVX@8a6d425

* [GUI] Fix wrongly displayed balance on Overview tab

PIVX-Project/PIVX#598

* [Wallet] Fix double locked coin when wallet and MN are on same machine

PIVX-Project/PIVX#656

* [Qt] Add Tor service icon to status bar

Tor Icon is displayed when the client is initialized with a successful
tor service connection.

Icon is hidden otherwise.

PIVX-Project/PIVX@f9e18aa

* [Staking] Prevent potential negative out values during stake splitting

PIVX-Project/PIVX#952

* [QT] Set AA_EnableHighDpiScaling attribute early

Set AA_EnableHighDpiScaling attribute early

bitcoin/bitcoin@099e4b9

* [BUILD] Update bitcoin_qt.m4

* [QT] clean up initialize/shutdown signals

qt: clean up initialize/shutdown signals

 - Change initializeResult(int) to initializeResult(bool) to avoid
   implicit type conversion.
 - Use EXIT_FAILURE and EXIT_SUCCESS instead of magic numbers.
 - Remove the argument from shutdownResult(int); it was called with a
   constant argument.

bitcoin/bitcoin#9834

* [Refactor] Set to nullptr after delete

bitcoin/bitcoin#10027

* [Main] Unify shutdown proceedure in init rather than per-app

and

[Startup][Refactor][Backport] Memory allocation fail handler + init step 1 refactored.

PIVX-Project/PIVX#1029

PIVX-Project/PIVX#769

* [GUI] Make "For anonymization and staking only" checked by default

PIVX-Project/PIVX#521

* [Trivial] Remove CMasternode::SliceHash

PIVX-Project/PIVX#1513

* [REST] improve performance for JSON calls

bitcoin/bitcoin@30973e9

JSON calls do not use the raw data generated for
the .bin and .hex calls. By moving the raw data
creation into the .bin and .hex switch branches,
JSON calls become faster.

* Bump Version

* [Model][Performance] Unnecessary double cs_wallet and cs_main lock.

PIVX-Project/PIVX@9d94ea6

* Delete pkg.m4

Delete arrant pkg.m4 file never was needed

* Update Mac version

* Drop QT4 Support

* [BUILD][MacOS] Make Clean Images

* [Refactor][Move Only] Nonwallet RPC Move to Sub-Dir

* [Refactor][Move Only] Wallet Move to Sub-Dir

* Add Memusage

* [REFACTOR] Drop BOOST_FOREACH/REVERSE_FOREACH

* [REFACTOR] Move PAIRTYPE to std::pair & Q_FOREACH/foreach to for

* [LEVELDB]Use std::atomic instead of MemoryBarrier

* Update Copyright

* [Tests] Fix chain ordering in budget tests

PIVX-Project/PIVX#595

* [Doc] Change aarch assert sign output folder

PIVX-Project/PIVX#585

* [Wallet] Adjust staking properties to lower orphan rates.

PIVX-Project/PIVX#617

* [Wallet] Write new transactions to wtxOrdered properly

PIVX-Project/PIVX#597

* [Travis] Add separate job to check doc/logprint/subtree

Further getting up to date with pivx PIVX-Project/PIVX#639

* [Build] Make sure Boost headers are included for libzerocoin

PIVX-Project/PIVX#622

* [Build] Remove unnecessary BOOST dependency

PIVX-Project/PIVX#605

* [Bug] Fix CKarmanodeConfig::read

rebase from upstream. Windows doesn't initialize CService properly
during startup before the masternode.conf file is read.

PIVX-Project/PIVX@9837f53

* Add getaccumulatorvalues RPC

Return the accumulator values associated with a particular block height.

PIVX-Project/PIVX@8a6d425

* [GUI] Fix wrongly displayed balance on Overview tab

PIVX-Project/PIVX#598

* [Wallet] Fix double locked coin when wallet and MN are on same machine

PIVX-Project/PIVX#656

* [Qt] Add Tor service icon to status bar

Tor Icon is displayed when the client is initialized with a successful
tor service connection.

Icon is hidden otherwise.

PIVX-Project/PIVX@f9e18aa

* [Staking] Prevent potential negative out values during stake splitting

PIVX-Project/PIVX#952

* [QT] Set AA_EnableHighDpiScaling attribute early

Set AA_EnableHighDpiScaling attribute early

bitcoin/bitcoin@099e4b9

* [BUILD] Update bitcoin_qt.m4

* [QT] clean up initialize/shutdown signals

qt: clean up initialize/shutdown signals

 - Change initializeResult(int) to initializeResult(bool) to avoid
   implicit type conversion.
 - Use EXIT_FAILURE and EXIT_SUCCESS instead of magic numbers.
 - Remove the argument from shutdownResult(int); it was called with a
   constant argument.

bitcoin/bitcoin#9834

* [Refactor] Set to nullptr after delete

bitcoin/bitcoin#10027

* [Main] Unify shutdown proceedure in init rather than per-app

and

[Startup][Refactor][Backport] Memory allocation fail handler + init step 1 refactored.

PIVX-Project/PIVX#1029

PIVX-Project/PIVX#769

* [GUI] Make "For anonymization and staking only" checked by default

PIVX-Project/PIVX#521

* [Trivial] Remove CMasternode::SliceHash

PIVX-Project/PIVX#1513

Co-authored-by: Ra's Al Ghul <buddilla@users.noreply.github.com>
Co-authored-by: Andrew LaChasse <buddilla@buddillalappy.local>
Co-authored-by: squidicuz <squid@sqdmc.net>

* Add checkpoints; Add Activation Blockhash for Version 3.0.2

Co-authored-by: Ra's Al Ghul <buddilla@users.noreply.github.com>
Co-authored-by: squidicuz <squid@sqdmc.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Block Generation Mining/Staking related issues
Development

Successfully merging this pull request may close these issues.

None yet

5 participants