-
Notifications
You must be signed in to change notification settings - Fork 725
[Refactor] Introduce Consensus namespace #1328
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
[Refactor] Introduce Consensus namespace #1328
Conversation
bf74c6f [Cleanup] Remove stale UNITTEST network (Fuzzbawls) Pull request description: This network is un-necessary as our unit test suite can simply be run with MainNet's parameters, which is basically what we already do. Minor conflict with #1328 due to that PR having already removed one of the unused methods. ACKs for top commit: random-zebra: utACK bf74c6f furszy: utACK bf74c6f and merging.. Tree-SHA512: 1b8c7b4178e2dc8d60fe89b4ce4d4ad476f433ced19d981e1d3e1043fd8468e269600fcbe30ee04f7954250a183f2bc34486ad9b37fd7d78aed828c47d662d77
|
Needs rebase. |
96d3b0f to
170fa63
Compare
170fa63 to
23c9b6c
Compare
|
rebased |
| consensus.BIP65Height = 1808634; // 82629b7a9978f5c7ea3f70a12db92633a7d2e436711500db28b97efd48b1e527 | ||
| consensus.powLimit = uint256S("00000ffff0000000000000000000000000000000000000000000000000000000"); | ||
| consensus.posLimitv1 = uint256S("000000ffff000000000000000000000000000000000000000000000000000000"); | ||
| consensus.posLimitv2 = uint256S("00000ffff0000000000000000000000000000000000000000000000000000000"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated fields:
consensus.powLimit == bnProofOfWorkLimit
consensus.posLimitv1 == bnProofOfStakeLimit
consensus.posLimitv2 == bnProofOfStakeLimit_V2
| consensus.posLimitv2 = uint256S("00000ffff0000000000000000000000000000000000000000000000000000000"); | ||
| consensus.nCoinbaseMaturity = 100; | ||
| consensus.nTargetTimespan = 40 * 60; | ||
| consensus.nTargetSpacing = 1 * 60; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, consensus.nTargetTimespan and consensus.nTargetSpacing are repeated too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have begun migrating where these instances are referred to in https://github.com/barrystyle/PIVX/tree/022020-rebase-consensuscorrections.
The previous PR was intended to be for the interim - there will be doubleups.
random-zebra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
furszy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 23c9b6c
23c9b6c Swap to newer method for genesis calculation; introduce Consensus namespace.. (barrystyle) Pull request description: This is PR is the forth part of breaking up #1209 into individual narrow-focused PRs. Original commit(s) were cherry-picked from @barrystyle's initial pre-squashed branch and then re-squashed (reference branch is at https://github.com/Fuzzbawls/PIVX/commits/pr-1209) Input Commits: Fuzzbawls@041c9ee Fuzzbawls@5d7e61c Fuzzbawls@cf696e4 Fuzzbawls@18ab8ef Fuzzbawls@0a8338b Note: I didn't retain any transitional or "fixup" commits, so this PR is a single commit which takes the overall changeset of the above commits, along with some cleanup of unused/unneeded code that was in the original overall changeset (not-implemented BIP9 chain parameters, for example). ------------------- This PR does two things: 2. Establishes the `Consensus` namespace skeleton, with a minimum number of chain parameters moved into the new namespace. Additional PRs should be opened after this is merged that handle the moving of other consensus-specific chain parameters in a concise and narrow-focused manner. 2. Refactors the method for initializing the genesis block on each chain (Mainnet, Testnet, Regtest) to be a function call rather than an in-class manual crafting of the block. ACKs for top commit: random-zebra: ACK 23c9b6c furszy: ACK 23c9b6c Tree-SHA512: dae6e1d887ade18855c9f1d16f625ec6d6e1cab890fe50eb045835798bab5df55475cdb6ec2e41326e48c568649b13f5e13adc49d21cba097feda2193fd28970
64465b7 [Refactor] Consensus: Stake Modifier V2 (random-zebra) 8083725 [Refactor] Consensus: TimeProtocolV2 parameters (random-zebra) 4d1c696 [Refactor] Consensus: nStakeMinAge, nStakeMinDepth, nFutureTimeDrift (random-zebra) e69cee2 [Refactor] Consensus: restore nMaxMoneyOut as consensus param (random-zebra) 08a581d [Refactor] Consensus: fAllowMinDifficultyBlocks, fPowNoRetargeting (random-zebra) ca6ea3c [Refactor] Consensus: nTargetTimespan, nTargetSpacing, nTimeSlotLength (random-zebra) a281dee [Refactor] Consensus: remove unneeded getters. Rename BIP65Height (random-zebra) 284271c [Refactor] Consensus: bnProofOfWorkLimit / bnProofOfStakeLimit (v1-v2) (random-zebra) Pull request description: This PR builds on - [x] #1328 Populates the `consensus` struct with all relevant consensus parameters. Resets `nMaxMoneyOut` as chain param (with different value for TestNet). Cleans up several unneeded fields in ChainParams. EDIT: Current PR has been split in two. Second part is #1344 ACKs for top commit: furszy: good, utACK 64465b7. Fuzzbawls: utACK 64465b7 Tree-SHA512: d3e46bc8bb2ad9ee48abcbc4d4b1df2f59914360aaca72e93e19a5578248ecb95fd6a422477238e4736bc767d4e226f5b7f867174d96dcace73621946bf84df8
This is PR is the forth part of breaking up #1209 into individual narrow-focused PRs. Original commit(s) were cherry-picked from @barrystyle's initial pre-squashed branch and then re-squashed (reference branch is at https://github.com/Fuzzbawls/PIVX/commits/pr-1209)
Input Commits:
Fuzzbawls@041c9ee
Fuzzbawls@5d7e61c
Fuzzbawls@cf696e4
Fuzzbawls@18ab8ef
Fuzzbawls@0a8338b
Note: I didn't retain any transitional or "fixup" commits, so this PR is a single commit which takes the overall changeset of the above commits, along with some cleanup of unused/unneeded code that was in the original overall changeset (not-implemented BIP9 chain parameters, for example).
This PR does two things:
2. Establishes the
Consensusnamespace skeleton, with a minimum number of chain parameters moved into the new namespace. Additional PRs should be opened after this is merged that handle the moving of other consensus-specific chain parameters in a concise and narrow-focused manner.2. Refactors the method for initializing the genesis block on each chain (Mainnet, Testnet, Regtest) to be a function call rather than an in-class manual crafting of the block.