-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Superblock creation (Sentinel elimination) #5525
feat: Superblock creation (Sentinel elimination) #5525
Conversation
dd3a114
to
6b06e28
Compare
Note:
needs rebase |
4a99d60
to
b4b24fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls see 97ec634
NOTE: I'm not 100% sure about 97ec634628#diff-6787065e28efe13420b2f5e85125894595bec4c84b0b917d952dc86abd879033R534-R538 but we need a way to prevent mns from creating triggers all at the same time. Sentinel does this by introducing random delays. I don't think we can use delays in Core so limiting it to the current payee only is one possible solution that might work I think. This means it's only nSuperblockMaturityWindow
MNs that could participate (1662 on mainnet). The chance all of them are broken/malicious and won't create any trigger is pretty low I think. But maybe there is a better idea.
This pull request has conflicts, please rebase. |
c2f1c2c
to
c5f6915
Compare
@UdjinM6 Well technically this means that most of the time, always the first payee during the |
…l snapshot (#5538) ## Issue being fixed or feature implemented `-1` will only mean `not initialized` from now Should fix crashes like https://gitlab.com/dashpay/dash/-/jobs/4893359925 This fix applied on top of #5525 https://gitlab.com/UdjinM6/dash/-/pipelines/972154075 ## What was done? Introduce and use `m_initial_snapshot_index` instead of re-using `nHeight`. Added a couple of asserts to make sure: 1. we never create mn lists with `nHeight` set to `-1` _explicitly_ (but it's ok for ctor with no params to do so) 2. we never set `nHeight` to `-1` for an existing mn list 3. we never try to get a height for a non-initialized list 4. `GetListForBlockInternal` never returns non-initialized mn lists ## How Has This Been Tested? Run tests, run regtest/testnet wallets. ## Breaking Changes We never stored snapshots with `nHeight == -1`, should be no breaking changes I think. ## Checklist: - [x] 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 - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
c5f6915
to
05970c4
Compare
@UdjinM6 Done |
pls see b25de6d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now I think. Sentinel does have some additional logic for picking "best" triggers and deleting ones with "worse" hashes. But that's only for triggers that had no our vote yet as far as I can tell which never actually happens now that we vote asap, so it should be safe to skip this part imo.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few small comments
Co-Authored-By: PastaPastaPasta <[email protected]>
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
…5552) ## Issue being fixed or feature implemented With #5525 , MNs shouldn't use Sentinel anymore. ## What was done? In order to force them to remove Sentinel: - `gobject submit` RPC won't accept triggers anymore. - `gobject vote-conf` RPC isn't available anymore. ## How Has This Been Tested? `feature_governance.py` and `feature_governance_object.py` ## Breaking Changes Normally, only Sentinel should be broken. ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ --------- Co-authored-by: UdjinM6 <[email protected]>
…et (#5560) ## Issue being fixed or feature implemented Since #5525, MNs during the maturity window, will propose new triggers. In `CGovernanceManager::CreateSuperblockCandidate`, SuperBlock creation is skipped when the bellow check is true: `if (nHeight % Params().GetConsensus().nSuperblockCycle < Params().GetConsensus().nSuperblockCycle - Params().GetConsensus().nSuperblockMaturityWindow) return std::nullopt; ` Hence, the value of `nSuperblockMaturityWindow` must be less than `nSuperblockCycle` and greater than 0. ## What was done? Changed `nSuperblockMaturityWindow` for devnet and Testnet chain parameters to the following values: `nSuperblockCycle` = 24 `nSuperblockMaturityWindow` = 8 ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [x] 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 - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
## Issue being fixed or feature implemented ## What was done? Added release notes for #5525. ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [x] 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 - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ --------- Co-authored-by: PastaPastaPasta <[email protected]> Co-authored-by: UdjinM6 <[email protected]>
Issue being fixed or feature implemented
Implementation of issue https://github.com/dashpay/dash-issues/issues/43
What was done?
Masternode will try to create, sign and submit a Superblock (GovTrigger) during the
nSuperblockMaturityWindow
.How Has This Been Tested?
Breaking Changes
Checklist: