Documentation
¶
Overview ¶
Package cache holds in-memory caches shared across the validator client's API backends (beacon-api and grpc-api). It is the validator-side analog of beacon-chain/cache, which is walled off from the validator by Bazel visibility.
Index ¶
- type ExecutionPayloadEnvelopeCache
- func (c *ExecutionPayloadEnvelopeCache) Add(slot primitives.Slot, envelope *ethpb.ExecutionPayloadEnvelope, ...)
- func (c *ExecutionPayloadEnvelopeCache) Peek(slot primitives.Slot) (*ethpb.ExecutionPayloadEnvelope, [][]byte, [][]byte)
- func (c *ExecutionPayloadEnvelopeCache) Take(slot primitives.Slot) (*ethpb.ExecutionPayloadEnvelope, [][]byte, [][]byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionPayloadEnvelopeCache ¶
type ExecutionPayloadEnvelopeCache struct {
// contains filtered or unexported fields
}
ExecutionPayloadEnvelopeCache is a slot-keyed cache that carries the execution payload envelope and its blob data from block production to the self-build envelope publisher, avoiding a second fetch. It is the validator-side counterpart to beacon-chain/cache's same-named BN cache.
func NewExecutionPayloadEnvelopeCache ¶
func NewExecutionPayloadEnvelopeCache() *ExecutionPayloadEnvelopeCache
NewExecutionPayloadEnvelopeCache returns an initialized ExecutionPayloadEnvelopeCache.
func (*ExecutionPayloadEnvelopeCache) Add ¶
func (c *ExecutionPayloadEnvelopeCache) Add(slot primitives.Slot, envelope *ethpb.ExecutionPayloadEnvelope, blobs, kzgProofs [][]byte)
Add stores an envelope and its blob data for the slot and drops entries for older slots (a lingering older entry belongs to an aborted proposal). No-op on a nil receiver.
func (*ExecutionPayloadEnvelopeCache) Peek ¶
func (c *ExecutionPayloadEnvelopeCache) Peek(slot primitives.Slot) (*ethpb.ExecutionPayloadEnvelope, [][]byte, [][]byte)
Peek returns the cached envelope and blob data for the slot without removing the entry.
func (*ExecutionPayloadEnvelopeCache) Take ¶
func (c *ExecutionPayloadEnvelopeCache) Take(slot primitives.Slot) (*ethpb.ExecutionPayloadEnvelope, [][]byte, [][]byte)
Take returns the cached envelope and blob data for the slot and removes the entry.