Skip to content

Conversation

@random-zebra
Copy link

@random-zebra random-zebra commented Apr 6, 2021

Extracted from #2267. Based on top of

Implement protx_register and protx_list RPC commands.
Add DMN support to listmasternodes.
Deprecate startmasternode after SPORK_21 activation.

@random-zebra
Copy link
Author

Rebased on master. This too is ready to go.

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

Left some comments mostly over the new commands help texts. Other than that code review ACK b0899bce84fb21b1493389fb891b34f5dc9f7f08 .

There are some architectural improvements that we can do moving forward but nothing that would stop this for getting merge. Better to have a high percentage of test coverage before start with them.

@random-zebra
Copy link
Author

Help texts fixed as per feedback. RPC-Cli examples will be added later (ref 2f71d8d).

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.

Small finding, cherry-pick this one here if you want a00adc5293b96214800ba58d9ebae75eb66ab1df

We missed to lock the Masternode internal mutex when the collateral spent flag is set. Which could cause a concurrency problem between the message handler thread and the tier two thread as they are both accessing to the same data.

Other than that, no functional changes after the help text fixes and the rebase.
All good and ready to go for me 👍

@random-zebra
Copy link
Author

Commit cherry-picked.

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.

code ACK e754732 after cherry-pick.

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 e754732

With some nits for redundant checks to ensure the wallet exists or is unlocked. these checks are done directly inside the main RPC command functions and shouldn't need to be re-done in dependent helper functions.

Note: the SignSpecialTxPayloadByHash() and ParsePrivKey() functions are also included here unused, but connected in a separate PR, which i think is fine.

Also, for future discussion prior to 6.0 release: as with the sapling RPC command names when they were first introduced; I'd really like to avoid snake case in our final naming convention, but that is not something to change here and can be discussed in a separate issue without slowing down the progress of this series of PRs.

@random-zebra
Copy link
Author

With some nits for redundant checks to ensure the wallet exists or is unlocked.

Good catch.
I'm going to fix this inside #2308 (which is the next one in line), so the reviews here don't get dismissed, and we can move forward.

as with the sapling RPC command names when they were first introduced; I'd really like to avoid snake case in our final naming convention

Yes, I thought so.
But protxregisterprepare, for example, seemed rather ugly. In any case, yeah, we can discuss this, and update it with a scripted-commit, before the final release.

Merging...

@random-zebra random-zebra merged commit ddef43d into PIVX-Project:master May 6, 2021
@Fuzzbawls
Copy link
Collaborator

yes, the particular naming convention is something completely outside the scope of these PRs, which is why i only mentioned it as an aside comment and not a blocking comment...has nothing to do with the code itself, as the command names can easily be changed prior to release without issue.

As more RPC commands are added in this chain of PRs, I'm thinking it may be best for me to open up an RFC issue specifically for the purpose of brainstorming/discussing more appropriate command names that conform to our existing naming convention, that won't have any tangible effect/block on existing PRs.

@random-zebra
Copy link
Author

I'm thinking it may be best for me to open up an RFC issue specifically for the purpose of brainstorming/discussing more appropriate command names that conform to our existing naming convention

Sounds good.
Btw, RPC redundant checks removed in c01639b.

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 that referenced this pull request Jun 28, 2021
…tatic 10k PIV strings.

3c5b5f3 Move MN collateral hardcoded 10,000 PIV strings for the specific chain collateral value. (furszy)
2442b5b GUI: MN creation wizard, use chain specific MN collateral value instead of the hardcoded amount. (furszy)

Pull request description:

  Since #2296, we have a different masternode collateral output amount for regtest. As the GUI has the 10k value harcoded in some places, the masternode creation wizard got broken and there are some misaligned strings as well.

  This PR fixes it and aligns every static 10k PIV string to be set dynamically consuming the chain params value.

ACKs for top commit:
  random-zebra:
    utACK 3c5b5f3

Tree-SHA512: cdc3de21216fa61c76105feed7eedbde9b2686309437c8bfef079185b31bc06b2ad9120d2ac89a99a161e7097695493c19746263946f2068fe42c746a0a8d938
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