Skip to content

Commit

Permalink
traffic gen blobs in multiple quorums
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim committed Mar 18, 2024
1 parent 39aa5ac commit c40759e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
4 changes: 0 additions & 4 deletions tools/traffic/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ type Config struct {
NumInstances uint
RequestInterval time.Duration
DataSize uint64
ConfirmationThreshold uint8
AdversarialThreshold uint8
LoggingConfig common.LoggerConfig
RandomizeBlobs bool
InstanceLaunchInterval time.Duration
Expand All @@ -37,8 +35,6 @@ func NewConfig(ctx *cli.Context) (*Config, error) {
NumInstances: ctx.GlobalUint(flags.NumInstancesFlag.Name),
RequestInterval: ctx.Duration(flags.RequestIntervalFlag.Name),
DataSize: ctx.GlobalUint64(flags.DataSizeFlag.Name),
ConfirmationThreshold: uint8(ctx.GlobalUint(flags.QuorumThresholdFlag.Name)),
AdversarialThreshold: uint8(ctx.GlobalUint(flags.AdversarialThresholdFlag.Name)),
LoggingConfig: *loggerConfig,
RandomizeBlobs: ctx.GlobalBool(flags.RandomizeBlobsFlag.Name),
InstanceLaunchInterval: ctx.Duration(flags.InstanceLaunchIntervalFlag.Name),
Expand Down
14 changes: 0 additions & 14 deletions tools/traffic/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,6 @@ var (
Required: true,
EnvVar: common.PrefixEnvVar(envPrefix, "DATA_SIZE"),
}
AdversarialThresholdFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "adv-threshold"),
Usage: "Adversarial threshold between 0 and 100",
Required: true,
EnvVar: common.PrefixEnvVar(envPrefix, "ADV_THRESHOLD"),
}
QuorumThresholdFlag = cli.StringFlag{
Name: common.PrefixFlag(FlagPrefix, "quorum-threshold"),
Usage: "Quorum threshold between 0 and 100",
Required: true,
EnvVar: common.PrefixEnvVar(envPrefix, "QUORUM_THRESHOLD"),
}
RandomizeBlobsFlag = cli.BoolFlag{
Name: common.PrefixFlag(FlagPrefix, "randomize-blobs"),
Usage: "Whether to randomzie blob data",
Expand Down Expand Up @@ -92,8 +80,6 @@ var requiredFlags = []cli.Flag{
NumInstancesFlag,
RequestIntervalFlag,
DataSizeFlag,
AdversarialThresholdFlag,
QuorumThresholdFlag,
}

var optionalFlags = []cli.Flag{
Expand Down
6 changes: 3 additions & 3 deletions tools/traffic/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ func (g *TrafficGenerator) StartTraffic(ctx context.Context) error {
return err
}
}
err := g.sendRequest(ctx, data, 0)
err := g.sendRequest(ctx, data)
if err != nil {
g.Logger.Error("failed to send blob request", "err:", err)
}
}
}
}

func (g *TrafficGenerator) sendRequest(ctx context.Context, data []byte, quorumID uint8) error {
func (g *TrafficGenerator) sendRequest(ctx context.Context, data []byte) error {
ctxTimeout, cancel := context.WithTimeout(ctx, g.Config.Timeout)
defer cancel()
blobStatus, key, err := g.DisperserClient.DisperseBlob(ctxTimeout, data, []uint8{quorumID})
blobStatus, key, err := g.DisperserClient.DisperseBlob(ctxTimeout, data, []uint8{})
if err != nil {
return err
}
Expand Down

0 comments on commit c40759e

Please sign in to comment.