mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
f962d13407
* fix races in committee cache tests * lint * gratuitous defer ClearCache if ClearCache * log warning to avoid failed block processing * gaz * add Clear to cache stubs * fix Clear mistakes * last fake cache fix --------- Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
40 lines
1.3 KiB
Go
40 lines
1.3 KiB
Go
//go:build fuzz
|
|
|
|
// This file is used in fuzzer builds to bypass proposer indices caches.
|
|
package cache
|
|
|
|
import "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
|
|
|
// FakeProposerIndicesCache is a struct with 1 queue for looking up proposer indices by root.
|
|
type FakeProposerIndicesCache struct {
|
|
}
|
|
|
|
// NewProposerIndicesCache creates a new proposer indices cache for storing/accessing proposer index assignments of an epoch.
|
|
func NewProposerIndicesCache() *FakeProposerIndicesCache {
|
|
return &FakeProposerIndicesCache{}
|
|
}
|
|
|
|
// AddProposerIndices adds ProposerIndices object to the cache.
|
|
// This method also trims the least recently list if the cache size has ready the max cache size limit.
|
|
func (c *FakeProposerIndicesCache) AddProposerIndices(p *ProposerIndices) error {
|
|
return nil
|
|
}
|
|
|
|
// ProposerIndices returns the proposer indices of a block root seed.
|
|
func (c *FakeProposerIndicesCache) ProposerIndices(r [32]byte) ([]primitives.ValidatorIndex, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
// HasProposerIndices returns the proposer indices of a block root seed.
|
|
func (c *FakeProposerIndicesCache) HasProposerIndices(r [32]byte) (bool, error) {
|
|
return false, nil
|
|
}
|
|
|
|
func (c *FakeProposerIndicesCache) Len() int {
|
|
return 0
|
|
}
|
|
|
|
// Clear is a stub.
|
|
func (c *FakeProposerIndicesCache) Clear() {
|
|
}
|