Files
prysm/beacon-chain/light-client/cache.go
Bastin 92bd211e4d upgrade v6 to v7 (#15989)
* upgrade v6 to v7

* changelog

* update-go-ssz
2025-11-06 16:16:23 +00:00

27 lines
841 B
Go

package light_client
import (
"github.com/OffchainLabs/prysm/v7/consensus-types/interfaces"
"github.com/OffchainLabs/prysm/v7/consensus-types/primitives"
)
// cache tracks LC data over the non finalized chain for different branches.
type cache struct {
items map[[32]byte]*cacheItem
}
// cacheItem represents the LC data for a block. It tracks the best update and finality update seen in that branch.
type cacheItem struct {
parent *cacheItem // parent item in the cache, can be nil
period uint64 // sync committee period
slot primitives.Slot // slot of the signature block
bestUpdate interfaces.LightClientUpdate
bestFinalityUpdate interfaces.LightClientFinalityUpdate
}
func newLightClientCache() *cache {
return &cache{
items: make(map[[32]byte]*cacheItem),
}
}