Documentation
¶
Index ¶
- func NewNoOpKeyValueCache[T any]() *noOpKeyValueCache[T]
- func NewNoOpParamsCache[T any]() *noOpParamsCache[T]
- func NewParamsCache[T any](opts ...memory.KeyValueCacheOptionFn) (*paramsCache[T], error)
- func WithClaimSettlementCacheClearFn() func(context.Context, depinject.Config, Cache) error
- func WithNewBlockCacheClearing[C Cache](ctx context.Context, deps depinject.Config, cache C) error
- func WithSessionCountCacheClearFn(numSessionsToClearCache uint) func(context.Context, depinject.Config, Cache) error
- type Cache
- type CacheOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNoOpKeyValueCache ¶
func NewNoOpKeyValueCache[T any]() *noOpKeyValueCache[T]
NewKeyValueCache returns a new instance of a KeyValueCache.
func NewNoOpParamsCache ¶
func NewNoOpParamsCache[T any]() *noOpParamsCache[T]
NewParamsCache returns a new instance of a ParamsCache.
func NewParamsCache ¶
func NewParamsCache[T any](opts ...memory.KeyValueCacheOptionFn) (*paramsCache[T], error)
NewParamsCache returns a new instance of a ParamsCache.
func WithClaimSettlementCacheClearFn ¶ added in v0.1.30
WithClaimSettlementCacheClearFn is used to configure cache clearing at claim settlement.
This timing is critical for RelayMiningDifficulty caches to ensure suppliers aren't penalized for using outdated difficulty values when submitting proofs that were generated at session start.
Cache clearing occurs at the height where claims are settled to:
- Maintain stable difficulty values throughout the proof submission window
- Prevent suppliers from using stale cached difficulty when submitting proofs
- Allow fresh difficulty calculations for the next session cycle
func WithNewBlockCacheClearing ¶
WithNewBlockCacheClearing is a cache option that clears the cache every time a new block is observed.
Types ¶
Click to show internal directories.
Click to hide internal directories.