unsynchronized

package
v0.43.1-rc.1.access-me... Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collections

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

func NewCollections

func NewCollections(transactions *Transactions) *Collections

func (*Collections) BatchStoreAndIndexByTransaction added in v0.43.0

func (c *Collections) BatchStoreAndIndexByTransaction(_ lockctx.Proof, _ *flow.Collection, _ storage.ReaderBatchWriter) (*flow.LightCollection, error)

BatchStoreAndIndexByTransaction stores a light collection and indexes it by transaction ID within a batch operation.

CAUTION: current approach is NOT BFT and needs to be revised in the future. Honest clusters ensure a transaction can only belong to one collection. However, in rare cases, the collector clusters can exceed byzantine thresholds -- making it possible to produce multiple finalized collections (aka guaranteed collections) containing the same transaction repeatedly. TODO: eventually we need to handle Byzantine clusters

This method is not implemented and will always return an error.

func (*Collections) ByID

func (c *Collections) ByID(collID flow.Identifier) (*flow.Collection, error)

ByID returns the collection with the given ID, including all transactions within the collection.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no light collection was found.

func (*Collections) Data added in v0.42.0

func (c *Collections) Data() []flow.Collection

Data returns a copy of stored collections

func (*Collections) LightByID

func (c *Collections) LightByID(collID flow.Identifier) (*flow.LightCollection, error)

LightByID returns collection with the given ID. Only retrieves transaction hashes.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no light collection was found.

func (*Collections) LightByTransactionID

func (c *Collections) LightByTransactionID(txID flow.Identifier) (*flow.LightCollection, error)

LightByTransactionID returns the collection for the given transaction ID. Only retrieves transaction hashes.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no light collection was found.

func (*Collections) LightCollections added in v0.42.0

func (c *Collections) LightCollections() []flow.LightCollection

LightCollections returns a copy of stored light collections

func (*Collections) Remove

func (c *Collections) Remove(collID flow.Identifier) error

Remove removes the collection and all constituent transactions. No errors are expected during normal operation.

func (*Collections) Store

func (c *Collections) Store(collection *flow.Collection) (*flow.LightCollection, error)

Store inserts the collection keyed by ID and all constituent transactions. No errors are expected during normal operation.

func (*Collections) StoreAndIndexByTransaction added in v0.43.0

func (c *Collections) StoreAndIndexByTransaction(_ lockctx.Proof, collection *flow.Collection) (*flow.LightCollection, error)

StoreAndIndexByTransaction inserts the light collection (only transaction IDs) and adds a transaction id index for each of the transactions within the collection (transaction_id->collection_id).

CAUTION: current approach is NOT BFT and needs to be revised in the future. Honest clusters ensure a transaction can only belong to one collection. However, in rare cases, the collector clusters can exceed byzantine thresholds -- making it possible to produce multiple finalized collections (aka guaranteed collections) containing the same transaction repeatedly. TODO: eventually we need to handle Byzantine clusters

No errors are expected during normal operation.

type Events

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

func NewEvents

func NewEvents() *Events

func (*Events) BatchRemoveByBlockID

func (e *Events) BatchRemoveByBlockID(flow.Identifier, storage.ReaderBatchWriter) error

BatchRemoveByBlockID removes events keyed by a blockID in provided batch No errors are expected during normal operation, even if no entries are matched. If database unexpectedly fails to process the request, the error is wrapped in a generic error and returned.

This method is NOT implemented and will always return an error.

func (*Events) BatchStore

BatchStore will store events for the given block ID in a given batch.

This method is NOT implemented and will always return an error.

func (*Events) ByBlockID

func (e *Events) ByBlockID(blockID flow.Identifier) ([]flow.Event, error)

ByBlockID returns the events for the given block ID.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block.

func (*Events) ByBlockIDEventType

func (e *Events) ByBlockIDEventType(blockID flow.Identifier, eventType flow.EventType) ([]flow.Event, error)

ByBlockIDEventType returns the events for the given block ID and event type.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block.

func (*Events) ByBlockIDTransactionID

func (e *Events) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) ([]flow.Event, error)

ByBlockIDTransactionID returns the events for the given block ID and transaction ID.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block and transaction.

func (*Events) ByBlockIDTransactionIndex

func (e *Events) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) ([]flow.Event, error)

ByBlockIDTransactionIndex returns the events for the transaction at given index in a given block

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block and transaction.

func (*Events) Data added in v0.42.0

func (e *Events) Data() flow.EventsList

Data returns a copy of the cached blockID -> events map as EventsList.

func (*Events) Store

func (e *Events) Store(blockID flow.Identifier, blockEvents []flow.EventsList) error

Store will store events for the given block ID. No errors are expected during normal operation.

type LightTransactionResults

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

func NewLightTransactionResults

func NewLightTransactionResults() *LightTransactionResults

func (*LightTransactionResults) BatchStore

BatchStore inserts a batch of transaction result into a batch. This method is not implemented and will always return an error.

func (*LightTransactionResults) BatchStoreBadger

BatchStoreBadger inserts a batch of transaction result into a storage. Deprecated: deprecated as a part of transition from Badger to Pebble. use BatchStore instead. This method is not implemented and will always return an error.

func (*LightTransactionResults) ByBlockID

ByBlockID gets all transaction results for a block, ordered by transaction index

Expected errors during normal operation:

  • `storage.ErrNotFound` if light transaction results at given blockID weren't found.

func (*LightTransactionResults) ByBlockIDTransactionID

func (l *LightTransactionResults) ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.LightTransactionResult, error)

ByBlockIDTransactionID returns the transaction result for the given block ID and transaction

Expected errors during normal operation:

  • `storage.ErrNotFound` if light transaction result at given blockID wasn't found.

func (*LightTransactionResults) ByBlockIDTransactionIndex

func (l *LightTransactionResults) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.LightTransactionResult, error)

ByBlockIDTransactionIndex returns the transaction result for the given blockID and transaction index

Expected errors during normal operation:

  • `storage.ErrNotFound` if light transaction result at given blockID and txIndex wasn't found.

func (*LightTransactionResults) Data added in v0.42.0

Data returns a copy of the cached light transaction results grouped by block ID.

func (*LightTransactionResults) Store

func (l *LightTransactionResults) Store(blockID flow.Identifier, transactionResults []flow.LightTransactionResult) error

Store inserts a transaction results into a storage No errors are expected during normal operation.

type Registers

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

Registers is a simple in-memory implementation of the RegisterIndex interface. It stores registers for a single block height.

func NewRegisters

func NewRegisters(blockHeight uint64) *Registers

func (*Registers) Data added in v0.42.0

func (r *Registers) Data(height uint64) ([]flow.RegisterEntry, error)

Data returns all register entries for the specified height. No errors are expected during normal operation.

func (*Registers) FirstHeight

func (r *Registers) FirstHeight() uint64

FirstHeight returns the first indexed height found in the store.

func (*Registers) Get

func (r *Registers) Get(registerID flow.RegisterID, height uint64) (flow.RegisterValue, error)

Get returns a register by the register ID at a storage's block height.

Expected errors: - storage.ErrNotFound if the register does not exist in this storage object - storage.ErrHeightNotIndexed if the given height does not match the storage's block height

func (*Registers) LatestHeight

func (r *Registers) LatestHeight() uint64

LatestHeight returns the latest indexed height.

func (*Registers) Store

func (r *Registers) Store(registers flow.RegisterEntries, height uint64) error

Store stores a batch of register entries at the storage's block height. No errors are expected during normal operation.

type TransactionResultErrorMessages

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

func NewTransactionResultErrorMessages

func NewTransactionResultErrorMessages() *TransactionResultErrorMessages

func (*TransactionResultErrorMessages) BatchStore added in v0.43.0

func (t *TransactionResultErrorMessages) BatchStore(blockID flow.Identifier, transactionResultErrorMessages []flow.TransactionResultErrorMessage, batch storage.ReaderBatchWriter) error

BatchStore inserts a batch of transaction result error messages into a batch This method is not implemented and will always return an error.

func (*TransactionResultErrorMessages) ByBlockID

ByBlockID gets all transaction result error messages for a block, ordered by transaction index. Note: This method will return an empty slice both if the block is not indexed yet and if the block does not have any errors.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no block was found.

func (*TransactionResultErrorMessages) ByBlockIDTransactionID

func (t *TransactionResultErrorMessages) ByBlockIDTransactionID(
	blockID flow.Identifier,
	transactionID flow.Identifier,
) (*flow.TransactionResultErrorMessage, error)

ByBlockIDTransactionID returns the transaction result error message for the given block ID and transaction ID.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no transaction error message is known at given block and transaction id.

func (*TransactionResultErrorMessages) ByBlockIDTransactionIndex

func (t *TransactionResultErrorMessages) ByBlockIDTransactionIndex(
	blockID flow.Identifier,
	txIndex uint32,
) (*flow.TransactionResultErrorMessage, error)

ByBlockIDTransactionIndex returns the transaction result error message for the given blockID and transaction index.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no transaction error message is known at given block and transaction index.

func (*TransactionResultErrorMessages) Data added in v0.42.0

Data returns a copy of all stored transaction result error messages keyed by block ID.

func (*TransactionResultErrorMessages) Exists

Exists returns true if transaction result error messages for the given ID have been stored.

No errors are expected during normal operation.

func (*TransactionResultErrorMessages) Store

func (t *TransactionResultErrorMessages) Store(
	blockID flow.Identifier,
	transactionResultErrorMessages []flow.TransactionResultErrorMessage,
) error

Store will store transaction result error messages for the given block ID.

No errors are expected during normal operation.

type Transactions

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

func NewTransactions

func NewTransactions() *Transactions

func (*Transactions) BatchStore added in v0.43.0

BatchStore stores transaction within a batch operation. This method is not implemented and will always return an error.

func (*Transactions) ByID

ByID returns the transaction for the given fingerprint. Expected errors during normal operation:

  • `storage.ErrNotFound` if transaction is not found.

func (*Transactions) Data added in v0.42.0

func (t *Transactions) Data() []flow.TransactionBody

Data returns a copy of the internal transaction map.

func (*Transactions) Store

func (t *Transactions) Store(tx *flow.TransactionBody) error

Store inserts the transaction, keyed by fingerprint. Duplicate transaction insertion is ignored No errors are expected during normal operation.

Jump to

Keyboard shortcuts

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