From 03f4f2c81815d7bc9028a0a3016eec6a025d80f9 Mon Sep 17 00:00:00 2001 From: wanwiset25 Date: Sat, 4 Jul 2026 06:09:00 +0700 Subject: [PATCH] fix typo MaxObverserNodes > MaxObserverNodes --- core/chainconfig_equal.go | 2 +- core/chainconfig_equal_test.go | 2 +- eth/hooks/engine_v2_hooks.go | 2 +- params/config_backfill.go | 2 +- params/config_compat.go | 2 +- params/config_compat_test.go | 2 +- params/config_networks.go | 6 +++--- params/config_xdpos.go | 8 ++++---- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/chainconfig_equal.go b/core/chainconfig_equal.go index 44adf6d4f959..1aa43650281b 100644 --- a/core/chainconfig_equal.go +++ b/core/chainconfig_equal.go @@ -215,7 +215,7 @@ func (d *chainConfigDigest) writeV2Config(cfg *params.V2Config) { } d.writeInt(cfg.MaxMasternodes) d.writeInt(cfg.MaxProtectorNodes) - d.writeInt(cfg.MaxObverserNodes) + d.writeInt(cfg.MaxObserverNodes) d.writeUint64(cfg.SwitchRound) d.writeInt(cfg.MinePeriod) d.writeInt(cfg.TimeoutSyncThreshold) diff --git a/core/chainconfig_equal_test.go b/core/chainconfig_equal_test.go index 01971577aa9b..1d91df713f08 100644 --- a/core/chainconfig_equal_test.go +++ b/core/chainconfig_equal_test.go @@ -424,7 +424,7 @@ func newChainConfigWithV2ConfigsForTest() *params.ChainConfig { defaultConfig := ¶ms.V2Config{ MaxMasternodes: 18, MaxProtectorNodes: 3, - MaxObverserNodes: 2, + MaxObserverNodes: 2, SwitchRound: 0, MinePeriod: 2, TimeoutSyncThreshold: 3, diff --git a/eth/hooks/engine_v2_hooks.go b/eth/hooks/engine_v2_hooks.go index f35c7f1ce396..878c36758be0 100644 --- a/eth/hooks/engine_v2_hooks.go +++ b/eth/hooks/engine_v2_hooks.go @@ -508,7 +508,7 @@ func GetSigningTxCount(c *XDPoS.XDPoS, chain consensus.ChainReader, header *type } if len(protector) < currentConfig.MaxProtectorNodes { protector = append(protector, node.Address) - } else if len(observer) < currentConfig.MaxObverserNodes { + } else if len(observer) < currentConfig.MaxObserverNodes { observer = append(observer, node.Address) } } diff --git a/params/config_backfill.go b/params/config_backfill.go index 4ed56a4004e9..2b5a9926fb4b 100644 --- a/params/config_backfill.go +++ b/params/config_backfill.go @@ -753,7 +753,7 @@ func (c *V2Config) backfillMissingScalarFieldsFrom(src *V2Config) { }{ {"maxMasternodes", &c.MaxMasternodes, src.MaxMasternodes}, {"maxProtectorNodes", &c.MaxProtectorNodes, src.MaxProtectorNodes}, - {"maxObserverNodes", &c.MaxObverserNodes, src.MaxObverserNodes}, + {"maxObserverNodes", &c.MaxObserverNodes, src.MaxObserverNodes}, {"minePeriod", &c.MinePeriod, src.MinePeriod}, {"timeoutSyncThreshold", &c.TimeoutSyncThreshold, src.TimeoutSyncThreshold}, {"timeoutPeriod", &c.TimeoutPeriod, src.TimeoutPeriod}, diff --git a/params/config_compat.go b/params/config_compat.go index deff2d163cea..7acfe5f7da84 100644 --- a/params/config_compat.go +++ b/params/config_compat.go @@ -252,7 +252,7 @@ func v2ConsensusConfigEqual(a, b *V2Config) bool { if a.MaxProtectorNodes != b.MaxProtectorNodes { return false } - if a.MaxObverserNodes != b.MaxObverserNodes { + if a.MaxObserverNodes != b.MaxObserverNodes { return false } if a.SwitchRound != b.SwitchRound { diff --git a/params/config_compat_test.go b/params/config_compat_test.go index 5357491dde44..c0bef49a103e 100644 --- a/params/config_compat_test.go +++ b/params/config_compat_test.go @@ -628,7 +628,7 @@ func TestV2ConsensusConfigEqualCoversConsensusFields(t *testing.T) { { name: "max observer nodes", mutate: func(cfg *V2Config) { - cfg.MaxObverserNodes++ + cfg.MaxObserverNodes++ }, }, { diff --git a/params/config_networks.go b/params/config_networks.go index 41d7e66d773b..942d15b0ca07 100644 --- a/params/config_networks.go +++ b/params/config_networks.go @@ -148,7 +148,7 @@ var ( SwitchRound: 0, MaxMasternodes: 108, MaxProtectorNodes: 0, - MaxObverserNodes: 0, + MaxObserverNodes: 0, CertThreshold: 0.667, TimeoutSyncThreshold: 3, TimeoutPeriod: 10, @@ -165,7 +165,7 @@ var ( SwitchRound: 50000, MaxMasternodes: 108, MaxProtectorNodes: 324, - MaxObverserNodes: 2000, + MaxObserverNodes: 2000, CertThreshold: 0.667, TimeoutSyncThreshold: 3, TimeoutPeriod: 10, @@ -214,7 +214,7 @@ var ( 900: { MaxMasternodes: 20, MaxProtectorNodes: 17, - MaxObverserNodes: 1, + MaxObserverNodes: 1, SwitchRound: 900, CertThreshold: 0.667, TimeoutSyncThreshold: 4, diff --git a/params/config_xdpos.go b/params/config_xdpos.go index db8aa837b041..0c051b871385 100644 --- a/params/config_xdpos.go +++ b/params/config_xdpos.go @@ -127,7 +127,7 @@ type V2 struct { type V2Config struct { MaxMasternodes int `json:"maxMasternodes"` // v2 max masternodes MaxProtectorNodes int `json:"maxProtectorNodes"` // v2 max ProtectorNodes - MaxObverserNodes int `json:"maxObserverNodes"` // v2 max ObserverNodes + MaxObserverNodes int `json:"maxObserverNodes"` // v2 max ObserverNodes SwitchRound uint64 `json:"switchRound"` // v1 to v2 switch block number MinePeriod int `json:"minePeriod"` // Miner mine period to mine a block TimeoutSyncThreshold int `json:"timeoutSyncThreshold"` // send syncInfo after number of timeout @@ -262,7 +262,7 @@ func (c *V2Config) cloneWithInferredFieldPresence() *V2Config { }{ {"maxMasternodes", clone.MaxMasternodes}, {"maxProtectorNodes", clone.MaxProtectorNodes}, - {"maxObserverNodes", clone.MaxObverserNodes}, + {"maxObserverNodes", clone.MaxObserverNodes}, {"minePeriod", clone.MinePeriod}, {"timeoutSyncThreshold", clone.TimeoutSyncThreshold}, {"timeoutPeriod", clone.TimeoutPeriod}, @@ -468,7 +468,7 @@ func sameV2RuntimeConfig(a, b *V2Config) bool { } return a.MaxMasternodes == b.MaxMasternodes && a.MaxProtectorNodes == b.MaxProtectorNodes && - a.MaxObverserNodes == b.MaxObverserNodes && + a.MaxObserverNodes == b.MaxObserverNodes && a.SwitchRound == b.SwitchRound && a.MinePeriod == b.MinePeriod && a.TimeoutSyncThreshold == b.TimeoutSyncThreshold && @@ -542,7 +542,7 @@ func (c *V2Config) String() string { return "V2Config: " } - return fmt.Sprintf("V2{MaxMasternodes: %v, MaxProtectorNodes: %v, MaxObverserNodes: %v, SwitchRound: %v, MinePeriod: %v, TimeoutSyncThreshold: %v, TimeoutPeriod: %v, CertThreshold: %v, MasternodeReward: %v, ProtectorReward: %v, ObserverReward: %v, MinimumMinerBlockPerEpoch: %v, LimitPenaltyEpoch: %v, MinimumSigningTx: %v, %s}", c.MaxMasternodes, c.MaxProtectorNodes, c.MaxObverserNodes, c.SwitchRound, c.MinePeriod, c.TimeoutSyncThreshold, c.TimeoutPeriod, c.CertThreshold, c.MasternodeReward, c.ProtectorReward, c.ObserverReward, c.MinimumMinerBlockPerEpoch, c.LimitPenaltyEpoch, c.MinimumSigningTx, c.ExpTimeoutConfig.String()) + return fmt.Sprintf("V2{MaxMasternodes: %v, MaxProtectorNodes: %v, MaxObserverNodes: %v, SwitchRound: %v, MinePeriod: %v, TimeoutSyncThreshold: %v, TimeoutPeriod: %v, CertThreshold: %v, MasternodeReward: %v, ProtectorReward: %v, ObserverReward: %v, MinimumMinerBlockPerEpoch: %v, LimitPenaltyEpoch: %v, MinimumSigningTx: %v, %s}", c.MaxMasternodes, c.MaxProtectorNodes, c.MaxObserverNodes, c.SwitchRound, c.MinePeriod, c.TimeoutSyncThreshold, c.TimeoutPeriod, c.CertThreshold, c.MasternodeReward, c.ProtectorReward, c.ObserverReward, c.MinimumMinerBlockPerEpoch, c.LimitPenaltyEpoch, c.MinimumSigningTx, c.ExpTimeoutConfig.String()) } // Description returns a human-readable description of V2Config