Skip to content

Conversation

@random-zebra
Copy link

@random-zebra random-zebra commented Jan 13, 2020

This removes the old StakeV1 function and does some minor optimizations in the miner code (removing redundant signature and IncrementExtraNonce calls).

This is based on top of the following three pull requests and will be rebased after their merge into master.
So, they should be reviewed before this one.

@random-zebra random-zebra self-assigned this Jan 13, 2020
@random-zebra random-zebra added Block Generation Mining/Staking related issues Cleanup Wallet labels Jan 13, 2020
@random-zebra random-zebra force-pushed the 2020_remove_stakeV1 branch 4 times, most recently from bcc296d to 71ecd9e Compare January 15, 2020 22:55
@random-zebra random-zebra changed the title [Core] Remove old staking code [Core] Remove StakeV1 Jan 15, 2020
@random-zebra random-zebra changed the title [Core] Remove StakeV1 [WIP][Core] Remove StakeV1 Jan 15, 2020
@random-zebra random-zebra marked this pull request as ready for review January 15, 2020 22:56
@Fuzzbawls Fuzzbawls added this to the 4.1.0 milestone Jan 18, 2020
@random-zebra random-zebra changed the title [WIP][Core] Remove StakeV1 [Core] Remove StakeV1 Jan 21, 2020
@random-zebra
Copy link
Author

Rebased. Ready for review.

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.

two minor comments, the rest is looking pretty good 👌 .

Will run it and stake over night to double check it.

{
//control the amount of times the client will check for mintable coins
if ((GetTime() - nMintableLastCheck > minutes * 60)) {
nMintableLastCheck = GetTime();
Copy link

Choose a reason for hiding this comment

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

would be good to inline this GetTime() in a single variable.

}

// POW - miner main
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
Copy link

Choose a reason for hiding this comment

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

Can we put this under the else path of the if (fProofOfStake) block that it's above.

First glance is hard to get it, the whole if (fProofOfStake) block that it's above basically start the flow all over independently on what happen.. lot of ugly continue there.

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.

Staking working properly, ACK 799e3ad

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK 799e3ad

furszy added a commit that referenced this pull request Jan 26, 2020
799e3ad [Tests] Fix block version on RegTest (random-zebra)
00aae54 [Core][Cleanup] PoS: remove extra signature + IncrementExtraNonce (random-zebra)
389094f [Core] Remove StakeV1 in kernel and miner (random-zebra)

Pull request description:

  This removes the old StakeV1 function and does some minor optimizations in the miner code (removing redundant signature and IncrementExtraNonce calls).

  This is based on top of the following three pull requests and will be rebased after their merge into master.
  So, they should be reviewed before this one.
  - [x] #1276
  - [x] #1277
  - [x] #1278

ACKs for top commit:
  furszy:
    Staking working properly, ACK 799e3ad
  Fuzzbawls:
    ACK 799e3ad

Tree-SHA512: a3cde86fc3a7cdad39d8d322dbcc0da1e34d044c4f320700605a9952e67788c825b53516e5ff452e37cde127aaf902416168dc6384fe62954d336efe7aea23eb
@furszy furszy merged commit 799e3ad into PIVX-Project:master Jan 26, 2020
random-zebra added a commit that referenced this pull request Jan 31, 2020
b77c064 [Docs] Document zerocoin-related RPC changes for release notes (random-zebra)
4800729 [Core][Cleanup] Remove modifier as member of StakeInput objects (random-zebra)
238ea5f [Core][Cleanup][zPIV] CZPivStake --> CLegacyZPivStake (random-zebra)
f1b21a2 [Core][Cleanup][zPIV] Remove code to produce v2 spends and zPOS stakes (random-zebra)

Pull request description:

  This removes (now unused) code to produce old zerocoin spends and zPOS stakes.
  `CZPivStake` class is replaced with a `CLegacyZPivStake` (moved in new files `zpiv/zpos.*`) used exclusively to validate the chain.
  This also refactors `CStakeInput` class, removing the modifier functions (put back in kernel) and cleans up `kernel.*` files, removing old code and reorganizing them.

  This PR is based on top of:
  - [x] #1259
  - [x] #1290

  and it will be rebased after their merge. Only last **3** commits are relevant

ACKs for top commit:
  furszy:
    Re-acking the PR, release notes added. ACK b77c064
  Fuzzbawls:
    ACK b77c064

Tree-SHA512: cdf937822b435d3d05a8d3000d17340c74f7b7b17da4f1937935cb7bd71fddea9628c35a934c5abeea9ecb40b8daed074a49040479138a28fcd6699f2ca8bb8d
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 Cleanup Wallet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants