erigon-pulse/cl/phase1/cache/attestation_indicies_cache.go
a cda14447ad
[caplin] pkg refactor (#7507)
Co-authored-by: Giulio <giulio.rebuffo@gmail.com>
2023-05-13 23:44:07 +02:00

19 lines
523 B
Go

package cache
import (
"github.com/ledgerwatch/erigon/cl/cltypes"
"github.com/ledgerwatch/erigon/cl/phase1/core/state/lru"
)
var attestationIndiciesCache *lru.Cache[*cltypes.AttestationData, []uint64]
const attestationIndiciesCacheSize = 256
func LoadAttestatingIndicies(attestation *cltypes.AttestationData) ([]uint64, bool) {
return attestationIndiciesCache.Get(attestation)
}
func StoreAttestation(attestation *cltypes.AttestationData, indicies []uint64) {
attestationIndiciesCache.Add(attestation, indicies)
}