Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainHeads ¶
type ChainHeads struct { Unsafe entrydb.EntryIdx `json:"localUnsafe"` CrossUnsafe entrydb.EntryIdx `json:"crossUnsafe"` LocalSafe entrydb.EntryIdx `json:"localSafe"` CrossSafe entrydb.EntryIdx `json:"crossSafe"` LocalFinalized entrydb.EntryIdx `json:"localFinalized"` CrossFinalized entrydb.EntryIdx `json:"crossFinalized"` }
ChainHeads provides the serialization format for the current chain heads. The values here could be block numbers or just the index of entries in the log db. If they're log db entries, we can't detect if things changed because of a reorg though (if the logdb write succeeded and head update failed). So we probably need to store actual block IDs here... but then we don't have the block hash for every block in the log db. Only jumping the head forward on checkpoint blocks doesn't work though...
type HeadTracker ¶
type HeadTracker struct {
// contains filtered or unexported fields
}
HeadTracker records the current chain head pointers for a single chain.
func NewHeadTracker ¶
func NewHeadTracker(path string) (*HeadTracker, error)
func (*HeadTracker) Apply ¶
func (t *HeadTracker) Apply(op Operation) error
func (*HeadTracker) Close ¶
func (t *HeadTracker) Close() error
func (*HeadTracker) Current ¶
func (t *HeadTracker) Current() *Heads
type Heads ¶
type Heads struct {
Chains map[types.ChainID]ChainHeads
}
func (Heads) MarshalJSON ¶
func (*Heads) UnmarshalJSON ¶
type OperationFn ¶
func (OperationFn) Apply ¶
func (f OperationFn) Apply(heads *Heads) error
Click to show internal directories.
Click to hide internal directories.