Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 884 Bytes

snapshot.md

File metadata and controls

25 lines (14 loc) · 884 Bytes

Snapshot

In the state expiration scheme, snapshots still exist, and the Account Storage structure is mainly modified:

Account storage kv: key has no change, the value will contain an extra epochNum of the slot;

Therefore, when the Storage Slot is accessed, the Epoch information will be updated in time. If the epoch of the slot is behind by more than 1 epoch, it indicates that the status has expired and cannot be accessed, and it is waiting for prune.

Of course, when the Epoch is accessed and the status expires, it will not be written to the disk immediately, but will be stored in the diff layer, with a maximum depth of 128 diff layers.

// SnapValue store snap with Epoch after BEP-216
type SnapValue struct {
	Epoch types.StateEpoch
	Val   common.Hash
}

Later support snap sync will more easy.