From d5ff8b0bf36a60b6861c77aa2a8736916f9a98c4 Mon Sep 17 00:00:00 2001 From: Juan Palacios Date: Mon, 22 May 2023 17:25:55 +1000 Subject: [PATCH 1/2] Write the value from the genesis '--min-validator-count' flag to the genesis.json output --- command/genesis/polybft_params.go | 1 + consensus/polybft/polybft_config.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/command/genesis/polybft_params.go b/command/genesis/polybft_params.go index f8a52c800d..44919807be 100644 --- a/command/genesis/polybft_params.go +++ b/command/genesis/polybft_params.go @@ -133,6 +133,7 @@ func (p *genesisParams) generatePolyBftChainConfig(o command.OutputFormatter) er Governance: initialValidators[0].Address, InitialTrieRoot: types.StringToHash(p.initialStateRoot), NativeTokenConfig: p.nativeTokenConfig, + MinValidatorSetSize: p.minNumValidators, MaxValidatorSetSize: p.maxNumValidators, RewardConfig: &polybft.RewardsConfig{ TokenAddress: rewardTokenAddr, diff --git a/consensus/polybft/polybft_config.go b/consensus/polybft/polybft_config.go index 84f7629aaa..393b332a8c 100644 --- a/consensus/polybft/polybft_config.go +++ b/consensus/polybft/polybft_config.go @@ -43,6 +43,9 @@ type PolyBFTConfig struct { // SupernetID indicates ID of given supernet generated by stake manager contract SupernetID int64 `json:"supernetID"` + // MaxValidatorSetSize indicates the maximum size of validator set + MinValidatorSetSize uint64 `json:"minValidatorSetSize"` + // MaxValidatorSetSize indicates the maximum size of validator set MaxValidatorSetSize uint64 `json:"maxValidatorSetSize"` From 6d6f3e5f1cb7892a7930411fb5659600bd61aed5 Mon Sep 17 00:00:00 2001 From: jp-imx <109574657+jp-imx@users.noreply.github.com> Date: Tue, 23 May 2023 16:52:20 +1000 Subject: [PATCH 2/2] Update comment on MinValidatorSetSize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stefan Negovanović <93934272+Stefan-Ethernal@users.noreply.github.com> --- consensus/polybft/polybft_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/polybft/polybft_config.go b/consensus/polybft/polybft_config.go index 393b332a8c..b7b2e424d8 100644 --- a/consensus/polybft/polybft_config.go +++ b/consensus/polybft/polybft_config.go @@ -43,7 +43,7 @@ type PolyBFTConfig struct { // SupernetID indicates ID of given supernet generated by stake manager contract SupernetID int64 `json:"supernetID"` - // MaxValidatorSetSize indicates the maximum size of validator set + // MinValidatorSetSize indicates the minimum size of validator set MinValidatorSetSize uint64 `json:"minValidatorSetSize"` // MaxValidatorSetSize indicates the maximum size of validator set