payload

package
v0.31.4 Latest Latest
Warning

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

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

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