Documentation
¶
Overview ¶
Package stateconf configures state management.
Index ¶
- func ExtractSnapshotUpdatePayload(opts ...SnapshotUpdateOption) any
- func ExtractTrieDBUpdatePayload(opts ...TrieDBUpdateOption) (common.Hash, common.Hash, bool)
- func ShouldTransformStateKey(opts ...StateDBStateOption) bool
- type SnapshotUpdateOption
- type StateDBCommitOption
- type StateDBStateOption
- type TrieDBUpdateOption
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.