Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions beacon-chain/cache/sync_committee_head_state.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cache

import (
"sync"

"github.com/OffchainLabs/prysm/v7/beacon-chain/state"
lruwrpr "github.com/OffchainLabs/prysm/v7/cache/lru"
"github.com/OffchainLabs/prysm/v7/consensus-types/primitives"
Expand All @@ -13,7 +11,6 @@ import (
// SyncCommitteeHeadStateCache for the latest head state requested by a sync committee participant.
type SyncCommitteeHeadStateCache struct {
cache *lru.Cache
lock sync.RWMutex
}

// NewSyncCommitteeHeadState initializes a LRU cache for `SyncCommitteeHeadState` with size of 1.
Expand All @@ -24,8 +21,6 @@ func NewSyncCommitteeHeadState() *SyncCommitteeHeadStateCache {

// Put `slot` as key and `state` as value onto the cache.
func (c *SyncCommitteeHeadStateCache) Put(slot primitives.Slot, st state.BeaconState) error {
c.lock.Lock()
defer c.lock.Unlock()
// Make sure that the provided state is non nil
// and is of the correct type.
if st == nil || st.IsNil() {
Expand All @@ -42,8 +37,6 @@ func (c *SyncCommitteeHeadStateCache) Put(slot primitives.Slot, st state.BeaconS

// Get `state` using `slot` as key. Return nil if nothing is found.
func (c *SyncCommitteeHeadStateCache) Get(slot primitives.Slot) (state.BeaconState, error) {
c.lock.RLock()
defer c.lock.RUnlock()
val, exists := c.cache.Get(slot)
if !exists {
return nil, ErrNotFound
Expand Down