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 ¶ added in v1.4.0
type Checkpoint struct {
// contains filtered or unexported fields
}
Checkpoint is a loader that loads a trie from a LedgerWAL checkpoint file.
func FromCheckpoint ¶ added in v1.4.0
func FromCheckpoint(file io.Reader) *Checkpoint
FromCheckpoint creates a loader which loads the trie from the provided reader, which should represent a LedgerWAL checkpoint file.
type Empty ¶ added in v1.4.3
type Empty struct { }
Empty is a loader that loads as empty execution state trie.
func FromScratch ¶ added in v1.4.3
func FromScratch() *Empty
FromScratch creates a new loader which loads an empty execution state trie.
type Exclude ¶ added in v1.4.3
Exclude is a function that returns true when a certain height should be excluded from the index trie restoration.
func ExcludeAtOrBelow ¶ added in v1.4.3
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 ¶ added in v1.4.3
func ExcludeNone() Exclude
ExcludeNone is an exclude function that processes all heights for index trie restoration.
type Index ¶ added in v1.4.0
type Index struct {
// contains filtered or unexported fields
}
Index implements an execution state trie loader on top of a DPS index, able to restore an execution state trie from the index database.
type Option ¶ added in v1.4.3
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 ¶ added in v1.4.3
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 ¶ added in v1.4.3
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.