Documentation ¶
Overview ¶
Package kv includes a key-value store implementation of an attestation cache used to satisfy important use-cases such as aggregation in a beacon node runtime.
Index ¶
- type AttCaches
- func (c *AttCaches) AggregateUnaggregatedAttestations(ctx context.Context) error
- func (c *AttCaches) AggregatedAttestationCount() int
- func (c *AttCaches) AggregatedAttestations() []ethpb.Att
- func (c *AttCaches) AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, ...) []*ethpb.Attestation
- func (c *AttCaches) AggregatedAttestationsBySlotIndexElectra(ctx context.Context, slot primitives.Slot, ...) []*ethpb.AttestationElectra
- func (c *AttCaches) BlockAttestations() []ethpb.Att
- func (c *AttCaches) DeleteAggregatedAttestation(att ethpb.Att) error
- func (c *AttCaches) DeleteBlockAttestation(att ethpb.Att) error
- func (c *AttCaches) DeleteForkchoiceAttestation(att ethpb.Att) error
- func (c *AttCaches) DeleteSeenUnaggregatedAttestations() (int, error)
- func (c *AttCaches) DeleteUnaggregatedAttestation(att ethpb.Att) error
- func (c *AttCaches) ForkchoiceAttestationCount() int
- func (c *AttCaches) ForkchoiceAttestations() []ethpb.Att
- func (c *AttCaches) HasAggregatedAttestation(att ethpb.Att) (bool, error)
- func (c *AttCaches) SaveAggregatedAttestation(att ethpb.Att) error
- func (c *AttCaches) SaveAggregatedAttestations(atts []ethpb.Att) error
- func (c *AttCaches) SaveBlockAttestation(att ethpb.Att) error
- func (c *AttCaches) SaveForkchoiceAttestation(att ethpb.Att) error
- func (c *AttCaches) SaveForkchoiceAttestations(atts []ethpb.Att) error
- func (c *AttCaches) SaveUnaggregatedAttestation(att ethpb.Att) error
- func (c *AttCaches) SaveUnaggregatedAttestations(atts []ethpb.Att) error
- func (c *AttCaches) UnaggregatedAttestationCount() int
- func (c *AttCaches) UnaggregatedAttestations() ([]ethpb.Att, error)
- func (c *AttCaches) UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, ...) []*ethpb.Attestation
- func (c *AttCaches) UnaggregatedAttestationsBySlotIndexElectra(ctx context.Context, slot primitives.Slot, ...) []*ethpb.AttestationElectra
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttCaches ¶
type AttCaches struct {
// contains filtered or unexported fields
}
AttCaches defines the caches used to satisfy attestation pool interface. These caches are KV store for various attestations such are unaggregated, aggregated or attestations within a block.
func NewAttCaches ¶
func NewAttCaches() *AttCaches
NewAttCaches initializes a new attestation pool consists of multiple KV store in cache for various kind of attestations.
func (*AttCaches) AggregateUnaggregatedAttestations ¶
AggregateUnaggregatedAttestations aggregates the unaggregated attestations and saves the newly aggregated attestations in the pool. It tracks the unaggregated attestations that weren't able to aggregate to prevent the deletion of unaggregated attestations in the pool.
func (*AttCaches) AggregatedAttestationCount ¶
AggregatedAttestationCount returns the number of aggregated attestations key in the pool.
func (*AttCaches) AggregatedAttestations ¶
AggregatedAttestations returns the aggregated attestations in cache.
func (*AttCaches) AggregatedAttestationsBySlotIndex ¶
func (c *AttCaches) AggregatedAttestationsBySlotIndex( ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex, ) []*ethpb.Attestation
AggregatedAttestationsBySlotIndex returns the aggregated attestations in cache, filtered by committee index and slot.
func (*AttCaches) AggregatedAttestationsBySlotIndexElectra ¶ added in v5.1.0
func (c *AttCaches) AggregatedAttestationsBySlotIndexElectra( ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex, ) []*ethpb.AttestationElectra
AggregatedAttestationsBySlotIndexElectra returns the aggregated attestations in cache, filtered by committee index and slot.
func (*AttCaches) BlockAttestations ¶
BlockAttestations returns the block attestations in cache.
func (*AttCaches) DeleteAggregatedAttestation ¶
DeleteAggregatedAttestation deletes the aggregated attestations in cache.
func (*AttCaches) DeleteBlockAttestation ¶
DeleteBlockAttestation deletes a block attestation in cache.
func (*AttCaches) DeleteForkchoiceAttestation ¶
DeleteForkchoiceAttestation deletes a forkchoice attestation in cache.
func (*AttCaches) DeleteSeenUnaggregatedAttestations ¶
DeleteSeenUnaggregatedAttestations deletes the unaggregated attestations in cache that have been already processed once. Returns number of attestations deleted.
func (*AttCaches) DeleteUnaggregatedAttestation ¶
DeleteUnaggregatedAttestation deletes the unaggregated attestations in cache.
func (*AttCaches) ForkchoiceAttestationCount ¶
ForkchoiceAttestationCount returns the number of fork choice attestations key in the pool.
func (*AttCaches) ForkchoiceAttestations ¶
ForkchoiceAttestations returns the forkchoice attestations in cache.
func (*AttCaches) HasAggregatedAttestation ¶
HasAggregatedAttestation checks if the input attestations has already existed in cache.
func (*AttCaches) SaveAggregatedAttestation ¶
SaveAggregatedAttestation saves an aggregated attestation in cache.
func (*AttCaches) SaveAggregatedAttestations ¶
SaveAggregatedAttestations saves a list of aggregated attestations in cache.
func (*AttCaches) SaveBlockAttestation ¶
SaveBlockAttestation saves an block attestation in cache.
func (*AttCaches) SaveForkchoiceAttestation ¶
SaveForkchoiceAttestation saves an forkchoice attestation in cache.
func (*AttCaches) SaveForkchoiceAttestations ¶
SaveForkchoiceAttestations saves a list of forkchoice attestations in cache.
func (*AttCaches) SaveUnaggregatedAttestation ¶
SaveUnaggregatedAttestation saves an unaggregated attestation in cache.
func (*AttCaches) SaveUnaggregatedAttestations ¶
SaveUnaggregatedAttestations saves a list of unaggregated attestations in cache.
func (*AttCaches) UnaggregatedAttestationCount ¶
UnaggregatedAttestationCount returns the number of unaggregated attestations key in the pool.
func (*AttCaches) UnaggregatedAttestations ¶
UnaggregatedAttestations returns all the unaggregated attestations in cache.
func (*AttCaches) UnaggregatedAttestationsBySlotIndex ¶
func (c *AttCaches) UnaggregatedAttestationsBySlotIndex( ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex, ) []*ethpb.Attestation
UnaggregatedAttestationsBySlotIndex returns the unaggregated attestations in cache, filtered by committee index and slot.
func (*AttCaches) UnaggregatedAttestationsBySlotIndexElectra ¶ added in v5.1.0
func (c *AttCaches) UnaggregatedAttestationsBySlotIndexElectra( ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex, ) []*ethpb.AttestationElectra
UnaggregatedAttestationsBySlotIndexElectra returns the unaggregated attestations in cache, filtered by committee index and slot.