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

Clean up EnableDualQuorums flag #656

Merged
merged 1 commit into from
Jul 24, 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
9 changes: 2 additions & 7 deletions disperser/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -964,13 +964,8 @@ func (s *DispersalServer) validateRequestAndGetBlob(ctx context.Context, req *pb
if _, ok := seenQuorums[quorumID]; ok {
return nil, fmt.Errorf("custom_quorum_numbers should not include the required quorums %v, but required quorum %d was found", quorumConfig.RequiredQuorums, quorumID)
}
if s.serverConfig.EnableDualQuorums {
seenQuorums[quorumID] = struct{}{}
} else if quorumID == 0 {
// If dual quorum staking is not enabled, we only consider the quorum 0 as the
// required quorum.
seenQuorums[quorumID] = struct{}{}
}

seenQuorums[quorumID] = struct{}{}
}

if len(seenQuorums) == 0 {
Expand Down
5 changes: 2 additions & 3 deletions disperser/cmd/apiserver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ func NewConfig(ctx *cli.Context) (Config, error) {
config := Config{
AwsClientConfig: aws.ReadClientConfig(ctx, flags.FlagPrefix),
ServerConfig: disperser.ServerConfig{
GrpcPort: ctx.GlobalString(flags.GrpcPortFlag.Name),
GrpcTimeout: ctx.GlobalDuration(flags.GrpcTimeoutFlag.Name),
EnableDualQuorums: ctx.GlobalBool(flags.EnableDualQuorums.Name),
GrpcPort: ctx.GlobalString(flags.GrpcPortFlag.Name),
GrpcTimeout: ctx.GlobalDuration(flags.GrpcTimeoutFlag.Name),
},
BlobstoreConfig: blobstore.Config{
BucketName: ctx.GlobalString(flags.S3BucketNameFlag.Name),
Expand Down
7 changes: 0 additions & 7 deletions disperser/cmd/apiserver/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ var (
EnvVar: common.PrefixEnvVar(envVarPrefix, "RATE_BUCKET_STORE_SIZE"),
Required: false,
}
EnableDualQuorums = cli.BoolTFlag{
Name: common.PrefixFlag(FlagPrefix, "enable-dual-quorums"),
Usage: "Whether to enable dual quorum staking. If false, only quorum 0 is used as required quorum",
Required: false,
EnvVar: common.PrefixEnvVar(envVarPrefix, "ENABLE_DUAL_QUORUMS"),
}
)

var requiredFlags = []cli.Flag{
Expand All @@ -110,7 +104,6 @@ var optionalFlags = []cli.Flag{
EnableRatelimiter,
BucketStoreSize,
GrpcTimeoutFlag,
EnableDualQuorums,
}

// Flags contains the list of configuration options available to the binary.
Expand Down
5 changes: 0 additions & 5 deletions disperser/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@ const (
type ServerConfig struct {
GrpcPort string
GrpcTimeout time.Duration

// Feature flags
// Whether enable the dual quorums.
// If false, only quorum 0 will be used as required quorum.
EnableDualQuorums bool
}
Loading