[PoS] Stake Modifier V2#983
Merged
Fuzzbawls merged 38 commits intoAug 26, 2019
Merged
Conversation
CaveSpectre11
left a comment
There was a problem hiding this comment.
more in depth later; lunch break is over
presstab
reviewed
Aug 14, 2019
|
On a first view looks good, even when (in my opinion) is unnecessary hard to verify/understand (you have to lookup those assumptions in chain.h) instead of simply using the block height of the upgrade block. |
4 tasks
215f3c4 to
6106e53
Compare
179090a to
0fb92a2
Compare
ad7a7f7 to
335b078
Compare
[Cleanup] Remove unused 'GetWeight()' function [Cleanup] Remove unneeded variables
also there's no need to count mints and spends here
other redundancies. [PoS][Refactor] CPivStake, caching data + removing redundant method calls. [PoS] Fix error in nSelectionIntervalStart integer division
…s nStakeMinAgeV2Modifier and nMaturityV2Modifier.
…y cycle of the CreateCoinStake loop.
require it to be nStakeMinDepth deep instead of nStkaMinAge old.
[SQUASH] Fix nTimeTx bug in Stake()
the block under review. [PoS] CheckProofOfStake, stop searching a block on disk when it's absolutely not needed. * Not used variable nTargetTimespan in chainParams removed.
[SQUASH] Cleanup proof-of-stake debug log
[PoS] cleaning not used stakeTargetHit method + fixing bad nHeight in the new compute modifier method.
…ckIndex and not in the chainActive and look for it based on the next block hash and not based on height.
* Contextual zPIV stake, invalid height contextual check, using tip instead of prev height + 1.
… the near future (4.0) and the code will be fully refactored soon.
// This is just a quick inline towards that goal, the mempool by default will not accept them. Blocking
// any subsequent network relay.
[SQUASH] Permitting free txes only in regtest.
conditional log output in kernel.cpp functions can use the global fDebug variable instead of their own.
Also add help description for new keys
335b078 to
b1416f5
Compare
Fuzzbawls
approved these changes
Aug 26, 2019
Mrs-X
approved these changes
Aug 26, 2019
Fuzzbawls
added a commit
that referenced
this pull request
Aug 26, 2019
bf16514 [Consensus] New modifier enforcement height changed for mainnet (random-zebra) 6b6ef32 Don't load old stake modifier from disk after changeover height (Fuzzbawls) d085ed0 [Consensus] Fix old block version check (including v.6) (random-zebra) b1416f5 [Tests] fix blocks/maturity fakestake_accepted (random-zebra) c212587 [PoS] fix regtest nBlockStakeModifierlV2 and cbase maturity (random-zebra) dddca50 Use better JSON key names in block coinstake output (Fuzzbawls) 2835111 Don't shadow global fDebug (Fuzzbawls) 85fa96e [Consensus] New modifier enforcement height set. (furszy) a74f6cf [GUI] sendCoinsdialog, removing zero tx fee checkbox and label. (furszy) 6a33fff [Mempool] // As zero fee transactions are not going to be accepted in the near future (4.0) and the code will be fully refactored soon. // This is just a quick inline towards that goal, the mempool by default will not accept them. Blocking // any subsequent network relay. (furszy) 6c69cfe [PoS] * GetKernelStakeModifier, look for the next block in the mapBlockIndex and not in the chainActive and look for it based on the next block hash and not based on height. * Contextual zPIV stake, invalid height contextual check, using tip instead of prev height + 1. (furszy) d3db3e6 [PoS] Stake(): Add check for staked blocks in the future (random-zebra) f8777c6 [Refactor] Add future block time drift to chainparams (random-zebra) 8c7522b [PoS] Compute old modifier, invalid integer division removal plus extra logging for the stake modifier height added. (furszy) beaba47 [RPC] getblock, validate that PoS blocks to return the coin stake data. (furszy) 81446bb [PoS][RPC] getblock command, adding more information about the coin stake tx. (furszy) 820e08c [PoS][RPC][Refactor] GetHashProofOfStake and initStakeInput methods created, better method responsibility division from the CheckStakeKernelHash to be able to get the information for the getblock rpc command and possible future tests. (furszy) 4d5cc97 [Wallet] Staking, unreacheable code removed.. (furszy) 41ccf6b [PoS][Wallet] CreateCoinStake, if the block is from the future then start on a future time. (furszy) ffb0dd5 [Trivial] logging, removing none required jump lines. (furszy) 843dc56 [PoS] Allign ComputeStakeModifier (v2) to nHeight logic (random-zebra) 4c24934 [PoS] read/write block index modifier based on height and not block version. (furszy) 6297e77 [Core] Introduce Blocks version 6 (random-zebra) b8c59ae [PoS] CheckStakeKernelHash, was checking the previous block instead of the block under review. (furszy) 0d31ac2 [Wallet] HasMintableCoins, don't call GetAdjustedTime on every cycle of the loop. (furszy) d94931f [Trivial] Add logs to CheckKernelHash (random-zebra) eab9944 version bumped (furszy) 117f815 [PoS] New logic for stake input maturity (random-zebra) d805952 [Wallet] SelectStakeCoins using block time and fix GetBlocksToMaturity (random-zebra) 01ed69a [PoS] Remove extra nTime check in Stake() (random-zebra) 74d85c2 [Refactor][PoS] Do not calculate the prevBlock medianTimePast on every cycle of the CreateCoinStake loop. (furszy) a48a7a5 [Trivial] Compiler warning, uint_32 compared against int. (furszy) e9c07d0 [Consensus] V2 modifier protocol change, two new fields in chainparams nStakeMinAgeV2Modifier and nMaturityV2Modifier. (furszy) 3b97fc0 [PoS] Cleaning GetStakeModifierSelectionInterval() constant method + other redundancies. (furszy) 3c1fd7a [PoS] Stake Modifier V2 (random-zebra) f73a27f [Core] Do not check block if it's not the one needed (random-zebra) 1e4c864 [Cleanup] Clean error messages in CheckBlock (random-zebra) 401a986 [Consensus] Placeholder block height for modifier V2 enforcement (random-zebra) Pull request description: This pull request defines a new 256-bits modifier for the proof of stake protocol, `CBlockIndex::nStakeModifierV2`. It is computed at every block, by taking the hash of the modifier of previous block along with the coinstake input. To meet the protocol, the PoS kernel must comprise the modifier of the previous block. Enforcement height is set at 1214000 for testnet and 1967000 for mainnet. This also includes upgrades to `PROTOCOL_VERSION` (to 70917) and to block version (to version 6) and disables 0-fee transactions. ACKs for top commit: Fuzzbawls: ACK bf16514 Mrs-X: utACK bf16514 Tree-SHA512: 02fdcf1515b0b5571ef6c6eb9bf61429841e51b7372de50990bb4b58704030ebe9cc869ff896f507731cfa3f6a90ada25a4f71800f863dfc05b222368cafbbf0
Fuzzbawls
added a commit
to Fuzzbawls/PIVX
that referenced
this pull request
Aug 26, 2019
Built on top of PIVX-Project#983, this adds the enforcement logic for 70917 and also updates the spork key.
Fuzzbawls
added a commit
that referenced
this pull request
Aug 26, 2019
… keys ce8dccb [Net] Protocol update enforcement for 70917 and new spork keys (Fuzzbawls) Pull request description: Built on top of #983, this adds the enforcement logic for 70917 and also updates the spork key. Top commit has no ACKs. Tree-SHA512: bde4ebea833acf746b838e354e8c5be55376ea4657e8b02874f958e6a43f4b5ae087051e7df0f76e455625558c56e7fb35bd9d01a3645b1dfc10bb14b48ad5ac
JSKitty
reviewed
Sep 6, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request defines a new 256-bit modifier for the proof of stake protocol,
CBlockIndex::nStakeModifierV2.It is computed at every block, by taking the hash of the modifier of previous block along with the coinstake input.
To meet the protocol, the PoS kernel must comprise the modifier of the previous block.
Enforcement height is set at 1214000 for testnet and 1967000 for mainnet.
This also includes upgrades to
PROTOCOL_VERSION(to 70917) and to block version (to version 6) and disables 0-fee transactions.