Skip to content

feat!: 4k collateral high performance masternode implementation#5039

Merged
PastaPastaPasta merged 64 commits into
dashpay:developfrom
ogabrielides:4k_hpmn
Feb 14, 2023
Merged

feat!: 4k collateral high performance masternode implementation#5039
PastaPastaPasta merged 64 commits into
dashpay:developfrom
ogabrielides:4k_hpmn

Conversation

@ogabrielides
Copy link
Copy Markdown

@ogabrielides ogabrielides commented Oct 10, 2022

Issue being fixed or feature implemented

What was done?

Implementation of 4k collateral HPMN.

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@ogabrielides ogabrielides marked this pull request as draft October 10, 2022 18:12
@github-actions
Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@ogabrielides ogabrielides changed the title Introduction of HighPerformanceMasternode feat: 4k collateral masternode implementation Dec 17, 2022
@ogabrielides ogabrielides changed the title feat: 4k collateral masternode implementation feat: 4k collateral high performance masternode implementation Dec 17, 2022
@thephez thephez added the RPC Some notable changes to RPC params/behaviour/descriptions label Dec 20, 2022
@github-actions
Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@ogabrielides ogabrielides changed the title feat: 4k collateral high performance masternode implementation feat!: 4k collateral high performance masternode implementation Dec 28, 2022
@ogabrielides ogabrielides added this to the 20 milestone Dec 29, 2022
@github-actions
Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@thephez
Copy link
Copy Markdown
Collaborator

thephez commented Jan 4, 2023

@PastaPastaPasta @UdjinM6 We need to make sure this doesn't create any issues with sentinel. Please consider that when reviewing. @nmarley You may know best about that.

@ogabrielides ogabrielides modified the milestones: 20, 19 Jan 4, 2023
@github-actions
Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@github-actions
Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@thephez thephez added P2P Some notable changes on p2p level and removed P2P Some notable changes on p2p level labels Jan 26, 2023
@ogabrielides ogabrielides marked this pull request as ready for review January 26, 2023 18:06
@ogabrielides
Copy link
Copy Markdown
Author

@PastaPastaPasta @UdjinM6 Applied suggestions (+fixed tests).
In addition, as discussed with @HashEngineering, platformNodeID is included in SML entries.
Please review again

Comment thread src/governance/vote.cpp Outdated
Comment thread src/llmq/utils.h Outdated
Comment thread src/rpc/evo.cpp Outdated
Comment on lines 192 to 176
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👀

Comment thread src/rpc/evo.cpp Outdated
Comment thread src/rpc/masternode.cpp Outdated
Comment thread src/evo/deterministicmns.h
Comment thread src/evo/simplifiedmns.cpp
ogabrielides and others added 2 commits February 13, 2023 18:20
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Copy link
Copy Markdown
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK for squash merge

Copy link
Copy Markdown
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

some nits only. Not a blocker to merge! Can be done never or as spare PR someday.

uint256 proTxHash;
COutPoint collateralOutpoint;
uint16_t nOperatorReward{0};
uint16_t nType{MnType::Regular.index};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why index is uint8_t but here is uint16_t? btw, better to use enum class here as more error prune (see other related comment)

Comment thread src/evo/dmn_types.h
class CDeterministicMNType
{
public:
uint8_t index;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

may be change uint8_t index to enum class MNType : uint8_t ?

Pros:
Firstly, switch inside GetMnType() and any similar code will show a compiler warning if any type is missing.
Secondly, instead "MnType::HighPerformance.index" you can write MnType::HighPerformance
Thirdly, you can remove .index from MnType
Cons:
Instead (nType == MnType::HighPerformance.index) need to write nType == static_cast<int16_t>(MnType::HighPerformance)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

see #5200

Comment thread src/evo/deterministicmns.h Outdated
Comment thread src/evo/deterministicmns.cpp Outdated
if (dmn->nType == MnType::HighPerformance.index) {
if (!UpdateUniqueProperty(*dmn, oldState->platformNodeID, dmn->pdmnState->platformNodeID)) {
mnUniquePropertyMap = mnUniquePropertyMapSaved;
throw(std::runtime_error(strprintf("%s: Can't update a masternode %s with a duplicate platformNodeID=%s", __func__,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I though that () is not needed after throw.

If remove them, the line will be more beautiful because no "))))" at the end of line but only ")))"

Comment thread src/evo/deterministicmns.cpp Outdated
Comment thread src/evo/deterministicmns.cpp Outdated
@ogabrielides
Copy link
Copy Markdown
Author

some nits only. Not a blocker to merge! Can be done never or as spare PR someday.

Sure. Can be applied in a separate PR. Thanks @knst !

@UdjinM6
Copy link
Copy Markdown

UdjinM6 commented Feb 14, 2023

pls see https://github.com/UdjinM6/dash/commits/pr5039. also, I think expressions like nType == MnType::HighPerformance.index look pretty confusing. I like the suggestion made by @knst above, I would suggest to implement it here. ok, let's keep it as is for now and refactor it later.

ogabrielides and others added 2 commits February 14, 2023 12:38
Co-Authored-By: UdjinM6 <1935069+Udjinm6@users.noreply.github.com>
Co-Authored-By: Konstantin Akimov <545784+knst@users.noreply.github.com>
Copy link
Copy Markdown

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Copy Markdown
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

re-utACK for squash merge

@PastaPastaPasta PastaPastaPasta merged commit aa8462b into dashpay:develop Feb 14, 2023
@ogabrielides ogabrielides deleted the 4k_hpmn branch February 15, 2023 08:26
PastaPastaPasta added a commit that referenced this pull request Feb 16, 2025
…b upgrade logic

39f76c8 chore: drop legacy `CDeterministicMNState` formats, evodb upgrade logic (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * `CDeterministicMNState_`{`Oldformat`, `mntype_format`} was introduced in [dash#5039](#5039) and [dash#5403](#5403), included in Dash Core v19 and v20 respectively.

  The above change has been in the codebase for more than two major releases and does not concern databases with a long shelf life (like wallets), this pull request removes them entirely.

  ## Breaking Changes

  Users upgrading from these versions are now expected to `-reindex`.

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 39f76c8
  knst:
    utACK 39f76c8

Tree-SHA512: 3fabe0aeb7f3d01a858b0b19d49a22523f462157597a1ade93181288e4ba7b133a5ee9272a8abe41e40cff177c0ddf94123274f0427693db6fdb90c4b8e613fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC Some notable changes to RPC params/behaviour/descriptions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants