github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/cache/committee_disabled.go (about) 1 // +build libfuzzer 2 3 // This file is used in fuzzer builds to bypass global committee caches. 4 package cache 5 6 import types "github.com/prysmaticlabs/eth2-types" 7 8 // FakeCommitteeCache is a struct with 1 queue for looking up shuffled indices list by seed. 9 type FakeCommitteeCache struct { 10 } 11 12 // NewCommitteesCache creates a new committee cache for storing/accessing shuffled indices of a committee. 13 func NewCommitteesCache() *FakeCommitteeCache { 14 return &FakeCommitteeCache{} 15 } 16 17 // Committee fetches the shuffled indices by slot and committee index. Every list of indices 18 // represent one committee. Returns true if the list exists with slot and committee index. Otherwise returns false, nil. 19 func (c *FakeCommitteeCache) Committee(slot types.Slot, seed [32]byte, index types.CommitteeIndex) ([]types.ValidatorIndex, error) { 20 return nil, nil 21 } 22 23 // AddCommitteeShuffledList adds Committee shuffled list object to the cache. T 24 // his method also trims the least recently list if the cache size has ready the max cache size limit. 25 func (c *FakeCommitteeCache) AddCommitteeShuffledList(committees *Committees) error { 26 return nil 27 } 28 29 // AddProposerIndicesList updates the committee shuffled list with proposer indices. 30 func (c *FakeCommitteeCache) AddProposerIndicesList(seed [32]byte, indices []types.ValidatorIndex) error { 31 return nil 32 } 33 34 // ActiveIndices returns the active indices of a given seed stored in cache. 35 func (c *FakeCommitteeCache) ActiveIndices(seed [32]byte) ([]types.ValidatorIndex, error) { 36 return nil, nil 37 } 38 39 // ActiveIndicesCount returns the active indices count of a given seed stored in cache. 40 func (c *FakeCommitteeCache) ActiveIndicesCount(seed [32]byte) (int, error) { 41 return 0, nil 42 } 43 44 // ProposerIndices returns the proposer indices of a given seed. 45 func (c *FakeCommitteeCache) ProposerIndices(seed [32]byte) ([]types.ValidatorIndex, error) { 46 return nil, nil 47 } 48 49 // HasEntry returns true if the committee cache has a value. 50 func (c *FakeCommitteeCache) HasEntry(string) bool { 51 return false 52 }