Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ TrieInitializer: FromScratch(), ExcludeHeight: ExcludeNone(), }
DefaultConfig sets the default configuration for the index loader. It is used when no options are specified.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
// contains filtered or unexported fields
}
Checkpoint is a loader that loads a trie from a LedgerWAL checkpoint file.
func FromCheckpointFile ¶
func FromCheckpointFile(filepath string, log *zerolog.Logger) *Checkpoint
FromCheckpointFile creates a loader which loads the trie from the provided reader, which should represent a LedgerWAL checkpoint file.
type Empty ¶
type Empty struct {
}
Empty is a loader that loads as empty execution state trie.
func FromScratch ¶
func FromScratch() *Empty
FromScratch creates a new loader which loads an empty execution state trie.
type Exclude ¶
Exclude is a function that returns true when a certain height should be excluded from the index trie restoration.
func ExcludeAtOrBelow ¶
ExcludeAtOrBelow is an exclude function that ignores heights at or below the given threshold height. It can be used with the root height of a protocol state to avoid processing the root checkpoint registers during restore.
func ExcludeNone ¶
func ExcludeNone() Exclude
ExcludeNone is an exclude function that processes all heights for index trie restoration.
type Option ¶
type Option func(*Config)
Option is a configuration option for the index loader. It can be passed to the index loader's construction function to set optional parameters.
func WithExclude ¶
WithExclude injects a function to ignore ledger register updates in the index database for certain heights when restoring the execution state trie. It can be used to exclude the root height during restoration from the index when the root checkpoint is loaded from disk directly.
func WithInitializer ¶
WithInitializer injects an initializer for the execution state trie. It will be used to initialize the execution state trie that serves as basis for the restore. It can be used with the root checkpoint loader in order to load the initial root checkpoint from the loader instead of the index.