prysm-pulse/beacon-chain/operations/attestations/pool.go
terence tsao f75a5a5df8 Implement Atts Pool Curl Methods (#4191)
* New pool
* Better namings
* Fmt
* Gazelle
* Merge branch 'master' of https://github.com/prysmaticlabs/prysm into define-pool
* Raul's feedback
* Raul's feedback
* Update to use go-cache
* Merge branch 'master' of https://github.com/prysmaticlabs/prysm into define-pool-1
* Update workspace
* Update workspace
* Update pool to use interface
* Move kv init methods
* Curd for aggregated
* Curd for unaggregated
* Gaz
* Tests for aggregated
* Fixed test
* Merge branch 'master' of https://github.com/prysmaticlabs/prysm into curd
* Minor fixes
* Typoe
* pool test
* Added deletions as well
* Merge branch 'master' of https://github.com/prysmaticlabs/prysm into curd
* Update beacon-chain/operations/attestations/kv/aggregated.go
* Update beacon-chain/operations/attestations/kv/aggregated.go
* Update beacon-chain/operations/attestations/kv/unaggregated_test.go
* Update beacon-chain/operations/attestations/kv/kv.go
2019-12-04 18:30:45 +00:00

29 lines
1.0 KiB
Go

package attestations
import (
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations/kv"
)
// AttestationPool 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
// for aggregator actor.
type AttestationPool interface {
// For Aggregated attestations
SaveAggregatedAttestation(att *ethpb.Attestation) error
AggregatedAttestation() []*ethpb.Attestation
DeleteAggregatedAttestation(att *ethpb.Attestation) error
// For unaggregated attestations
SaveUnaggregatedAttestation(att *ethpb.Attestation) error
UnaggregatedAttestation(slot uint64, committeeIndex uint64) []*ethpb.Attestation
DeleteUnaggregatedAttestation(att *ethpb.Attestation) error
// For forkchoice attestations
}
// NewAttestationPool initializes a new attestation pool.
func NewAttestationPool(dirPath string) *kv.AttCaches {
return kv.NewAttCaches()
}