Skip to content

Commit e8bbd5d

Browse files
committed
docs: add comments
1 parent 0ddd32d commit e8bbd5d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sequencer.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,34 @@ import (
88
"github.com/rollkit/go-sequencing"
99
)
1010

11+
// BasedSequencer implements go-sequencing API with based sequencing logic.
12+
//
13+
// All transactions are passed directly to DA to be saved in a namespace. Each transaction is submitted as separate blob.
14+
// When batch is requested DA blocks are scanned to read all blobs from given namespace at given height.
1115
type BasedSequencer struct {
1216
da da.DA
1317
}
1418

19+
// NewSequencer initializes a BasedSequencer with the provided DA implementation.
20+
func NewSequencer(da da.DA) *BasedSequencer {
21+
return &BasedSequencer{da: da}
22+
}
23+
1524
var _ sequencing.Sequencer = (*BasedSequencer)(nil)
1625

26+
// SubmitRollupTransaction submits a transaction directly to DA, as a single blob.
1727
func (b *BasedSequencer) SubmitRollupTransaction(ctx context.Context, rollupId sequencing.RollupId, tx sequencing.Tx) error {
1828
//TODO implement me
1929
panic("implement me")
2030
}
2131

32+
// GetNextBatch reads data from namespace in DA and builds transactions batches.
2233
func (b *BasedSequencer) GetNextBatch(ctx context.Context, lastBatchHash sequencing.Hash) (*sequencing.Batch, time.Time, error) {
2334
//TODO implement me
2435
panic("implement me")
2536
}
2637

38+
// VerifyBatch ensures data-availability of a batch in DA.
2739
func (b *BasedSequencer) VerifyBatch(ctx context.Context, batchHash sequencing.Hash) (bool, error) {
2840
//TODO implement me
2941
panic("implement me")

0 commit comments

Comments
 (0)