Documentation ¶
Index ¶
- type AtxCache
- type BlobStore
- type CachedDB
- func (db *CachedDB) GetAtxHeader(id types.ATXID) (*types.ActivationTxHeader, error)
- func (db *CachedDB) GetEpochWeight(epoch types.EpochID) (uint64, []types.ATXID, error)
- func (db *CachedDB) GetFullAtx(id types.ATXID) (*types.VerifiedActivationTx, error)
- func (db *CachedDB) GetPrevAtx(nodeID types.NodeID) (*types.ActivationTxHeader, error)
- func (db *CachedDB) IterateEpochATXHeaders(epoch types.EpochID, iter func(*types.ActivationTxHeader) bool) error
- type Getter
- type Hint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtxCache ¶
AtxCache holds an lru cache of ActivationTxHeader structs of recent atx used to calculate active set size ideally this cache will hold the atxs created in latest epoch, on which most of active set size calculation will be performed.
func NewAtxCache ¶
NewAtxCache creates a new cache for activation transaction headers.
type BlobStore ¶
BlobStore gets data as a blob to serve direct fetch requests.
func NewBlobStore ¶
NewBlobStore returns a BlobStore.
type CachedDB ¶
CachedDB is simply a database injected with cache.
func NewCachedDB ¶
NewCachedDB create an instance of a CachedDB.
func (*CachedDB) GetAtxHeader ¶
GetAtxHeader returns the ATX header by the given ID. This function is thread safe and will return an error if the ID is not found in the ATX DB.
func (*CachedDB) GetEpochWeight ¶
GetEpochWeight returns the total weight of ATXs targeting the given epochID.
func (*CachedDB) GetFullAtx ¶
GetFullAtx returns the full atx struct of the given atxId id, it returns an error if the full atx cannot be found in all databases.
func (*CachedDB) GetPrevAtx ¶
GetPrevAtx gets the last atx header of specified node Id, it returns error if no previous atx found or if no AtxHeader struct in db.
func (*CachedDB) IterateEpochATXHeaders ¶
func (db *CachedDB) IterateEpochATXHeaders(epoch types.EpochID, iter func(*types.ActivationTxHeader) bool) error
IterateEpochATXHeaders iterates over ActivationTxs that target an epoch.