mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 11:41:21 +00:00
dc1bec79ed
* Use types.CommitteeIndex * Go fmt * Update validator pkg * Fix e2e * Happy fuzz tests * Sync with upstream ethereumapi * Go mod tidy Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
49 lines
2.2 KiB
Go
49 lines
2.2 KiB
Go
package attestations
|
|
|
|
import (
|
|
types "github.com/prysmaticlabs/eth2-types"
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations/kv"
|
|
)
|
|
|
|
// 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 Pool interface {
|
|
// For Aggregated attestations
|
|
AggregateUnaggregatedAttestations() error
|
|
AggregateUnaggregatedAttestationsBySlotIndex(slot types.Slot, committeeIndex types.CommitteeIndex) error
|
|
SaveAggregatedAttestation(att *ethpb.Attestation) error
|
|
SaveAggregatedAttestations(atts []*ethpb.Attestation) error
|
|
AggregatedAttestations() []*ethpb.Attestation
|
|
AggregatedAttestationsBySlotIndex(slot types.Slot, committeeIndex types.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(slot types.Slot, committeeIndex types.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
|
|
}
|
|
|
|
// NewPool initializes a new attestation pool.
|
|
func NewPool() *kv.AttCaches {
|
|
return kv.NewAttCaches()
|
|
}
|