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

update max Validators only for main net #2277

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ var (
AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), PrivatePIP7ChainID, "lat", "", big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), &CbftConfig{Period: 3}, FORKVERSION_1_5_0, sync.RWMutex{}}

PrivatePIP7ChainID = new(big.Int).SetUint64(2203181)

MainPIP7ChainID = new(big.Int).SetUint64(210425)
)

// TrustedCheckpoint represents a set of post-processed trie roots (CHT and
Expand Down
2 changes: 1 addition & 1 deletion x/plugin/gov_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (govPlugin *GovPlugin) BeginBlock(blockHash common.Hash, header *types.Head
}
log.Info("Successfully upgraded the new version 1.3.0", "blockNumber", blockNumber, "blockHash", blockHash, "preActiveProposalID", preActiveVersionProposalID)
}
if versionProposal.NewVersion == params.FORKVERSION_1_5_0 {
if versionProposal.NewVersion == params.FORKVERSION_1_5_0 && govPlugin.chainConfig.PIP7ChainID.Cmp(params.MainPIP7ChainID) == 0 {
if err := gov.UpdateGovernParamValue(gov.ModuleStaking, gov.KeyMaxValidators, fmt.Sprint(xcom.MaxValidatorsForVersion150), blockNumber+1, blockHash); err != nil {
return err
}
Expand Down
7 changes: 4 additions & 3 deletions x/plugin/staking_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3166,9 +3166,10 @@ func vrfElection(validatorList staking.ValidatorQueue, shiftLen int, nonce []byt
return nil, err
}
if len(preNonces) < len(validatorList) {
log.Error("Failed to vrfElection on Election", "blockNumber", blockNumber, "validatorListSize", len(validatorList),
"nonceSize", len(nonce), "preNoncesSize", len(preNonces), "parentHash", hex.EncodeToString(parentHash.Bytes()))
return nil, staking.ErrWrongFuncParams
validatorList = validatorList[:len(preNonces)]
//log.Error("Failed to vrfElection on Election", "blockNumber", blockNumber, "validatorListSize", len(validatorList),
// "nonceSize", len(nonce), "preNoncesSize", len(preNonces), "parentHash", hex.EncodeToString(parentHash.Bytes()))
//return nil, staking.ErrWrongFuncParams
}
if len(preNonces) > len(validatorList) {
preNonces = preNonces[len(preNonces)-len(validatorList):]
Expand Down
Loading