Documentation
¶
Index ¶
- Variables
- type DisabledDB
- func (d *DisabledDB) Close() error
- func (d *DisabledDB) Enabled() bool
- func (d *DisabledDB) FirstEntry(_ context.Context) (l1 eth.BlockID, safeHead eth.BlockID, err error)
- func (d *DisabledDB) L1AtSafeHead(_ context.Context, _ uint64) (l1 eth.BlockID, safeHead eth.BlockID, err error)
- func (d *DisabledDB) LastEntry(_ context.Context) (l1 eth.BlockID, safeHead eth.BlockID, err error)
- func (d *DisabledDB) SafeHeadAtL1(_ context.Context, _ uint64) (l1 eth.BlockID, safeHead eth.BlockID, err error)
- func (d *DisabledDB) SafeHeadReset(_ eth.L2BlockRef) error
- func (d *DisabledDB) SafeHeadUpdated(_ eth.L2BlockRef, _ eth.BlockID) error
- type SafeDB
- func (d *SafeDB) Close() error
- func (d *SafeDB) Enabled() bool
- func (d *SafeDB) FirstEntry(ctx context.Context) (l1Block eth.BlockID, safeHead eth.BlockID, err error)
- func (d *SafeDB) L1AtSafeHead(ctx context.Context, targetL2Num uint64) (l1 eth.BlockID, safeHead eth.BlockID, err error)
- func (d *SafeDB) LastEntry(ctx context.Context) (l1Block eth.BlockID, safeHead eth.BlockID, err error)
- func (d *SafeDB) SafeHeadAtL1(ctx context.Context, l1BlockNum uint64) (l1Block eth.BlockID, safeHead eth.BlockID, err error)
- func (d *SafeDB) SafeHeadReset(safeHead eth.L2BlockRef) error
- func (d *SafeDB) SafeHeadUpdated(safeHead eth.L2BlockRef, l1Head eth.BlockID) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Disabled = &DisabledDB{} ErrNotEnabled = errors.New("safe head database not enabled") )
View Source
var ( ErrNotFound = errors.New("not found") ErrInvalidEntry = errors.New("invalid db entry") ErrClosed = errors.New("safe db closed") // ErrL1AtSafeHeadNotFound is transient: target above latest, or DB empty. ErrL1AtSafeHeadNotFound = errors.New("l1 at safe head not found") ErrL1AtSafeHeadUnavailable = errors.New("l1 at safe head history unavailable") )
Functions ¶
This section is empty.
Types ¶
type DisabledDB ¶
type DisabledDB struct{}
func (*DisabledDB) Close ¶
func (d *DisabledDB) Close() error
func (*DisabledDB) Enabled ¶
func (d *DisabledDB) Enabled() bool
func (*DisabledDB) FirstEntry ¶ added in v1.19.0
func (*DisabledDB) L1AtSafeHead ¶ added in v1.19.0
func (*DisabledDB) SafeHeadAtL1 ¶
func (*DisabledDB) SafeHeadReset ¶
func (d *DisabledDB) SafeHeadReset(_ eth.L2BlockRef) error
func (*DisabledDB) SafeHeadUpdated ¶
func (d *DisabledDB) SafeHeadUpdated(_ eth.L2BlockRef, _ eth.BlockID) error
type SafeDB ¶
type SafeDB struct {
// contains filtered or unexported fields
}
func (*SafeDB) FirstEntry ¶ added in v1.19.0
func (*SafeDB) L1AtSafeHead ¶ added in v1.19.0
func (d *SafeDB) L1AtSafeHead(ctx context.Context, targetL2Num uint64) (l1 eth.BlockID, safeHead eth.BlockID, err error)
L1AtSafeHead returns the earliest L1 block at which the recorded L2 safe head reached at least targetL2Num, along with the L2 safe head recorded at that L1. Each SafeDB entry records a real deriver-emitted transition, so the answer is exact when target is within recorded history.
func (*SafeDB) LastEntry ¶ added in v1.19.1
func (d *SafeDB) LastEntry(ctx context.Context) (l1Block eth.BlockID, safeHead eth.BlockID, err error)
LastEntry returns the highest recorded (L1, L2 safe head) pair, i.e. the safedb tip. Returns ErrNotFound when no entries exist yet.
func (*SafeDB) SafeHeadAtL1 ¶
func (*SafeDB) SafeHeadReset ¶
func (d *SafeDB) SafeHeadReset(safeHead eth.L2BlockRef) error
func (*SafeDB) SafeHeadUpdated ¶
Click to show internal directories.
Click to hide internal directories.