diff --git a/x/plugin/gov_plugin.go b/x/plugin/gov_plugin.go index cb64fe0703..b3539ebd4f 100644 --- a/x/plugin/gov_plugin.go +++ b/x/plugin/gov_plugin.go @@ -149,6 +149,12 @@ 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 err := gov.UpdateGovernParamValue(gov.ModuleStaking, gov.KeyMaxValidators, fmt.Sprint(xcom.MaxValidatorsForVersion150), blockNumber+1, blockHash); err != nil { + return err + } + log.Info("Successfully upgraded the new version 1.5.0", "blockNumber", blockNumber, "blockHash", blockHash) + } log.Info("version proposal is active", "blockNumber", blockNumber, "proposalID", versionProposal.ProposalID, "newVersion", versionProposal.NewVersion, "newVersionString", xutil.ProgramVersion2Str(versionProposal.NewVersion)) } diff --git a/x/xcom/common_config.go b/x/xcom/common_config.go index f17d0dff54..afcbeb57f9 100644 --- a/x/xcom/common_config.go +++ b/x/xcom/common_config.go @@ -20,11 +20,12 @@ import ( "encoding/json" "errors" "fmt" - "github.com/PlatONnetwork/PlatON-Go/params" - "github.com/PlatONnetwork/PlatON-Go/rlp" "math/big" "sync" + "github.com/PlatONnetwork/PlatON-Go/params" + "github.com/PlatONnetwork/PlatON-Go/rlp" + "github.com/PlatONnetwork/PlatON-Go/log" "github.com/PlatONnetwork/PlatON-Go/common" @@ -69,6 +70,8 @@ const ( ElectionBasePIP3 = 43 MainNetECHash = "0x259176769541cdb61bc19806cbf5a3f3489f4829b6b69f804f45f947a0c9c3e9" + + MaxValidatorsForVersion150 = 225 ) var (