Documentation
¶
Index ¶
- func EnsurePublicDB(db *badger.DB) error
- func EnsureSecretDB(db *badger.DB) error
- func Fail(err error) func(*badger.Txn) error
- func InitMax(tx *badger.Txn) error
- func InsertMyBeaconPrivateKey(epochCounter uint64, info *encodable.RandomBeaconPrivKey) func(*badger.Txn) error
- func InsertPublicDBMarker(txn *badger.Txn) error
- func InsertSecretDBMarker(txn *badger.Txn) error
- func MigrateDKGEndStateFromV1(log zerolog.Logger) func(txn *badger.Txn) error
- func RetrieveDKGStartedForEpoch(epochCounter uint64, started *bool) func(*badger.Txn) error
- func RetrieveDKGStateForEpoch(epochCounter uint64, currentState *flow.DKGState) func(*badger.Txn) error
- func RetrieveMyBeaconPrivateKey(epochCounter uint64, info *encodable.RandomBeaconPrivKey) func(*badger.Txn) error
- func RetryOnConflict(action func(func(*badger.Txn) error) error, op func(tx *badger.Txn) error) error
- func RetryOnConflictTx(db *badger.DB, action func(*badger.DB, func(*transaction.Tx) error) error, ...) error
- func SetMax(tx storage.Transaction) error
- func SkipDuplicates(op func(*badger.Txn) error) func(tx *badger.Txn) error
- func SkipDuplicatesTx(op func(*transaction.Tx) error) func(tx *transaction.Tx) error
- func SkipNonExist(op func(*badger.Txn) error) func(tx *badger.Txn) error
- func UpsertDKGStateForEpoch(epochCounter uint64, newState flow.DKGState) func(*badger.Txn) error
- func UpsertMyBeaconPrivateKey(epochCounter uint64, info *encodable.RandomBeaconPrivKey) func(*badger.Txn) error
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 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 MigrateDKGEndStateFromV1 ¶ added in v0.39.0
MigrateDKGEndStateFromV1 migrates the database that was used in protocol version v1 to the v2. It reads already stored data by deprecated prefix and writes it to the new prefix with values converted to the new representation. TODO(EFM, #6794): This function is introduced to implement a backward-compatible upgrade from v1 to v2. Remove this once we complete the network upgrade.
func RetrieveDKGStartedForEpoch ¶ added in v0.23.9
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 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 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 UpsertDKGStateForEpoch ¶ added in v0.39.0
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.