stateconf

package
v1.13.14-0.3.0.rc.7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package stateconf configures state management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSnapshotUpdatePayload

func ExtractSnapshotUpdatePayload(opts ...SnapshotUpdateOption) any

ExtractSnapshotUpdatePayload returns the payload carried by a WithSnapshotUpdatePayload option. Only one such option can be used at once; behaviour is otherwise undefined.

func ExtractTrieDBUpdatePayload

func ExtractTrieDBUpdatePayload(opts ...TrieDBUpdateOption) (common.Hash, common.Hash, bool)

ExtractTrieDBUpdatePayload returns the payload carried by a WithTrieDBUpdatePayload option. Only one such option can be used at once; behaviour is otherwise undefined.

func ShouldTransformStateKey

func ShouldTransformStateKey(opts ...StateDBStateOption) bool

ShouldTransformStateKey parses the options, returning whether or not any registered state-key transformation hook should be used; i.e. it returns `true` i.f.f. there are no SkipStateKeyTransformation options in the arguments.

Types

type SnapshotUpdateOption

type SnapshotUpdateOption = options.Option[snapshotUpdateConfig]

A SnapshotUpdateOption configures the behaviour of state.SnapshotTree.Update() implementations. This will be removed along with state.SnapshotTree.

func ExtractSnapshotUpdateOpts

func ExtractSnapshotUpdateOpts(opts ...StateDBCommitOption) []SnapshotUpdateOption

ExtractSnapshotUpdateOpts returns the list of SnapshotUpdateOptions carried by the provided slice of StateDBCommitOption.

func WithSnapshotUpdatePayload

func WithSnapshotUpdatePayload(p any) SnapshotUpdateOption

WithSnapshotUpdatePayload returns a SnapshotUpdateOption carrying an arbitrary payload. It acts only as a carrier to exploit existing function plumbing and the effect on behaviour is left to the implementation receiving it.

type StateDBCommitOption

type StateDBCommitOption = options.Option[stateDBCommitConfig]

A StateDBCommitOption configures the behaviour of state.StateDB.Commit()

func WithSnapshotUpdateOpts

func WithSnapshotUpdateOpts(opts ...SnapshotUpdateOption) StateDBCommitOption

WithSnapshotUpdateOpts returns a StateDBCommitOption carrying a list of SnapshotUpdateOptions. If multiple such options are used, only the last will be applied as they overwrite each other.

func WithTrieDBUpdateOpts

func WithTrieDBUpdateOpts(opts ...TrieDBUpdateOption) StateDBCommitOption

WithTrieDBUpdateOpts returns a StateDBCommitOption carrying a list of TrieDBUpdateOptions. If multiple such options are used, only the last will be applied as they overwrite each other.

type StateDBStateOption

type StateDBStateOption = options.Option[stateDBStateConfig]

A StateDBStateOption configures the behaviour of state.StateDB methods for getting and setting state: GetState(), GetCommittedState(), and SetState().

func SkipStateKeyTransformation

func SkipStateKeyTransformation() StateDBStateOption

SkipStateKeyTransformation causes any registered state-key transformation hook to be ignored. See state.RegisterExtras() for details.

type TrieDBUpdateOption

type TrieDBUpdateOption = options.Option[triedbUpdateConfig]

A TrieDBUpdateOption configures the behaviour of triedb.Database.Update() implementations.

func ExtractTrieDBUpdateOpts

func ExtractTrieDBUpdateOpts(opts ...StateDBCommitOption) []TrieDBUpdateOption

ExtractTrieDBUpdateOpts returns the list of TrieDBUpdateOptions carried by the provided slice of StateDBCommitOption.

func WithTrieDBUpdatePayload

func WithTrieDBUpdatePayload(parent common.Hash, current common.Hash) TrieDBUpdateOption

WithTrieDBUpdatePayload returns a TrieDBUpdateOption carrying two block hashes. It acts only as a carrier to exploit existing function plumbing and the effect on behaviour is left to the implementation receiving it.

Jump to

Keyboard shortcuts

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