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 (p *AttCaches) AggregateUnaggregatedAttestations() error
- func (p *AttCaches) AggregatedAttestationCount() int
- func (p *AttCaches) AggregatedAttestations() []*ethpb.Attestation
- func (p *AttCaches) AggregatedAttestationsBySlotIndex(slot uint64, committeeIndex uint64) []*ethpb.Attestation
- func (p *AttCaches) BlockAttestations() []*ethpb.Attestation
- func (p *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) DeleteBlockAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) DeleteForkchoiceAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) DeleteUnaggregatedAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) ForkchoiceAttestations() []*ethpb.Attestation
- func (p *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, error)
- func (p *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) SaveAggregatedAttestations(atts []*ethpb.Attestation) error
- func (p *AttCaches) SaveBlockAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) SaveBlockAttestations(atts []*ethpb.Attestation) error
- func (p *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) SaveForkchoiceAttestations(atts []*ethpb.Attestation) error
- func (p *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error
- func (p *AttCaches) SaveUnaggregatedAttestations(atts []*ethpb.Attestation) error
- func (p *AttCaches) UnaggregatedAttestationCount() int
- func (p *AttCaches) UnaggregatedAttestations() []*ethpb.Attestation
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 save 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 ¶ added in v0.3.2
AggregatedAttestationCount returns the number of aggregated attestations key in the pool.
func (*AttCaches) AggregatedAttestations ¶
func (p *AttCaches) AggregatedAttestations() []*ethpb.Attestation
AggregatedAttestations returns the aggregated attestations in cache.
func (*AttCaches) AggregatedAttestationsBySlotIndex ¶
func (p *AttCaches) AggregatedAttestationsBySlotIndex(slot uint64, committeeIndex uint64) []*ethpb.Attestation
AggregatedAttestationsBySlotIndex returns the aggregated attestations in cache, filtered by committee index and slot.
func (*AttCaches) BlockAttestations ¶
func (p *AttCaches) BlockAttestations() []*ethpb.Attestation
BlockAttestations returns the block attestations in cache.
func (*AttCaches) DeleteAggregatedAttestation ¶
func (p *AttCaches) DeleteAggregatedAttestation(att *ethpb.Attestation) error
DeleteAggregatedAttestation deletes the aggregated attestations in cache.
func (*AttCaches) DeleteBlockAttestation ¶
func (p *AttCaches) DeleteBlockAttestation(att *ethpb.Attestation) error
DeleteBlockAttestation deletes a block attestation in cache.
func (*AttCaches) DeleteForkchoiceAttestation ¶
func (p *AttCaches) DeleteForkchoiceAttestation(att *ethpb.Attestation) error
DeleteForkchoiceAttestation deletes a forkchoice attestation in cache.
func (*AttCaches) DeleteUnaggregatedAttestation ¶
func (p *AttCaches) DeleteUnaggregatedAttestation(att *ethpb.Attestation) error
DeleteUnaggregatedAttestation deletes the unaggregated attestations in cache.
func (*AttCaches) ForkchoiceAttestations ¶
func (p *AttCaches) ForkchoiceAttestations() []*ethpb.Attestation
ForkchoiceAttestations returns the forkchoice attestations in cache.
func (*AttCaches) HasAggregatedAttestation ¶ added in v0.3.2
func (p *AttCaches) HasAggregatedAttestation(att *ethpb.Attestation) (bool, error)
HasAggregatedAttestation checks if the input attestations has already existed in cache.
func (*AttCaches) SaveAggregatedAttestation ¶
func (p *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error
SaveAggregatedAttestation saves an aggregated attestation in cache.
func (*AttCaches) SaveAggregatedAttestations ¶
func (p *AttCaches) SaveAggregatedAttestations(atts []*ethpb.Attestation) error
SaveAggregatedAttestations saves a list of aggregated attestations in cache.
func (*AttCaches) SaveBlockAttestation ¶
func (p *AttCaches) SaveBlockAttestation(att *ethpb.Attestation) error
SaveBlockAttestation saves an block attestation in cache.
func (*AttCaches) SaveBlockAttestations ¶
func (p *AttCaches) SaveBlockAttestations(atts []*ethpb.Attestation) error
SaveBlockAttestations saves a list of block attestations in cache.
func (*AttCaches) SaveForkchoiceAttestation ¶
func (p *AttCaches) SaveForkchoiceAttestation(att *ethpb.Attestation) error
SaveForkchoiceAttestation saves an forkchoice attestation in cache.
func (*AttCaches) SaveForkchoiceAttestations ¶
func (p *AttCaches) SaveForkchoiceAttestations(atts []*ethpb.Attestation) error
SaveForkchoiceAttestations saves a list of forkchoice attestations in cache.
func (*AttCaches) SaveUnaggregatedAttestation ¶
func (p *AttCaches) SaveUnaggregatedAttestation(att *ethpb.Attestation) error
SaveUnaggregatedAttestation saves an unaggregated attestation in cache.
func (*AttCaches) SaveUnaggregatedAttestations ¶
func (p *AttCaches) SaveUnaggregatedAttestations(atts []*ethpb.Attestation) error
SaveUnaggregatedAttestations saves a list of unaggregated attestations in cache.
func (*AttCaches) UnaggregatedAttestationCount ¶ added in v0.3.2
UnaggregatedAttestationCount returns the number of unaggregated attestations key in the pool.
func (*AttCaches) UnaggregatedAttestations ¶
func (p *AttCaches) UnaggregatedAttestations() []*ethpb.Attestation
UnaggregatedAttestations returns all the unaggregated attestations in cache.