Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate SnowRogueCommitThresholdKey and SnowVirtuousCommitThresholdKey #2600

Merged
merged 6 commits into from
Jan 11, 2024
Merged
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
23 changes: 12 additions & 11 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ var (
ConsensusGossipOnAcceptValidatorSizeKey: acceptedFrontierGossipDeprecationMsg,
ConsensusGossipOnAcceptNonValidatorSizeKey: acceptedFrontierGossipDeprecationMsg,
ConsensusGossipOnAcceptPeerSizeKey: acceptedFrontierGossipDeprecationMsg,

SnowRogueCommitThresholdKey: fmt.Sprintf("use --%s instead", SnowCommitThresholdKey),
SnowVirtuousCommitThresholdKey: fmt.Sprintf("use --%s instead", SnowCommitThresholdKey),
}

errConflictingACPOpinion = errors.New("supporting and objecting to the same ACP")
Expand Down Expand Up @@ -106,17 +109,11 @@ var (

func getConsensusConfig(v *viper.Viper) snowball.Parameters {
p := snowball.Parameters{
K: v.GetInt(SnowSampleSizeKey),
AlphaPreference: v.GetInt(SnowPreferenceQuorumSizeKey),
AlphaConfidence: v.GetInt(SnowConfidenceQuorumSizeKey),
// During the X-chain linearization we require BetaVirtuous and
// BetaRogue to be equal. Therefore we use the more conservative
// BetaRogue value for both BetaVirtuous and BetaRogue.
//
// TODO: After the X-chain linearization use the
// SnowVirtuousCommitThresholdKey as before.
BetaVirtuous: v.GetInt(SnowRogueCommitThresholdKey),
BetaRogue: v.GetInt(SnowRogueCommitThresholdKey),
K: v.GetInt(SnowSampleSizeKey),
AlphaPreference: v.GetInt(SnowPreferenceQuorumSizeKey),
AlphaConfidence: v.GetInt(SnowConfidenceQuorumSizeKey),
BetaVirtuous: v.GetInt(SnowCommitThresholdKey),
BetaRogue: v.GetInt(SnowCommitThresholdKey),
ConcurrentRepolls: v.GetInt(SnowConcurrentRepollsKey),
OptimalProcessing: v.GetInt(SnowOptimalProcessingKey),
MaxOutstandingItems: v.GetInt(SnowMaxProcessingKey),
Expand All @@ -126,6 +123,10 @@ func getConsensusConfig(v *viper.Viper) snowball.Parameters {
p.AlphaPreference = v.GetInt(SnowQuorumSizeKey)
p.AlphaConfidence = p.AlphaPreference
}
if v.IsSet(SnowRogueCommitThresholdKey) {
p.BetaVirtuous = v.GetInt(SnowRogueCommitThresholdKey)
p.BetaRogue = v.GetInt(SnowRogueCommitThresholdKey)
}
return p
}

Expand Down
6 changes: 4 additions & 2 deletions config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,12 @@ func addNodeFlags(fs *pflag.FlagSet) {
fs.Int(SnowQuorumSizeKey, snowball.DefaultParameters.AlphaConfidence, "Threshold of nodes required to update this node's preference and increase its confidence in a network poll")
fs.Int(SnowPreferenceQuorumSizeKey, snowball.DefaultParameters.AlphaPreference, fmt.Sprintf("Threshold of nodes required to update this node's preference in a network poll. Ignored if %s is provided", SnowQuorumSizeKey))
fs.Int(SnowConfidenceQuorumSizeKey, snowball.DefaultParameters.AlphaConfidence, fmt.Sprintf("Threshold of nodes required to increase this node's confidence in a network poll. Ignored if %s is provided", SnowQuorumSizeKey))
// TODO: Replace this temporary flag description after the X-chain
// linearization with "Beta value to use for virtuous transactions"

fs.Int(SnowCommitThresholdKey, snowball.DefaultParameters.BetaRogue, "Beta value to use for transactions")
// TODO: Remove these once enough time has passed with SnowCommitThresholdKey
fs.Int(SnowVirtuousCommitThresholdKey, snowball.DefaultParameters.BetaVirtuous, "This flag is temporarily ignored due to the X-chain linearization")
fs.Int(SnowRogueCommitThresholdKey, snowball.DefaultParameters.BetaRogue, "Beta value to use for rogue transactions")

fs.Int(SnowConcurrentRepollsKey, snowball.DefaultParameters.ConcurrentRepolls, "Minimum number of concurrent polls for finalizing consensus")
fs.Int(SnowOptimalProcessingKey, snowball.DefaultParameters.OptimalProcessing, "Optimal number of processing containers in consensus")
fs.Int(SnowMaxProcessingKey, snowball.DefaultParameters.MaxOutstandingItems, "Maximum number of processing items to be considered healthy")
Expand Down
1 change: 1 addition & 0 deletions config/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const (
SnowConfidenceQuorumSizeKey = "snow-confidence-quorum-size"
SnowVirtuousCommitThresholdKey = "snow-virtuous-commit-threshold"
SnowRogueCommitThresholdKey = "snow-rogue-commit-threshold"
SnowCommitThresholdKey = "snow-commit-threshold"
SnowConcurrentRepollsKey = "snow-concurrent-repolls"
SnowOptimalProcessingKey = "snow-optimal-processing"
SnowMaxProcessingKey = "snow-max-processing"
Expand Down
2 changes: 1 addition & 1 deletion snow/consensus/snowball/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
K: 20,
AlphaPreference: 15,
AlphaConfidence: 15,
BetaVirtuous: 15,
BetaVirtuous: 20,
BetaRogue: 20,
ConcurrentRepolls: 4,
OptimalProcessing: 10,
Expand Down
Loading