attestations

package
v4.0.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2023 License: GPL-3.0 Imports: 19 Imported by: 19

Documentation

Overview

Package attestations defines an attestation pool service implementation which is used to manage the lifecycle of aggregated, unaggregated, and fork-choice attestations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool() *kv.AttCaches

NewPool initializes a new attestation pool.

Types

type Config

type Config struct {
	Pool Pool
	// contains filtered or unexported fields
}

Config options for the service.

type Pool

type Pool interface {
	// For Aggregated attestations
	AggregateUnaggregatedAttestations(ctx context.Context) error
	AggregateUnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) error
	SaveAggregatedAttestation(att *ethpb.Attestation) error
	SaveAggregatedAttestations(atts []*ethpb.Attestation) error
	AggregatedAttestations() []*ethpb.Attestation
	AggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation
	DeleteAggregatedAttestation(att *ethpb.Attestation) error
	HasAggregatedAttestation(att *ethpb.Attestation) (bool, error)
	AggregatedAttestationCount() int
	// For unaggregated attestations.
	SaveUnaggregatedAttestation(att *ethpb.Attestation) error
	SaveUnaggregatedAttestations(atts []*ethpb.Attestation) error
	UnaggregatedAttestations() ([]*ethpb.Attestation, error)
	UnaggregatedAttestationsBySlotIndex(ctx context.Context, slot primitives.Slot, committeeIndex primitives.CommitteeIndex) []*ethpb.Attestation
	DeleteUnaggregatedAttestation(att *ethpb.Attestation) error
	DeleteSeenUnaggregatedAttestations() (int, error)
	UnaggregatedAttestationCount() int
	// For attestations that were included in the block.
	SaveBlockAttestation(att *ethpb.Attestation) error
	SaveBlockAttestations(atts []*ethpb.Attestation) error
	BlockAttestations() []*ethpb.Attestation
	DeleteBlockAttestation(att *ethpb.Attestation) error
	// For attestations to be passed to fork choice.
	SaveForkchoiceAttestation(att *ethpb.Attestation) error
	SaveForkchoiceAttestations(atts []*ethpb.Attestation) error
	ForkchoiceAttestations() []*ethpb.Attestation
	DeleteForkchoiceAttestation(att *ethpb.Attestation) error
	ForkchoiceAttestationCount() int
}

Pool defines the necessary methods for Prysm attestations pool to serve fork choice and validators. In the current design, aggregated attestations are used by proposer actor. Unaggregated attestations are used by aggregator actor.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service of attestation pool operations.

func NewService

func NewService(ctx context.Context, cfg *Config) (*Service, error)

NewService instantiates a new attestation pool service instance that will be registered into a running beacon node.

func (*Service) SetGenesisTime

func (s *Service) SetGenesisTime(t uint64)

SetGenesisTime sets genesis time for operation service to use.

func (*Service) Start

func (s *Service) Start()

Start an attestation pool service's main event loop.

func (*Service) Status

func (s *Service) Status() error

Status returns the current service err if there's any.

func (*Service) Stop

func (s *Service) Stop() error

Stop the beacon block attestation pool service's main event loop and associated goroutines.

Directories

Path Synopsis
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.
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL