Skip to content

Commit

Permalink
fix: adjusted nSuperblockMaturityWindow to new logic for devnet/testn…
Browse files Browse the repository at this point in the history
…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)_
  • Loading branch information
ogabrielides authored Aug 31, 2023
1 parent 811f617 commit d9f815d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class CTestNetParams : public CChainParams {
consensus.nSuperblockStartBlock = 4200; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
consensus.nSuperblockStartHash = uint256(); // do not check this on testnet
consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on testnet
consensus.nSuperblockMaturityWindow = 24; // This is equal to SB cycle on testnet
consensus.nSuperblockMaturityWindow = 8;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
Expand Down Expand Up @@ -517,7 +517,7 @@ class CDevNetParams : public CChainParams {
consensus.nSuperblockStartBlock = 4200; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
consensus.nSuperblockStartHash = uint256(); // do not check this on devnet
consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on devnet
consensus.nSuperblockMaturityWindow = 24; // This is equal to SB cycle on devnet
consensus.nSuperblockMaturityWindow = 8;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
Expand Down

0 comments on commit d9f815d

Please sign in to comment.