Documentation ¶
Index ¶
- Variables
- func WithRootBlocksEvictionDelay(delay slot.Index) options.Option[State]
- type Events
- type State
- func (s *State) AddRootBlock(id models.BlockID, commitmentID commitment.ID)
- func (s *State) EarliestRootCommitmentID() (earliestCommitment commitment.ID)
- func (s *State) EvictUntil(index slot.Index)
- func (s *State) Export(writer io.WriteSeeker, evictedSlot slot.Index) (err error)
- func (s *State) Import(reader io.ReadSeeker) (err error)
- func (s *State) InEvictedSlot(id models.BlockID) bool
- func (s *State) IsRootBlock(id models.BlockID) (has bool)
- func (s *State) LastEvictedSlot() slot.Index
- func (s *State) LatestRootBlocks() models.BlockIDs
- func (s *State) PopulateFromStorage(latestCommitmentIndex slot.Index)
- func (s *State) RemoveRootBlock(id models.BlockID)
Constants ¶
This section is empty.
Variables ¶
var NewEvents = event.CreateGroupConstructor(func() (self *Events) { return &Events{ SlotEvicted: event.New1[slot.Index](), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
Types ¶
type State ¶
type State struct { Events *Events // contains filtered or unexported fields }
State represents the state of the eviction and keeps track of the root blocks.
func (*State) AddRootBlock ¶
func (s *State) AddRootBlock(id models.BlockID, commitmentID commitment.ID)
AddRootBlock inserts a solid entry point to the seps map.
func (*State) EarliestRootCommitmentID ¶
func (s *State) EarliestRootCommitmentID() (earliestCommitment commitment.ID)
EarliestRootCommitmentID returns the earliest commitment that rootblocks are committing to across all rootblocks.
func (*State) EvictUntil ¶
EvictUntil triggers the SlotEvicted event for every evicted slot and evicts all root blocks until the delayed root blocks eviction threshold.
func (*State) Import ¶
func (s *State) Import(reader io.ReadSeeker) (err error)
Import imports the root blocks from the given reader.
func (*State) InEvictedSlot ¶
InEvictedSlot checks if the Block associated with the given id is too old (in a pruned slot).
func (*State) IsRootBlock ¶
IsRootBlock returns true if the given block is a root block.
func (*State) LastEvictedSlot ¶
LastEvictedSlot returns the last evicted slot.
func (*State) LatestRootBlocks ¶
LatestRootBlocks returns the latest root blocks.
func (*State) PopulateFromStorage ¶
PopulateFromStorage populates the root blocks from the storage.
func (*State) RemoveRootBlock ¶
RemoveRootBlock removes a solid entry points from the map.