Skip to content

Commit

Permalink
Clean up EnableDualQuorums flag (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim authored Jul 24, 2024
1 parent 3285f41 commit 55f9dd9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
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
}

0 comments on commit 55f9dd9

Please sign in to comment.