Skip to content

Commit d46db8c

Browse files
committed
feedback 2/2
1 parent e5ba965 commit d46db8c

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

sequencers/based/sequencer.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,7 @@ func (s *BasedSequencer) GetNextBatch(ctx context.Context, req coresequencer.Get
7575
if err != nil {
7676
// Check if forced inclusion is not configured
7777
if errors.Is(err, block.ErrForceInclusionNotConfigured) {
78-
s.logger.Error().Msg("forced inclusion not configured, returning empty batch")
79-
return &coresequencer.GetNextBatchResponse{
80-
Batch: &coresequencer.Batch{Transactions: nil},
81-
Timestamp: time.Now(),
82-
BatchData: req.LastBatchData,
83-
}, nil
78+
return nil, errors.New("forced inclusion not configured, returning empty batch")
8479
} else if errors.Is(err, coreda.ErrHeightFromFuture) {
8580
// If we get a height from future error, keep the current DA height and return batch
8681
// We'll retry the same height on the next call until DA produces that block

sequencers/based/sequencer_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ func TestBasedSequencer_GetNextBatch_NotConfigured(t *testing.T) {
236236
}
237237

238238
resp, err := seq.GetNextBatch(context.Background(), req)
239-
require.NoError(t, err)
240-
require.NotNil(t, resp)
241-
require.NotNil(t, resp.Batch)
242-
assert.Equal(t, 0, len(resp.Batch.Transactions))
239+
require.Error(t, err)
240+
require.Nil(t, resp)
243241
}
244242

245243
func TestBasedSequencer_GetNextBatch_WithMaxBytes(t *testing.T) {

sequencers/single/queue.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ func (bq *BatchQueue) AddBatch(ctx context.Context, batch coresequencer.Batch) e
8585

8686
// Prepend adds a batch to the front of the queue (before head position).
8787
// This is used to return transactions that couldn't fit in the current batch.
88-
// The batch is NOT persisted to the DB since these are transactions that were
89-
// already in the queue or were just processed.
88+
// TODO(@julienrbrt): The batch is currently NOT persisted to the DB since these are transactions that were already in the queue or were just processed. -- FI txs are lost, this should be tackled.
9089
func (bq *BatchQueue) Prepend(ctx context.Context, batch coresequencer.Batch) error {
9190
bq.mu.Lock()
9291
defer bq.mu.Unlock()

0 commit comments

Comments
 (0)