stages

package
v0.0.0-...-215623d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetStageProgress

func GetStageProgress(db ethdb.KVGetter, stage SyncStage) (uint64, error)

GetStageProgress retrieves saved progress of given sync stage from the database

func GetStageUnwind

func GetStageUnwind(db ethdb.KVGetter, stage SyncStage) (uint64, error)

GetStageUnwind retrieves the invalidation for the given stage Invalidation means that that stage needs to rollback to the invalidation point and be redone

func SaveStageProgress

func SaveStageProgress(db ethdb.Putter, stage SyncStage, progress uint64) error

func SaveStageUnwind

func SaveStageUnwind(db ethdb.Putter, stage SyncStage, invalidation uint64) error

SaveStageUnwind saves the progress of the given stage in the database

Types

type SyncStage

type SyncStage string

SyncStage represents the stages of syncronisation in the SyncMode.StagedSync mode It is used to persist the information about the stage state into the database. It should not be empty and should be unique.

var (
	Headers             SyncStage = "Headers"             // Headers are downloaded, their Proof-Of-Work validity and chaining is verified
	BlockHashes         SyncStage = "BlockHashes"         // Headers Number are written, fills blockHash => number bucket
	Bodies              SyncStage = "Bodies"              // Block bodies are downloaded, TxHash and UncleHash are getting verified
	Senders             SyncStage = "Senders"             // "From" recovered from signatures, bodies re-written
	Execution           SyncStage = "Execution"           // Executing each block w/o buildinf a trie
	IntermediateHashes  SyncStage = "IntermediateHashes"  // Generate intermediate hashes, calculate the state root hash
	HashState           SyncStage = "HashState"           // Apply Keccak256 to all the keys in the state
	AccountHistoryIndex SyncStage = "AccountHistoryIndex" // Generating history index for accounts
	StorageHistoryIndex SyncStage = "StorageHistoryIndex" // Generating history index for storage
	LogIndex            SyncStage = "LogIndex"            // Generating logs index (from receipts)
	CallTraces          SyncStage = "CallTraces"          // Generating call traces index
	TxLookup            SyncStage = "TxLookup"            // Generating transactions lookup index
	TxPool              SyncStage = "TxPool"              // Starts Backend
	Finish              SyncStage = "Finish"              // Nominal stage after all other stages

	MiningCreateBlock SyncStage = "MiningCreateBlock"
	MiningExecution   SyncStage = "MiningExecution"
	MiningFinish      SyncStage = "MiningFinish"

	CreateHeadersSnapshot SyncStage = "CreateHeadersSnapshot"
	CreateBodiesSnapshot  SyncStage = "CreateBodiesSnapshot"
	CreateStateSnapshot   SyncStage = "CreateStateSnapshot"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL