Skip to content

Conversation

@Fuzzbawls
Copy link
Collaborator

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.

@Fuzzbawls Fuzzbawls added this to the 4.1.0 milestone Feb 11, 2020
@Fuzzbawls Fuzzbawls self-assigned this Feb 11, 2020
@Fuzzbawls Fuzzbawls changed the title Introduce Consensus namespace [Refactor] Introduce Consensus namespace Feb 11, 2020
furszy added a commit that referenced this pull request Feb 13, 2020
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
@furszy
Copy link

furszy commented Feb 13, 2020

Needs rebase.

@Fuzzbawls Fuzzbawls force-pushed the 2020_consensus-namespace branch from 96d3b0f to 170fa63 Compare February 14, 2020 00:57
@Fuzzbawls Fuzzbawls force-pushed the 2020_consensus-namespace branch from 170fa63 to 23c9b6c Compare February 14, 2020 01:01
@Fuzzbawls
Copy link
Collaborator Author

rebased

consensus.BIP65Height = 1808634; // 82629b7a9978f5c7ea3f70a12db92633a7d2e436711500db28b97efd48b1e527
consensus.powLimit = uint256S("00000ffff0000000000000000000000000000000000000000000000000000000");
consensus.posLimitv1 = uint256S("000000ffff000000000000000000000000000000000000000000000000000000");
consensus.posLimitv2 = uint256S("00000ffff0000000000000000000000000000000000000000000000000000000");
Copy link

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;
Copy link

@furszy furszy Feb 14, 2020

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.

Copy link

@barrystyle barrystyle Feb 15, 2020

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.

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.

ACK 23c9b6c

(consensus params migration completed in #1341 )

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

ACK 23c9b6c

furszy added a commit that referenced this pull request Feb 19, 2020
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
@furszy furszy merged commit 23c9b6c into PIVX-Project:master Feb 19, 2020
Fuzzbawls added a commit that referenced this pull request Feb 22, 2020
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
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.

4 participants