@@ -262,6 +262,18 @@ func getViper() (*viper.Viper, error) {
262262// setNodeConfig sets attributes on [Config] based on the values
263263// defined in the [viper] environment
264264func setNodeConfig (v * viper.Viper ) error {
265+ // Consensus Parameters
266+ Config .ConsensusParams .K = v .GetInt (snowSampleSizeKey )
267+ Config .ConsensusParams .Alpha = v .GetInt (snowQuorumSizeKey )
268+ Config .ConsensusParams .BetaVirtuous = v .GetInt (snowVirtuousCommitThresholdKey )
269+ Config .ConsensusParams .BetaRogue = v .GetInt (snowRogueCommitThresholdKey )
270+ Config .ConsensusParams .Parents = v .GetInt (snowAvalancheNumParentsKey )
271+ Config .ConsensusParams .BatchSize = v .GetInt (snowAvalancheBatchSizeKey )
272+ Config .ConsensusParams .ConcurrentRepolls = v .GetInt (snowConcurrentRepollsKey )
273+
274+ Config .ConsensusGossipFrequency = v .GetDuration (consensusGossipFrequencyKey )
275+ Config .ConsensusShutdownTimeout = v .GetDuration (consensusShutdownTimeoutKey )
276+
265277 // Logging:
266278 loggingConfig , err := logging .DefaultConfig ()
267279 if err != nil {
@@ -640,18 +652,6 @@ func setNodeConfig(v *viper.Viper) error {
640652 Config .Params = * genesis .GetParams (networkID )
641653 }
642654
643- // Consensus Parameters
644- Config .ConsensusParams .K = v .GetInt (snowSampleSizeKey )
645- Config .ConsensusParams .Alpha = v .GetInt (snowQuorumSizeKey )
646- Config .ConsensusParams .BetaVirtuous = v .GetInt (snowVirtuousCommitThresholdKey )
647- Config .ConsensusParams .BetaRogue = v .GetInt (snowRogueCommitThresholdKey )
648- Config .ConsensusParams .Parents = v .GetInt (snowAvalancheNumParentsKey )
649- Config .ConsensusParams .BatchSize = v .GetInt (snowAvalancheBatchSizeKey )
650- Config .ConsensusParams .ConcurrentRepolls = v .GetInt (snowConcurrentRepollsKey )
651-
652- Config .ConsensusGossipFrequency = v .GetDuration (consensusGossipFrequencyKey )
653- Config .ConsensusShutdownTimeout = v .GetDuration (consensusShutdownTimeoutKey )
654-
655655 // Assertions
656656 Config .EnableAssertions = v .GetBool (assertionsEnabledKey )
657657
0 commit comments