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

[Consensus] New cold-staking opcode #2275

Merged
merged 6 commits into from
May 11, 2021

Conversation

random-zebra
Copy link

@random-zebra random-zebra commented Mar 26, 2021

Extracted from #2267, and rebased on top of #2258.
Given the consensus change, introduced in #2274, we can define a more secure OP_CHECKCOLDSTAKEVERIFY opcode, which doesn't leave the last output of the coinstake "free" (as we no longer pay masternode/budgets in the coinstake tx).

Built on top of:

@random-zebra
Copy link
Author

Rebased on master. Ready for review.

Fuzzbawls
Fuzzbawls previously approved these changes May 9, 2021
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.

Code ACK 25750af

@random-zebra
Copy link
Author

Rebased on master due to conflict in the release-notes file.

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.

re-Code ACK 4a5baf3 after rebase, no code changes.

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 4a5baf3.

An important point over the new opcode introduction:
As we aren't adding a v6 enforcement guard for the new cold staking opcode (0xd2). We can't enable the feature, disabling the cold staking maintenance spork, prior the next upgrade enforcement.
The new opcode is guarded by the spork, disabling it before the enforcement will let anyone that hand-craft a delegation with the new opcode hard fork the network.

@furszy furszy merged commit 10319fd into PIVX-Project:master May 11, 2021
random-zebra added a commit that referenced this pull request May 23, 2021
6b7b9df [BUG][Test] Return directly block template without mempool txes (random-zebra)
f593706 [test] add mnsync and spork8 activation in deterministicmns_tests (furszy)
753986a [test] Add unit test coverage for invalid block payee (furszy)
a81abb4 [Trivial] Fix typo utoxs --> utxos (random-zebra)
f6aefd8 [Tests] Check masternode payments in evo_deterministicmns_tests (random-zebra)
4c731a9 [Consensus] New DMN payment logic (random-zebra)

Pull request description:

  Estracted from #2267
  This implements the new payment logic for deterministic masternodes, to be used after the deactivation of the legacy system with SPORK_21.

  Based on top of:
  - [x] #2275
  - [x] #2296

ACKs for top commit:
  furszy:
    ACK 6b7b9df

Tree-SHA512: 9328e2e2d820510845ede63e4db557ceb49df9cfb27f1ac1b36a20878c99728bc60b8f5c4cbfa00f161be5a3c5b7d72cba8ba4dc476383718f66a6d8cdddd70c
random-zebra added a commit that referenced this pull request May 25, 2021
…voting

04cd17e [QA][BUG] Fix test and rework setupDMN to return only proTx hash (random-zebra)
9aeeb76 [Test] Add test coverage for MN and DMN votes expiration removal. (furszy)
3f16936 [Test] Update tiertwo_mn_compatibility and check winners (random-zebra)
ad2cc30 [Consensus] Check against current hash when no payee is found (random-zebra)
ede4519 [Cleanup] Remove unused parameter in GetCurrentMasternode (random-zebra)
dd3bce9 [Tests] Raise regtest ping timeouts to 1/10th of mainnet value (random-zebra)
d616239 [Cleanup] Remove redundant checks in CMasternodePaymentWinner::IsValid (random-zebra)
0db3f57 [Consensus] Compatibility: sign/verify mnw with deterministic nodes (random-zebra)
dbc19ff [Refactor] Decouple getting active mn keys from VoteOnFinalizedBudgets (random-zebra)
971f1da [Consensus] DMN payment compatibility code (random-zebra)
acfa24b [Tests] Introduce tiertwo_dmn_compatibility functional test (random-zebra)
6ad7ea6 [BUG] Fix locking order between CDeterministicMNManager/CMasternodeman (random-zebra)
aa867d5 [RPC] Add DMN support to listmasternodes (random-zebra)
064f774 [RPC] getmasternodestatus for DMN (random-zebra)
8b10fc2 [P2P] Stop processing mnw messages when Legacy MN system is obsolete (random-zebra)
baf60c7 [Tests] governance_sync_basic sign final budget with DMN too (random-zebra)
474e0b2 [RPC][Refactoring] Use ProcessProposal(FinalBudget)Vote directly (random-zebra)
72c2a70 [RPC] Get all required keys before signing budgets (random-zebra)
0591957 [RPC][Refactoring] Mn final budget / proposal voting code de-duplication (random-zebra)
a7557f7 [Validation] Sign/Verify final budgets with DMNs (random-zebra)
6fcd53d [MN] Active MN manager: return key and dmn after validation (random-zebra)
5df5067 [Tests] tiertwo_governance_basic: add deterministic masternodes (random-zebra)
972d236 [RPC] Init Deterministic masternode on-demand (random-zebra)
f93bc0f [Budget] Validate proposal votes from deterministic masternodes (random-zebra)
c5b9e6f [RPC][Budget] Deterministic MNs: vote for proposals (random-zebra)
366bfd0 [RPC] Remove redundant checks for wallet existing/unlocked (random-zebra)

Pull request description:

  Extrated from #2267.
  This enables proposals and budget voting for DMNs.
  It also implements the compatibility code for masternode payments, to be used between v6 enforcement and SPORK_21 activation (when both systems coexist).

  Based on top of:
  - [x] #2275
  - [x] #2296

ACKs for top commit:
  furszy:
    ACK 04cd17e ☕.
  Fuzzbawls:
    ACK 04cd17e

Tree-SHA512: d9504fdd87a7cd05c385e08d51cde0566738bd8992b493ca77592f9b1d1254374d0c5d49d9278edb4525c5559f7e26496fc6b0dd846bbb3acb2164e330ccc92e
random-zebra added a commit to random-zebra/PIVX that referenced this pull request Jun 18, 2021
>>> adapted from df11631 (PIVX-Project#2275)

without introducing the new opcode
random-zebra added a commit to random-zebra/PIVX that referenced this pull request Jun 19, 2021
>>> adapted from df11631 (PIVX-Project#2275)

without introducing the new opcode
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.

3 participants