diff --git a/pkg/bee/client.go b/pkg/bee/client.go index 85b697e7a..f0de2350e 100644 --- a/pkg/bee/client.go +++ b/pkg/bee/client.go @@ -418,10 +418,11 @@ func (c *Client) GetOrCreateBatch(ctx context.Context, amount int64, depth uint6 if !b.Exists { continue } - max := 1 << (b.Depth - b.BucketDepth) - hasFreeSlots := b.Utilization < uint32(max) + if b.ImmutableFlag { // skip immutable batches + continue + } - if b.Usable && (b.BatchTTL == -1 || b.BatchTTL > 0) && hasFreeSlots { + if b.Usable && (b.BatchTTL == -1 || b.BatchTTL > 0) { return b.BatchID, nil } } diff --git a/pkg/check/smoke/smoke.go b/pkg/check/smoke/smoke.go index bf8185948..09423731d 100644 --- a/pkg/check/smoke/smoke.go +++ b/pkg/check/smoke/smoke.go @@ -33,7 +33,6 @@ type Options struct { UploadGroups []string DownloaderCount int DownloadGroups []string - GasPrice string MaxUseBatch time.Duration } @@ -42,15 +41,14 @@ func NewDefaultOptions() Options { return Options{ ContentSize: 5000000, RndSeed: time.Now().UnixNano(), - PostageAmount: 1000000, - PostageDepth: 20, + PostageAmount: 50_000_000, + PostageDepth: 24, TxOnErrWait: 10 * time.Second, RxOnErrWait: 10 * time.Second, NodesSyncWait: time.Second * 30, Duration: 12 * time.Hour, UploadTimeout: 5 * time.Minute, DownloadTimeout: 5 * time.Minute, - GasPrice: "100000000000", MaxUseBatch: 12 * time.Hour, } } @@ -91,8 +89,6 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int time.Sleep(5 * time.Second) // Wait for the nodes to warmup. - batches := NewStore(o.MaxUseBatch) - test := &test{clients: clients, logger: c.logger} for i := 0; true; i++ { @@ -149,15 +145,12 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int txCtx, txCancel = context.WithTimeout(ctx, o.UploadTimeout) c.metrics.BatchCreateAttempts.Inc() - batchID := batches.Get(txName) - if batchID == "" { - batchID, err = clients[txName].CreatePostageBatch(txCtx, o.PostageAmount, o.PostageDepth, "load-test", true) - if err != nil { - c.logger.Errorf("create new batch: %v", err) - c.metrics.BatchCreateErrors.Inc() - continue - } - batches.Store(txName, batchID) + + batchID, err := clients[txName].GetOrCreateBatch(txCtx, o.PostageAmount, o.PostageDepth, "load-test") + if err != nil { + c.logger.Errorf("create new batch: %v", err) + c.metrics.BatchCreateErrors.Inc() + continue } c.metrics.UploadAttempts.Inc() diff --git a/pkg/config/check.go b/pkg/config/check.go index 8060126a8..490b2c0b2 100644 --- a/pkg/config/check.go +++ b/pkg/config/check.go @@ -362,7 +362,6 @@ var Checks = map[string]CheckType{ RxOnErrWait *time.Duration `yaml:"rx-on-err-wait"` NodesSyncWait *time.Duration `yaml:"nodes-sync-wait"` Duration *time.Duration `yaml:"duration"` - MaxUseBatch *time.Duration `yaml:"max-use-batch"` }) if err := check.Options.Decode(checkOpts); err != nil { return nil, fmt.Errorf("decoding check %s options: %w", check.Type, err)