Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 4256c7f

Browse files
committed
upgrade to latest go-sequencing
1 parent 5a22bcf commit 4256c7f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/gogo/protobuf v1.3.2
99
github.com/ipfs/go-log/v2 v2.5.1
1010
github.com/rollkit/go-da v0.5.0
11-
github.com/rollkit/go-sequencing v0.0.0-20240808122718-9591858f7fc3
11+
github.com/rollkit/go-sequencing v0.0.0-20240819074615-f2daab53104d
1212
github.com/rollkit/rollkit v0.13.6
1313
)
1414

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
316316
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
317317
github.com/rollkit/go-da v0.5.0 h1:sQpZricNS+2TLx3HMjNWhtRfqtvVC/U4pWHpfUz3eN4=
318318
github.com/rollkit/go-da v0.5.0/go.mod h1:VsUeAoPvKl4Y8wWguu/VibscYiFFePkkrvZWyTjZHww=
319-
github.com/rollkit/go-sequencing v0.0.0-20240808122718-9591858f7fc3 h1:f25w4HVAfqM5EDFZ8esHg15m4qwqEt/6RlgIqZz10mo=
320-
github.com/rollkit/go-sequencing v0.0.0-20240808122718-9591858f7fc3/go.mod h1:J6E6NR7tNJ0cKBxtVHnby0hQ+S7RTayuDfG1Llwv800=
319+
github.com/rollkit/go-sequencing v0.0.0-20240819074615-f2daab53104d h1:jf1mG3Jl8jqZS8JH3jezPDVdikUBQKuDpsRhvuaRqZM=
320+
github.com/rollkit/go-sequencing v0.0.0-20240819074615-f2daab53104d/go.mod h1:J6E6NR7tNJ0cKBxtVHnby0hQ+S7RTayuDfG1Llwv800=
321321
github.com/rollkit/rollkit v0.13.6 h1:ZdIBG5D5RuQvnnJSY8s3m46dR3A3F6jHN+01zX+Avt0=
322322
github.com/rollkit/rollkit v0.13.6/go.mod h1:clM4aPsWDJk/IN/SqCBsA+ab0/8gdh+5O4hRkLWKB7s=
323323
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=

sequencing/sequencer.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (bq *BatchQueue) AddBatch(batch sequencing.Batch) {
5151
// Next ...
5252
func (bq *BatchQueue) Next() *sequencing.Batch {
5353
if len(bq.queue) == 0 {
54-
return nil
54+
return &sequencing.Batch{Transactions: nil}
5555
}
5656
batch := bq.queue[0]
5757
bq.queue = bq.queue[1:]
@@ -141,6 +141,7 @@ func NewSequencer(daAddress, daAuthToken, daNamespace string, batchTime time.Dur
141141
maxDABlobSize: maxBlobSize,
142142
tq: NewTransactionQueue(),
143143
bq: NewBatchQueue(),
144+
seenBatches: make(map[string]struct{}),
144145
}
145146
go s.batchSubmissionLoop(s.ctx)
146147
return s, nil
@@ -291,10 +292,10 @@ func (c *Sequencer) SubmitRollupTransaction(ctx context.Context, rollupId []byte
291292
// GetNextBatch implements sequencing.Sequencer.
292293
func (c *Sequencer) GetNextBatch(ctx context.Context, lastBatch *sequencing.Batch) (*sequencing.Batch, error) {
293294
if c.lastBatchHash == nil {
294-
if lastBatch != nil {
295+
if lastBatch.Transactions != nil {
295296
return nil, errors.New("lastBatch is supposed to be nil")
296297
}
297-
} else if lastBatch == nil {
298+
} else if lastBatch.Transactions == nil {
298299
return nil, errors.New("lastBatch is not supposed to be nil")
299300
} else {
300301
lastBatchBytes, err := lastBatch.Marshal()
@@ -307,8 +308,8 @@ func (c *Sequencer) GetNextBatch(ctx context.Context, lastBatch *sequencing.Batc
307308
}
308309

309310
batch := c.bq.Next()
310-
if batch == nil {
311-
return nil, nil
311+
if batch.Transactions == nil {
312+
return batch, nil
312313
}
313314

314315
batchBytes, err := batch.Marshal()

0 commit comments

Comments
 (0)