payload

package
v0.31.9-decrease-wait-... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(dbPath string, cache *pebble.Cache) (*Storage, error)

NewStorage creates a pebble-backed payload storage. The reason we use a separate storage for payloads we need a Comparer with a custom Split function.

It needs to access the last available payload with height less or equal to the requested height. This means all point-lookups are range scans.

func (*Storage) BatchSetPayload

func (s *Storage) BatchSetPayload(
	height uint64,
	entries flow.RegisterEntries,
) error

BatchSetPayload sets the given entries in a batch.

func (*Storage) Close

func (s *Storage) Close() error

Close closes the storage.

func (*Storage) GetPayload

func (s *Storage) GetPayload(
	height uint64,
	reg flow.RegisterID,
) ([]byte, error)

GetPayload returns the most recent updated payload for the given RegisterID. "most recent" means the updates happens most recent up the given height.

For example, if there are 2 values stored for register A at height 6 and 11, then GetPayload(13, A) would return the value at height 11.

If no payload is found, an empty byte slice is returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL