Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidId is returned when the chain id is invalid ErrInvalidID = errors.New("invalid chain id") // ErrQueueFull is returned when the batch queue has reached its maximum size ErrQueueFull = errors.New("sequencer queue full") )
View Source
var ErrCheckpointNotFound = errors.New("checkpoint not found")
ErrCheckpointNotFound is returned when no checkpoint exists in the datastore
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
// DAHeight is the DA block height we're currently processing or have just finished
DAHeight uint64
// TxIndex is the index of the next transaction to process within the DA block's forced inclusion batch
// If TxIndex == 0, it means we've finished processing the previous DA block and should fetch the next one
TxIndex uint64
}
Checkpoint tracks the position in the DA where we last processed transactions
type CheckpointStore ¶
type CheckpointStore struct {
// contains filtered or unexported fields
}
CheckpointStore manages persistence of the checkpoint
func NewCheckpointStore ¶
func NewCheckpointStore(db ds.Batching, checkpointkey ds.Key) *CheckpointStore
NewCheckpointStore creates a new checkpoint store
func (*CheckpointStore) Delete ¶
func (cs *CheckpointStore) Delete(ctx context.Context) error
Delete removes the checkpoint from the datastore
func (*CheckpointStore) Load ¶
func (cs *CheckpointStore) Load(ctx context.Context) (*Checkpoint, error)
Load loads the checkpoint from the datastore Returns ErrCheckpointNotFound if no checkpoint exists
func (*CheckpointStore) Save ¶
func (cs *CheckpointStore) Save(ctx context.Context, checkpoint *Checkpoint) error
Save persists the checkpoint to the datastore
Click to show internal directories.
Click to hide internal directories.