MCPcopy
hub / github.com/bnb-chain/bsc / diskLayer

Struct diskLayer

core/state/snapshot/disklayer.go:33–46  ·  view source on GitHub ↗

diskLayer is a low level persistent snapshot built on top of a key-value store.

Source from the content-addressed store, hash-verified

31
32// diskLayer is a low level persistent snapshot built on top of a key-value store.
33type diskLayer struct {
34 diskdb ethdb.KeyValueStore // Key-value store containing the base snapshot
35 triedb *trie.Database // Trie node cache for reconstruction purposes
36 cache *fastcache.Cache // Cache to avoid hitting the disk for direct access
37
38 root common.Hash // Root hash of the base snapshot
39 stale bool // Signals that the layer became stale (state progressed)
40
41 genMarker []byte // Marker for the state that's indexed during initial layer generation
42 genPending chan struct{} // Notification channel when generation is done (test synchronicity)
43 genAbort chan chan *generatorStats // Notification channel to abort generating the snapshot in this layer
44
45 lock sync.RWMutex
46}
47
48// Root returns root hash for which this snapshot was made.
49func (dl *diskLayer) Root() common.Hash {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected