operation

package
v0.43.1-access-memory-... Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: AGPL-3.0 Imports: 13 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsurePublicDB added in v0.22.4

func EnsurePublicDB(db *badger.DB) error

func EnsureSecretDB added in v0.22.4

func EnsureSecretDB(db *badger.DB) error

func Fail

func Fail(err error) func(*badger.Txn) error

Fail returns a DB operation function that always fails with the given error.

func InitMax

func InitMax(tx *badger.Txn) error

InitMax retrieves the maximum key length to have it internally in the package after restarting. No errors are expected during normal operation.

func InsertMyBeaconPrivateKey added in v0.23.2

func InsertMyBeaconPrivateKey(epochCounter uint64, info *encodable.RandomBeaconPrivKey) func(*badger.Txn) error

InsertMyBeaconPrivateKey stores the random beacon private key for the given epoch.

CAUTION: This method stores confidential information and should only be used in the context of the secrets database. This is enforced in the above layer (see storage.DKGState). Error returns: storage.ErrAlreadyExists.

func InsertPublicDBMarker added in v0.22.4

func InsertPublicDBMarker(txn *badger.Txn) error

func InsertSecretDBMarker added in v0.22.4

func InsertSecretDBMarker(txn *badger.Txn) error

func RetrieveDKGStartedForEpoch added in v0.23.9

func RetrieveDKGStartedForEpoch(epochCounter uint64, started *bool) func(*badger.Txn) error

RetrieveDKGStartedForEpoch retrieves whether DKG has started for the given epoch. If no flag is set, started is set to false and no error is returned. No errors expected during normal operation.

func RetrieveDKGStateForEpoch added in v0.39.0

func RetrieveDKGStateForEpoch(epochCounter uint64, currentState *flow.DKGState) func(*badger.Txn) error

RetrieveDKGStateForEpoch retrieves the current DKG state for the epoch. Error returns: storage.ErrNotFound

func RetrieveMyBeaconPrivateKey added in v0.23.2

func RetrieveMyBeaconPrivateKey(epochCounter uint64, info *encodable.RandomBeaconPrivKey) func(*badger.Txn) error

RetrieveMyBeaconPrivateKey retrieves the random beacon private key for the given epoch.

CAUTION: This method stores confidential information and should only be used in the context of the secrets database. This is enforced in the above layer (see storage.DKGState). Error returns: storage.ErrNotFound

func RetryOnConflict

func RetryOnConflict(action func(func(*badger.Txn) error) error, op func(tx *badger.Txn) error) error

func RetryOnConflictTx added in v0.17.0

func RetryOnConflictTx(db *badger.DB, action func(*badger.DB, func(*transaction.Tx) error) error, op func(*transaction.Tx) error) error

func SetMax

func SetMax(tx storage.Transaction) error

SetMax sets the value for the maximum key length used for efficient iteration. No errors are expected during normal operation.

func SkipDuplicates

func SkipDuplicates(op func(*badger.Txn) error) func(tx *badger.Txn) error

func SkipDuplicatesTx added in v0.33.30

func SkipDuplicatesTx(op func(*transaction.Tx) error) func(tx *transaction.Tx) error

func SkipNonExist added in v0.24.5

func SkipNonExist(op func(*badger.Txn) error) func(tx *badger.Txn) error

func UpsertDKGStateForEpoch added in v0.39.0

func UpsertDKGStateForEpoch(epochCounter uint64, newState flow.DKGState) func(*badger.Txn) error

UpsertDKGStateForEpoch stores the current state of Random Beacon Recoverable State Machine for the epoch, irrespective of whether an entry for the given epoch counter already exists in the database or not.

func UpsertMyBeaconPrivateKey added in v0.39.0

func UpsertMyBeaconPrivateKey(epochCounter uint64, info *encodable.RandomBeaconPrivKey) func(*badger.Txn) error

UpsertMyBeaconPrivateKey stores the random beacon private key, irrespective of whether an entry for the given epoch counter already exists in the database or not.

CAUTION: This method stores confidential information and should only be used in the context of the secrets database. This is enforced in the above layer (see storage.EpochRecoveryMyBeaconKey). This method has to be used only in very specific cases, like epoch recovery, for normal usage use InsertMyBeaconPrivateKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

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