Skip to content
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: 1 addition & 1 deletion core/chainconfig_equal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/chainconfig_equal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func newChainConfigWithV2ConfigsForTest() *params.ChainConfig {
defaultConfig := &params.V2Config{
MaxMasternodes: 18,
MaxProtectorNodes: 3,
MaxObverserNodes: 2,
MaxObserverNodes: 2,
SwitchRound: 0,
MinePeriod: 2,
TimeoutSyncThreshold: 3,
Expand Down
2 changes: 1 addition & 1 deletion eth/hooks/engine_v2_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion params/config_backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion params/config_compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion params/config_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ func TestV2ConsensusConfigEqualCoversConsensusFields(t *testing.T) {
{
name: "max observer nodes",
mutate: func(cfg *V2Config) {
cfg.MaxObverserNodes++
cfg.MaxObserverNodes++
},
},
{
Expand Down
6 changes: 3 additions & 3 deletions params/config_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ var (
SwitchRound: 0,
MaxMasternodes: 108,
MaxProtectorNodes: 0,
MaxObverserNodes: 0,
MaxObserverNodes: 0,
CertThreshold: 0.667,
TimeoutSyncThreshold: 3,
TimeoutPeriod: 10,
Expand All @@ -165,7 +165,7 @@ var (
SwitchRound: 50000,
MaxMasternodes: 108,
MaxProtectorNodes: 324,
MaxObverserNodes: 2000,
MaxObserverNodes: 2000,
CertThreshold: 0.667,
TimeoutSyncThreshold: 3,
TimeoutPeriod: 10,
Expand Down Expand Up @@ -214,7 +214,7 @@ var (
900: {
MaxMasternodes: 20,
MaxProtectorNodes: 17,
MaxObverserNodes: 1,
MaxObserverNodes: 1,
SwitchRound: 900,
CertThreshold: 0.667,
TimeoutSyncThreshold: 4,
Expand Down
8 changes: 4 additions & 4 deletions params/config_xdpos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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 &&
Expand Down Expand Up @@ -542,7 +542,7 @@ func (c *V2Config) String() string {
return "V2Config: <nil>"
}

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
Expand Down
Loading