Documentation ¶
Index ¶
- Constants
- Variables
- func BodiesForward(s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg BodiesCfg, ...) error
- func BorHeimdallForward(s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg BorHeimdallCfg, ...) (err error)
- func BorHeimdallPrune(s *PruneState, ctx context.Context, tx kv.RwTx, cfg BorHeimdallCfg) (err error)
- func BorHeimdallUnwind(u *UnwindState, ctx context.Context, s *StageState, tx kv.RwTx, ...) (err error)
- func DoUnwindCallTraces(logPrefix string, db kv.RwTx, from, to uint64, ctx context.Context, ...) error
- func DownloadAndIndexSnapshotsIfNeed(s *StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, ...) error
- func ExecBlockV3(s *StageState, u Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, ...) (err error)
- func ExecV3(ctx context.Context, execStage *StageState, u Unwinder, workerCount int, ...) error
- func FillDBFromSnapshots(logPrefix string, ctx context.Context, tx kv.RwTx, dirs datadir.Dirs, ...) error
- func FinishForward(s *StageState, tx kv.RwTx, cfg FinishCfg, initialCycle bool) error
- func HeadersPOW(s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg HeadersCfg, ...) error
- func HeadersUnwind(u *UnwindState, s *StageState, tx kv.RwTx, cfg HeadersCfg, test bool) (err error)
- func IncrementIntermediateHashes(logPrefix string, s *StageState, db kv.RwTx, to uint64, cfg TrieCfg, ...) (libcommon.Hash, error)
- func NotifyNewHeaders(ctx context.Context, finishStageBeforeSync uint64, finishStageAfterSync uint64, ...) error
- func NotifyPendingLogs(logPrefix string, notifier ChainEventNotifier, logs types.Logs, ...)
- func PrintTables(db kv.RoDB, tx kv.RwTx) []interface{}
- func PromoteHashedStateCleanly(logPrefix string, tx kv.RwTx, cfg HashStateCfg, ctx context.Context, ...) error
- func PruneAccountHistoryIndex(s *PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, ...) (err error)
- func PruneBlockHashStage(p *PruneState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
- func PruneCallTraces(s *PruneState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context, ...) (err error)
- func PruneExecutionStage(s *PruneState, tx kv.RwTx, cfg ExecuteBlockCfg, ctx context.Context, ...) (err error)
- func PruneFinish(u *PruneState, tx kv.RwTx, cfg FinishCfg, ctx context.Context) (err error)
- func PruneHashStateStage(s *PruneState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context) (err error)
- func PruneIntermediateHashesStage(s *PruneState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
- func PruneLogIndex(s *PruneState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context, ...) (err error)
- func PruneSendersStage(s *PruneState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
- func PruneStorageHistoryIndex(s *PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, ...) (err error)
- func PruneTxLookup(s *PruneState, tx kv.RwTx, cfg TxLookupCfg, ctx context.Context, ...) (err error)
- func PruneVerkleTries(s *PruneState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
- func ReadLogs(tx kv.Tx, from uint64, isUnwind bool, blockReader services.FullBlockReader) ([]*remote.SubscribeLogsReply, error)
- func ReconstituteState(ctx context.Context, s *StageState, dirs datadir.Dirs, workerCount int, ...) (err error)
- func RegenerateIntermediateHashes(logPrefix string, db kv.RwTx, cfg TrieCfg, expectedRootHash libcommon.Hash, ...) (libcommon.Hash, error)
- func SnapshotsPrune(s *PruneState, initialCycle bool, cfg SnapshotsCfg, ctx context.Context, ...) (err error)
- func SpawnAccountHistoryIndex(s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, ...) error
- func SpawnBlockHashStage(s *StageState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context, ...) (err error)
- func SpawnCallTraces(s *StageState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context, ...) error
- func SpawnExecuteBlocksStage(s *StageState, u Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, ...) (err error)
- func SpawnHashStateStage(s *StageState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context, ...) error
- func SpawnIntermediateHashesStage(s *StageState, u Unwinder, tx kv.RwTx, cfg TrieCfg, ctx context.Context, ...) (libcommon.Hash, error)
- func SpawnLogIndex(s *StageState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context, ...) error
- func SpawnMiningCreateBlockStage(s *StageState, tx kv.RwTx, cfg MiningCreateBlockCfg, quit <-chan struct{}, ...) (err error)
- func SpawnMiningExecStage(s *StageState, tx kv.RwTx, cfg MiningExecCfg, quit <-chan struct{}, ...) error
- func SpawnMiningFinishStage(s *StageState, tx kv.RwTx, cfg MiningFinishCfg, quit <-chan struct{}, ...) error
- func SpawnPostExecStage(s *StageState, tx kv.RwTx, cfg PostExecCfg, ctx context.Context) error
- func SpawnRecoverSendersStage(cfg SendersCfg, s *StageState, u Unwinder, tx kv.RwTx, toBlock uint64, ...) error
- func SpawnStageHeaders(s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg HeadersCfg, ...) error
- func SpawnStageSnapshots(s *StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, ...) (err error)
- func SpawnStorageHistoryIndex(s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, ...) error
- func SpawnTxLookup(s *StageState, tx kv.RwTx, toBlock uint64, cfg TxLookupCfg, ...) (err error)
- func SpawnVerkleTrie(s *StageState, u Unwinder, tx kv.RwTx, cfg TrieCfg, ctx context.Context, ...) (libcommon.Hash, error)
- func UnwindAccountHistoryIndex(u *UnwindState, s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
- func UnwindBlockHashStage(u *UnwindState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
- func UnwindBodiesStage(u *UnwindState, tx kv.RwTx, cfg BodiesCfg, ctx context.Context) (err error)
- func UnwindCallTraces(u *UnwindState, s *StageState, tx kv.RwTx, cfg CallTracesCfg, ...) (err error)
- func UnwindExecutionStage(u *UnwindState, s *StageState, tx kv.RwTx, ctx context.Context, ...) (err error)
- func UnwindFinish(u *UnwindState, tx kv.RwTx, cfg FinishCfg, ctx context.Context) (err error)
- func UnwindHashStateStage(u *UnwindState, s *StageState, tx kv.RwTx, cfg HashStateCfg, ...) (err error)
- func UnwindIntermediateHashesForTrieLoader(logPrefix string, rl *trie.RetainList, u *UnwindState, s *StageState, ...) (*trie.FlatDBTrieLoader, error)
- func UnwindIntermediateHashesStage(u *UnwindState, s *StageState, tx kv.RwTx, cfg TrieCfg, ctx context.Context, ...) (err error)
- func UnwindLogIndex(u *UnwindState, s *StageState, tx kv.RwTx, cfg LogIndexCfg, ...) (err error)
- func UnwindPostExecStage(u *UnwindState, s *StageState, tx kv.RwTx, cfg PostExecCfg, ...) (err error)
- func UnwindSendersStage(s *UnwindState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
- func UnwindStorageHistoryIndex(u *UnwindState, s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
- func UnwindTxLookup(u *UnwindState, s *StageState, tx kv.RwTx, cfg TxLookupCfg, ...) (err error)
- func UnwindVerkleTrie(u *UnwindState, s *StageState, tx kv.RwTx, cfg TrieCfg, ctx context.Context, ...) (err error)
- func UpdateMetrics(tx kv.Tx) error
- type BlockHashesCfg
- type BodiesCfg
- type BorHeimdallCfg
- type CallTracesCfg
- type ChainEventNotifier
- type ChainReader
- func (cr ChainReader) BorEventsByBlock(hash libcommon.Hash, number uint64) []rlp.RawValue
- func (cr ChainReader) BorSpan(spanId uint64) []byte
- func (cr ChainReader) Config() *chain.Config
- func (cr ChainReader) CurrentHeader() *types.Header
- func (cr ChainReader) FrozenBlocks() uint64
- func (cr ChainReader) GetBlock(hash libcommon.Hash, number uint64) *types.Block
- func (cr ChainReader) GetHeader(hash libcommon.Hash, number uint64) *types.Header
- func (cr ChainReader) GetHeaderByHash(hash libcommon.Hash) *types.Header
- func (cr ChainReader) GetHeaderByNumber(number uint64) *types.Header
- func (cr ChainReader) GetTd(hash libcommon.Hash, number uint64) *big.Int
- func (cr ChainReader) HasBlock(hash libcommon.Hash, number uint64) bool
- type ChainReaderImpl
- func (cr ChainReaderImpl) BorEventsByBlock(hash libcommon.Hash, number uint64) []rlp.RawValue
- func (cr ChainReaderImpl) BorSpan(spanId uint64) []byte
- func (cr ChainReaderImpl) Config() *chain.Config
- func (cr ChainReaderImpl) CurrentHeader() *types.Header
- func (cr ChainReaderImpl) FrozenBlocks() uint64
- func (cr ChainReaderImpl) GetBlock(hash libcommon.Hash, number uint64) *types.Block
- func (cr ChainReaderImpl) GetHeader(hash libcommon.Hash, number uint64) *types.Header
- func (cr ChainReaderImpl) GetHeaderByHash(hash libcommon.Hash) *types.Header
- func (cr ChainReaderImpl) GetHeaderByNumber(number uint64) *types.Header
- func (cr ChainReaderImpl) GetTd(hash libcommon.Hash, number uint64) *big.Int
- func (cr ChainReaderImpl) HasBlock(hash libcommon.Hash, number uint64) bool
- type ChangeSetHook
- type DownloaderGlue
- type ExecFunc
- type ExecuteBlockCfg
- type FinishCfg
- type HasChangeSetWriter
- type HashPromoter
- func (p *HashPromoter) Promote(logPrefix string, from, to uint64, storage bool, load etl.LoadFunc) error
- func (p *HashPromoter) PromoteOnHistoryV3(logPrefix string, from, to uint64, storage bool, ...) error
- func (p *HashPromoter) Unwind(logPrefix string, s *StageState, u *UnwindState, storage bool, ...) error
- func (p *HashPromoter) UnwindOnHistoryV3(logPrefix string, unwindFrom, unwindTo uint64, storage bool, ...) error
- type HashStateCfg
- type HeadersCfg
- type HistoryCfg
- type LogIndexCfg
- type MiningBlock
- type MiningCreateBlockCfg
- type MiningExecCfg
- type MiningFinishCfg
- type MiningState
- type OldestAppearedLoad
- type PostExecCfg
- type Progress
- type Promoter
- func (p *Promoter) Promote(logPrefix string, from, to uint64, storage, codes bool) error
- func (p *Promoter) PromoteOnHistoryV3(logPrefix string, from, to uint64, storage bool) error
- func (p *Promoter) Unwind(logPrefix string, s *StageState, u *UnwindState, storage bool, codes bool) error
- func (p *Promoter) UnwindOnHistoryV3(logPrefix string, unwindFrom, unwindTo uint64, storage, codes bool) error
- type PruneFunc
- type PruneOrder
- type PruneState
- type SendersCfg
- type SnapshotsCfg
- type Stage
- func DefaultStages(ctx context.Context, snapshots SnapshotsCfg, headers HeadersCfg, ...) []*Stage
- func MiningStages(ctx context.Context, createBlockCfg MiningCreateBlockCfg, ...) []*Stage
- func PipelineStages(ctx context.Context, snapshots SnapshotsCfg, blockHashCfg BlockHashesCfg, ...) []*Stage
- func StateStages(ctx context.Context, headers HeadersCfg, bodies BodiesCfg, ...) []*Stage
- type StageState
- func (s *StageState) ExecutionAt(db kv.Getter) (uint64, error)
- func (s *StageState) IntermediateHashesAt(db kv.Getter) (uint64, error)
- func (s *StageState) LogPrefix() string
- func (s *StageState) Update(db kv.Putter, newBlockNum uint64) error
- func (s *StageState) UpdatePrune(db kv.Putter, blockNum uint64) error
- type Sync
- func (s *Sync) DisableAllStages() []stages.SyncStage
- func (s *Sync) DisableStages(ids ...stages.SyncStage)
- func (s *Sync) EnableStages(ids ...stages.SyncStage)
- func (s *Sync) IsAfter(stage1, stage2 stages.SyncStage) bool
- func (s *Sync) IsBefore(stage1, stage2 stages.SyncStage) bool
- func (s *Sync) IsDone() bool
- func (s *Sync) Len() int
- func (s *Sync) LogPrefix() string
- func (s *Sync) MockExecFunc(id stages.SyncStage, f ExecFunc)
- func (s *Sync) NewUnwindState(id stages.SyncStage, unwindPoint, currentProgress uint64) *UnwindState
- func (s *Sync) NextStage()
- func (s *Sync) PrevUnwindPoint() *uint64
- func (s *Sync) PrintTimings() []interface{}
- func (s *Sync) PruneStageState(id stages.SyncStage, forwardProgress uint64, tx kv.Tx, db kv.RwDB) (*PruneState, error)
- func (s *Sync) Run(db kv.RwDB, tx kv.RwTx, firstCycle bool) error
- func (s *Sync) RunNoInterrupt(db kv.RwDB, tx kv.RwTx, firstCycle bool) error
- func (s *Sync) RunPrune(db kv.RwDB, tx kv.RwTx, firstCycle bool) error
- func (s *Sync) RunUnwind(db kv.RwDB, tx kv.RwTx) error
- func (s *Sync) SetCurrentStage(id stages.SyncStage) error
- func (s *Sync) StageState(stage stages.SyncStage, tx kv.Tx, db kv.RoDB) (*StageState, error)
- func (s *Sync) UnwindTo(unwindPoint uint64, reason UnwindReason)
- type Timing
- type TrieCfg
- type TxLookupCfg
- type TxPoolForMining
- type UnwindFunc
- type UnwindOrder
- type UnwindReason
- type UnwindState
- type Unwinder
Constants ¶
const ShortPoSReorgThresholdBlocks = 10
The number of blocks we should be able to re-org sub-second on commodity hardware. See https://hackmd.io/TdJtNs0dS56q-In8h-ShSg
Variables ¶
var DefaultForwardOrder = UnwindOrder{ stages.Snapshots, stages.Headers, stages.BorHeimdall, stages.BlockHashes, stages.Bodies, stages.Senders, stages.Execution, stages.HashState, stages.IntermediateHashes, stages.CallTraces, stages.AccountHistoryIndex, stages.StorageHistoryIndex, stages.LogIndex, stages.TxLookup, stages.Finish, }
var DefaultPruneOrder = PruneOrder{ stages.Finish, stages.TxLookup, stages.LogIndex, stages.StorageHistoryIndex, stages.AccountHistoryIndex, stages.CallTraces, stages.HashState, stages.IntermediateHashes, stages.Execution, stages.Senders, stages.Bodies, stages.BlockHashes, stages.BorHeimdall, stages.Headers, stages.Snapshots, }
var DefaultUnwindOrder = UnwindOrder{ stages.Finish, stages.TxLookup, stages.LogIndex, stages.StorageHistoryIndex, stages.AccountHistoryIndex, stages.CallTraces, stages.HashState, stages.IntermediateHashes, stages.Execution, stages.Senders, stages.Bodies, stages.BlockHashes, stages.BorHeimdall, stages.Headers, }
var ExecUnwind = UnwindReason{nil, nil}
var ForkChoice = UnwindReason{nil, nil}
var MiningPruneOrder = PruneOrder{} // nothing to unwind in mining - because mining does not commit db changes
var MiningUnwindOrder = UnwindOrder{} // nothing to unwind in mining - because mining does not commit db changes
var PipelinePruneOrder = PruneOrder{ stages.Finish, stages.TxLookup, stages.LogIndex, stages.StorageHistoryIndex, stages.AccountHistoryIndex, stages.CallTraces, stages.HashState, stages.IntermediateHashes, stages.Execution, stages.Senders, stages.BlockHashes, stages.Snapshots, }
var PipelineUnwindOrder = UnwindOrder{ stages.Finish, stages.TxLookup, stages.LogIndex, stages.StorageHistoryIndex, stages.AccountHistoryIndex, stages.CallTraces, stages.HashState, stages.IntermediateHashes, stages.Execution, stages.Senders, stages.BlockHashes, }
var StagedUnwind = UnwindReason{nil, nil}
var StateUnwindOrder = UnwindOrder{ stages.HashState, stages.IntermediateHashes, stages.Execution, stages.Senders, stages.Bodies, stages.BlockHashes, stages.Headers, }
Functions ¶
func BodiesForward ¶
func BodiesForward( s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg BodiesCfg, test bool, firstCycle bool, logger log.Logger, ) error
BodiesForward progresses Bodies stage in the forward direction
func BorHeimdallForward ¶
func BorHeimdallForward( s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg BorHeimdallCfg, mine bool, logger log.Logger, ) (err error)
func BorHeimdallPrune ¶
func BorHeimdallPrune(s *PruneState, ctx context.Context, tx kv.RwTx, cfg BorHeimdallCfg) (err error)
func BorHeimdallUnwind ¶
func BorHeimdallUnwind(u *UnwindState, ctx context.Context, s *StageState, tx kv.RwTx, cfg BorHeimdallCfg) (err error)
func DoUnwindCallTraces ¶
func DownloadAndIndexSnapshotsIfNeed ¶
func DownloadAndIndexSnapshotsIfNeed(s *StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, initialCycle bool, logger log.Logger) error
func ExecBlockV3 ¶
func ExecBlockV3(s *StageState, u Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, cfg ExecuteBlockCfg, initialCycle bool, logger log.Logger) (err error)
func ExecV3 ¶
func ExecV3(ctx context.Context, execStage *StageState, u Unwinder, workerCount int, cfg ExecuteBlockCfg, applyTx kv.RwTx, parallel bool, logPrefix string, maxBlockNum uint64, logger log.Logger, initialCycle bool, ) error
ExecV3 - parallel execution. Has many layers of abstractions - each layer does accumulate state changes (updates) and can "atomically commit all changes to underlying layer of abstraction"
Layers from top to bottom: - IntraBlockState - used to exec txs. It does store inside all updates of given txn. Can understan if txn failed or OutOfGas - then revert all changes. Each parallel-worker hav own IntraBlockState. IntraBlockState does commit changes to lower-abstraction-level by method `ibs.MakeWriteSet()`
- StateWriterBufferedV3 - txs which executed by parallel workers can conflict with each-other. This writer does accumulate updates and then send them to conflict-resolution. Until conflict-resolution succeed - none of execution updates must pass to lower-abstraction-level. Object TxTask it's just set of small buffers (readset + writeset) for each transaction. Write to TxTask happends by code like `txTask.ReadLists = rw.stateReader.ReadSet()`.
- TxTask - objects coming from parallel-workers to conflict-resolution goroutine (ApplyLoop and method ReadsValid). Flush of data to lower-level-of-abstraction is done by method `agg.ApplyState` (method agg.ApplyHistory exists only for performance - to reduce time of RwLock on state, but by meaning `ApplyState+ApplyHistory` it's 1 method to flush changes from TxTask to lower-level-of-abstraction).
- StateV3 - it's all updates which are stored in RAM - all parallel workers can see this updates. Execution of txs always done on Valid version of state (no partial-updates of state). Flush of updates to lower-level-of-abstractions done by method `StateV3.Flush`. On this level-of-abstraction also exists StateReaderV3. IntraBlockState does call StateReaderV3, and StateReaderV3 call StateV3(in-mem-cache) or DB (RoTx). WAL - also on this level-of-abstraction - agg.ApplyHistory does write updates from TxTask to WAL. WAL it's like StateV3 just without reading api (can only write there). WAL flush to disk periodically (doesn't need much RAM).
- RoTx - see everything what committed to DB. Commit is done by rwLoop goroutine. rwloop does:
- stop all Workers
- call StateV3.Flush()
- commit
- open new RoTx
- set new RoTx to all Workers
- start Workersстартует воркеры
When rwLoop has nothing to do - it does Prune, or flush of WAL to RwTx (agg.rotate+agg.Flush)
func FillDBFromSnapshots ¶
func FinishForward ¶
func HeadersPOW ¶
func HeadersPOW( s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg HeadersCfg, initialCycle bool, test bool, useExternalTx bool, logger log.Logger, ) error
HeadersPOW progresses Headers stage for Proof-of-Work headers
func HeadersUnwind ¶
func HeadersUnwind(u *UnwindState, s *StageState, tx kv.RwTx, cfg HeadersCfg, test bool) (err error)
func NotifyNewHeaders ¶
func NotifyPendingLogs ¶
func NotifyPendingLogs(logPrefix string, notifier ChainEventNotifier, logs types.Logs, logger log.Logger)
func PruneAccountHistoryIndex ¶
func PruneAccountHistoryIndex(s *PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, logger log.Logger) (err error)
func PruneBlockHashStage ¶
func PruneBlockHashStage(p *PruneState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
func PruneCallTraces ¶
func PruneCallTraces(s *PruneState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context, logger log.Logger) (err error)
func PruneExecutionStage ¶
func PruneExecutionStage(s *PruneState, tx kv.RwTx, cfg ExecuteBlockCfg, ctx context.Context, initialCycle bool) (err error)
func PruneFinish ¶
func PruneHashStateStage ¶
func PruneHashStateStage(s *PruneState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context) (err error)
func PruneLogIndex ¶
func PruneLogIndex(s *PruneState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context, logger log.Logger) (err error)
func PruneSendersStage ¶
func PruneSendersStage(s *PruneState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
func PruneStorageHistoryIndex ¶
func PruneStorageHistoryIndex(s *PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, logger log.Logger) (err error)
func PruneTxLookup ¶
func PruneTxLookup(s *PruneState, tx kv.RwTx, cfg TxLookupCfg, ctx context.Context, initialCycle bool, logger log.Logger) (err error)
func PruneVerkleTries ¶
func ReadLogs ¶
func ReadLogs(tx kv.Tx, from uint64, isUnwind bool, blockReader services.FullBlockReader) ([]*remote.SubscribeLogsReply, error)
func ReconstituteState ¶
func ReconstituteState(ctx context.Context, s *StageState, dirs datadir.Dirs, workerCount int, batchSize datasize.ByteSize, chainDb kv.RwDB, blockReader services.FullBlockReader, logger log.Logger, agg *state2.AggregatorV3, engine consensus.Engine, chainConfig *chain.Config, genesis *types.Genesis) (err error)
func SnapshotsPrune ¶
func SnapshotsPrune(s *PruneState, initialCycle bool, cfg SnapshotsCfg, ctx context.Context, tx kv.RwTx) (err error)
====== PRUNING ======
snapshots pruning sections works more as a retiring of blocks retiring blocks means moving block data from db into snapshots
func SpawnAccountHistoryIndex ¶
func SpawnAccountHistoryIndex(s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, logger log.Logger) error
func SpawnBlockHashStage ¶
func SpawnBlockHashStage(s *StageState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context, logger log.Logger) (err error)
func SpawnCallTraces ¶
func SpawnCallTraces(s *StageState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context, logger log.Logger) error
func SpawnExecuteBlocksStage ¶
func SpawnExecuteBlocksStage(s *StageState, u Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, cfg ExecuteBlockCfg, initialCycle bool, logger log.Logger) (err error)
func SpawnHashStateStage ¶
func SpawnHashStateStage(s *StageState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context, logger log.Logger) error
func SpawnLogIndex ¶
func SpawnLogIndex(s *StageState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context, prematureEndBlock uint64, logger log.Logger) error
func SpawnMiningCreateBlockStage ¶
func SpawnMiningCreateBlockStage(s *StageState, tx kv.RwTx, cfg MiningCreateBlockCfg, quit <-chan struct{}, logger log.Logger) (err error)
SpawnMiningCreateBlockStage TODO: - resubmitAdjustCh - variable is not implemented
func SpawnMiningExecStage ¶
func SpawnMiningExecStage(s *StageState, tx kv.RwTx, cfg MiningExecCfg, quit <-chan struct{}, logger log.Logger) error
SpawnMiningExecStage TODO: - resubmitAdjustCh - variable is not implemented
func SpawnMiningFinishStage ¶
func SpawnMiningFinishStage(s *StageState, tx kv.RwTx, cfg MiningFinishCfg, quit <-chan struct{}, logger log.Logger) error
func SpawnPostExecStage ¶
func SpawnPostExecStage(s *StageState, tx kv.RwTx, cfg PostExecCfg, ctx context.Context) error
func SpawnRecoverSendersStage ¶
func SpawnRecoverSendersStage(cfg SendersCfg, s *StageState, u Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, logger log.Logger) error
func SpawnStageHeaders ¶
func SpawnStageHeaders( s *StageState, u Unwinder, ctx context.Context, tx kv.RwTx, cfg HeadersCfg, initialCycle bool, test bool, logger log.Logger, ) error
func SpawnStageSnapshots ¶
func SpawnStageSnapshots( s *StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, initialCycle bool, logger log.Logger, ) (err error)
func SpawnStorageHistoryIndex ¶
func SpawnStorageHistoryIndex(s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context, logger log.Logger) error
func SpawnTxLookup ¶
func SpawnTxLookup(s *StageState, tx kv.RwTx, toBlock uint64, cfg TxLookupCfg, ctx context.Context, logger log.Logger) (err error)
func SpawnVerkleTrie ¶
func UnwindAccountHistoryIndex ¶
func UnwindAccountHistoryIndex(u *UnwindState, s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
func UnwindBlockHashStage ¶
func UnwindBlockHashStage(u *UnwindState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
func UnwindBodiesStage ¶
func UnwindCallTraces ¶
func UnwindCallTraces(u *UnwindState, s *StageState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context, logger log.Logger) (err error)
func UnwindExecutionStage ¶
func UnwindExecutionStage(u *UnwindState, s *StageState, tx kv.RwTx, ctx context.Context, cfg ExecuteBlockCfg, initialCycle bool, logger log.Logger) (err error)
func UnwindFinish ¶
func UnwindHashStateStage ¶
func UnwindHashStateStage(u *UnwindState, s *StageState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context, logger log.Logger) (err error)
func UnwindIntermediateHashesForTrieLoader ¶
func UnwindIntermediateHashesForTrieLoader(logPrefix string, rl *trie.RetainList, u *UnwindState, s *StageState, db kv.RwTx, cfg TrieCfg, accTrieCollectorFunc trie.HashCollector2, stTrieCollectorFunc trie.StorageHashCollector2, quit <-chan struct{}, logger log.Logger) (*trie.FlatDBTrieLoader, error)
func UnwindIntermediateHashesStage ¶
func UnwindIntermediateHashesStage(u *UnwindState, s *StageState, tx kv.RwTx, cfg TrieCfg, ctx context.Context, logger log.Logger) (err error)
func UnwindLogIndex ¶
func UnwindLogIndex(u *UnwindState, s *StageState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context) (err error)
func UnwindPostExecStage ¶
func UnwindPostExecStage(u *UnwindState, s *StageState, tx kv.RwTx, cfg PostExecCfg, ctx context.Context) (err error)
func UnwindSendersStage ¶
func UnwindSendersStage(s *UnwindState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
func UnwindStorageHistoryIndex ¶
func UnwindStorageHistoryIndex(u *UnwindState, s *StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
func UnwindTxLookup ¶
func UnwindTxLookup(u *UnwindState, s *StageState, tx kv.RwTx, cfg TxLookupCfg, ctx context.Context, logger log.Logger) (err error)
func UnwindVerkleTrie ¶
func UnwindVerkleTrie(u *UnwindState, s *StageState, tx kv.RwTx, cfg TrieCfg, ctx context.Context, logger log.Logger) (err error)
func UpdateMetrics ¶
UpdateMetrics - need update metrics manually because current "metrics" package doesn't support labels need to fix it in future
Types ¶
type BlockHashesCfg ¶
type BlockHashesCfg struct {
// contains filtered or unexported fields
}
func StageBlockHashesCfg ¶
func StageBlockHashesCfg(db kv.RwDB, tmpDir string, cc *chain.Config, headerWriter *blockio.BlockWriter) BlockHashesCfg
type BodiesCfg ¶
type BodiesCfg struct {
// contains filtered or unexported fields
}
func StageBodiesCfg ¶
func StageBodiesCfg(db kv.RwDB, bd *bodydownload.BodyDownload, bodyReqSend func(context.Context, *bodydownload.BodyRequest) ([64]byte, bool), penalise func(context.Context, []headerdownload.PenaltyItem), blockPropagator adapter.BlockPropagator, timeout int, chanConfig chain.Config, blockReader services.FullBlockReader, historyV3 bool, blockWriter *blockio.BlockWriter) BodiesCfg
type BorHeimdallCfg ¶
type BorHeimdallCfg struct {
// contains filtered or unexported fields
}
func StageBorHeimdallCfg ¶
func StageBorHeimdallCfg( db kv.RwDB, snapDb kv.RwDB, miningState MiningState, chainConfig chain.Config, heimdallClient heimdall.IHeimdallClient, blockReader services.FullBlockReader, hd *headerdownload.HeaderDownload, penalize func(context.Context, []headerdownload.PenaltyItem), recents *lru.ARCCache[libcommon.Hash, *bor.Snapshot], signatures *lru.ARCCache[libcommon.Hash, libcommon.Address], ) BorHeimdallCfg
type CallTracesCfg ¶
type CallTracesCfg struct { ToBlock uint64 // not setting this params means no limit // contains filtered or unexported fields }
func StageCallTracesCfg ¶
type ChainEventNotifier ¶
type ChainReader ¶
Implements consensus.ChainReader
func (ChainReader) BorEventsByBlock ¶
func (ChainReader) BorSpan ¶
func (cr ChainReader) BorSpan(spanId uint64) []byte
func (ChainReader) Config ¶
func (cr ChainReader) Config() *chain.Config
Config retrieves the blockchain's chain configuration.
func (ChainReader) CurrentHeader ¶
func (cr ChainReader) CurrentHeader() *types.Header
CurrentHeader retrieves the current header from the local chain.
func (ChainReader) FrozenBlocks ¶
func (cr ChainReader) FrozenBlocks() uint64
func (ChainReader) GetHeader ¶
GetHeader retrieves a block header from the database by hash and number.
func (ChainReader) GetHeaderByHash ¶
func (cr ChainReader) GetHeaderByHash(hash libcommon.Hash) *types.Header
GetHeaderByHash retrieves a block header from the database by its hash.
func (ChainReader) GetHeaderByNumber ¶
func (cr ChainReader) GetHeaderByNumber(number uint64) *types.Header
GetHeaderByNumber retrieves a block header from the database by number.
type ChainReaderImpl ¶
type ChainReaderImpl struct {
// contains filtered or unexported fields
}
func NewChainReaderImpl ¶
func NewChainReaderImpl(config *chain.Config, tx kv.Tx, blockReader services.FullBlockReader, logger log.Logger) *ChainReaderImpl
func (ChainReaderImpl) BorEventsByBlock ¶
func (ChainReaderImpl) BorSpan ¶
func (cr ChainReaderImpl) BorSpan(spanId uint64) []byte
func (ChainReaderImpl) Config ¶
func (cr ChainReaderImpl) Config() *chain.Config
func (ChainReaderImpl) CurrentHeader ¶
func (cr ChainReaderImpl) CurrentHeader() *types.Header
func (ChainReaderImpl) FrozenBlocks ¶
func (cr ChainReaderImpl) FrozenBlocks() uint64
func (ChainReaderImpl) GetHeaderByHash ¶
func (cr ChainReaderImpl) GetHeaderByHash(hash libcommon.Hash) *types.Header
func (ChainReaderImpl) GetHeaderByNumber ¶
func (cr ChainReaderImpl) GetHeaderByNumber(number uint64) *types.Header
type ChangeSetHook ¶
type ChangeSetHook func(blockNum uint64, wr *state.ChangeSetWriter)
type DownloaderGlue ¶
type DownloaderGlue interface { SpawnHeaderDownloadStage([]func() error, *StageState, Unwinder) error SpawnBodyDownloadStage(string, string, *StageState, Unwinder, *bodydownload.PrefetchedBlocks) (bool, error) }
type ExecFunc ¶
type ExecFunc func(firstCycle bool, badBlockUnwind bool, s *StageState, unwinder Unwinder, tx kv.RwTx, logger log.Logger) error
ExecFunc is the execution function for the stage to move forward. * state - is the current state of the stage and contains stage data. * unwinder - if the stage needs to cause unwinding, `unwinder` methods can be used.
type ExecuteBlockCfg ¶
type ExecuteBlockCfg struct {
// contains filtered or unexported fields
}
func StageExecuteBlocksCfg ¶
func StageExecuteBlocksCfg( db kv.RwDB, pm prune.Mode, batchSize datasize.ByteSize, changeSetHook ChangeSetHook, chainConfig *chain.Config, engine consensus.Engine, vmConfig *vm.Config, accumulator *shards.Accumulator, stateStream bool, badBlockHalt bool, historyV3 bool, dirs datadir.Dirs, blockReader services.FullBlockReader, hd headerDownloader, genesis *types.Genesis, syncCfg ethconfig.Sync, agg *libstate.AggregatorV3, silkworm *silkworm.Silkworm, ) ExecuteBlockCfg
type FinishCfg ¶
type FinishCfg struct {
// contains filtered or unexported fields
}
func StageFinishCfg ¶
func StageFinishCfg(db kv.RwDB, tmpDir string, forkValidator *engine_helpers.ForkValidator) FinishCfg
type HasChangeSetWriter ¶
type HasChangeSetWriter interface {
ChangeSetWriter() *state.ChangeSetWriter
}
type HashPromoter ¶
type HashPromoter struct { ChangeSetBufSize uint64 TempDir string // contains filtered or unexported fields }
func NewHashPromoter ¶
func NewHashPromoter(db kv.RwTx, tempDir string, quitCh <-chan struct{}, logPrefix string, logger log.Logger) *HashPromoter
func (*HashPromoter) PromoteOnHistoryV3 ¶
func (*HashPromoter) Unwind ¶
func (p *HashPromoter) Unwind(logPrefix string, s *StageState, u *UnwindState, storage bool, load etl.LoadFunc) error
func (*HashPromoter) UnwindOnHistoryV3 ¶
type HashStateCfg ¶
type HashStateCfg struct {
// contains filtered or unexported fields
}
func StageHashStateCfg ¶
type HeadersCfg ¶
type HeadersCfg struct {
// contains filtered or unexported fields
}
func StageHeadersCfg ¶
func StageHeadersCfg( db kv.RwDB, headerDownload *headerdownload.HeaderDownload, bodyDownload *bodydownload.BodyDownload, chainConfig chain.Config, headerReqSend func(context.Context, *headerdownload.HeaderRequest) ([64]byte, bool), announceNewHashes func(context.Context, []headerdownload.Announce), penalize func(context.Context, []headerdownload.PenaltyItem), batchSize datasize.ByteSize, noP2PDiscovery bool, blockReader services.FullBlockReader, blockWriter *blockio.BlockWriter, tmpdir string, notifications *shards.Notifications, forkValidator *engine_helpers.ForkValidator, loopBreakCheck func() bool) HeadersCfg
type HistoryCfg ¶
type HistoryCfg struct {
// contains filtered or unexported fields
}
func StageHistoryCfg ¶
type LogIndexCfg ¶
type LogIndexCfg struct {
// contains filtered or unexported fields
}
func StageLogIndexCfg ¶
type MiningBlock ¶
type MiningBlock struct { Header *types.Header Uncles []*types.Header Txs types.Transactions Receipts types.Receipts Withdrawals []*types.Withdrawal PreparedTxs types.TransactionsStream }
type MiningCreateBlockCfg ¶
type MiningCreateBlockCfg struct {
// contains filtered or unexported fields
}
func StageMiningCreateBlockCfg ¶
func StageMiningCreateBlockCfg(db kv.RwDB, miner MiningState, chainConfig chain.Config, engine consensus.Engine, txPoolDB kv.RoDB, blockBuilderParameters *core.BlockBuilderParameters, tmpdir string, blockReader services.FullBlockReader) MiningCreateBlockCfg
type MiningExecCfg ¶
type MiningExecCfg struct {
// contains filtered or unexported fields
}
func StageMiningExecCfg ¶
func StageMiningExecCfg( db kv.RwDB, miningState MiningState, notifier ChainEventNotifier, chainConfig chain.Config, engine consensus.Engine, vmConfig *vm.Config, tmpdir string, interrupt *int32, payloadId uint64, txPool2 TxPoolForMining, txPool2DB kv.RoDB, blockReader services.FullBlockReader, ) MiningExecCfg
type MiningFinishCfg ¶
type MiningFinishCfg struct {
// contains filtered or unexported fields
}
func StageMiningFinishCfg ¶
func StageMiningFinishCfg( db kv.RwDB, chainConfig chain.Config, engine consensus.Engine, miningState MiningState, sealCancel chan struct{}, blockReader services.FullBlockReader, latestBlockBuiltStore *builder.LatestBlockBuiltStore, ) MiningFinishCfg
type MiningState ¶
type MiningState struct { MiningConfig *params.MiningConfig PendingResultCh chan *types.Block MiningResultCh chan *types.Block MiningResultPOSCh chan *types.BlockWithReceipts MiningBlock *MiningBlock }
func NewMiningState ¶
func NewMiningState(cfg *params.MiningConfig) MiningState
func NewProposingState ¶
func NewProposingState(cfg *params.MiningConfig) MiningState
type OldestAppearedLoad ¶
type OldestAppearedLoad struct {
// contains filtered or unexported fields
}
func (*OldestAppearedLoad) LoadFunc ¶
func (l *OldestAppearedLoad) LoadFunc(k, v []byte, table etl.CurrentTableReader, next etl.LoadNextFunc) error
type PostExecCfg ¶
type PostExecCfg struct {
// contains filtered or unexported fields
}
func StagePostExecCfg ¶
func StagePostExecCfg(db kv.RwDB, borDb kv.RwDB) PostExecCfg
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
func NewProgress ¶
type Promoter ¶
type Promoter struct { ChangeSetBufSize uint64 // contains filtered or unexported fields }
func NewPromoter ¶
func (*Promoter) PromoteOnHistoryV3 ¶
func (*Promoter) Unwind ¶
func (p *Promoter) Unwind(logPrefix string, s *StageState, u *UnwindState, storage bool, codes bool) error
type PruneFunc ¶
type PruneFunc func(firstCycle bool, p *PruneState, tx kv.RwTx, logger log.Logger) error
PruneFunc is the execution function for the stage to prune old data. * state - is the current state of the stage and contains stage data.
type PruneOrder ¶
type PruneState ¶
type PruneState struct { ID stages.SyncStage ForwardProgress uint64 // progress of stage forward move PruneProgress uint64 // progress of stage prune move. after sync cycle it become equal to ForwardProgress by Done() method // contains filtered or unexported fields }
func (*PruneState) LogPrefix ¶
func (s *PruneState) LogPrefix() string
type SendersCfg ¶
type SendersCfg struct {
// contains filtered or unexported fields
}
func StageSendersCfg ¶
func StageSendersCfg(db kv.RwDB, chainCfg *chain.Config, badBlockHalt bool, tmpdir string, prune prune.Mode, blockReader services.FullBlockReader, hd *headerdownload.HeaderDownload) SendersCfg
type SnapshotsCfg ¶
type SnapshotsCfg struct {
// contains filtered or unexported fields
}
func StageSnapshotsCfg ¶
func StageSnapshotsCfg(db kv.RwDB, chainConfig chain.Config, dirs datadir.Dirs, blockRetire services.BlockRetire, snapshotDownloader proto_downloader.DownloaderClient, blockReader services.FullBlockReader, dbEventNotifier services.DBEventNotifier, historyV3 bool, agg *state.AggregatorV3, caplin bool, silkworm *silkworm.Silkworm, ) SnapshotsCfg
type Stage ¶
type Stage struct { // Description is a string that is shown in the logs. Description string // DisabledDescription shows in the log with a message if the stage is disabled. Here, you can show which command line flags should be provided to enable the page. DisabledDescription string // Forward is called when the stage is executed. The main logic of the stage should be here. Should always end with `s.Done()` to allow going to the next stage. MUST NOT be nil! Forward ExecFunc // Unwind is called when the stage should be unwound. The unwind logic should be there. MUST NOT be nil! Unwind UnwindFunc Prune PruneFunc // ID of the sync stage. Should not be empty and should be unique. It is recommended to prefix it with reverse domain to avoid clashes (`com.example.my-stage`). ID stages.SyncStage // Disabled defines if the stage is disabled. It sets up when the stage is build by its `StageBuilder`. Disabled bool }
Stage is a single sync stage in staged sync.
func DefaultStages ¶
func DefaultStages(ctx context.Context, snapshots SnapshotsCfg, headers HeadersCfg, borHeimdallCfg BorHeimdallCfg, blockHashCfg BlockHashesCfg, bodies BodiesCfg, senders SendersCfg, exec ExecuteBlockCfg, hashState HashStateCfg, trieCfg TrieCfg, history HistoryCfg, logIndex LogIndexCfg, callTraces CallTracesCfg, txLookup TxLookupCfg, finish FinishCfg, test bool) []*Stage
func MiningStages ¶
func MiningStages( ctx context.Context, createBlockCfg MiningCreateBlockCfg, borHeimdallCfg BorHeimdallCfg, execCfg MiningExecCfg, hashStateCfg HashStateCfg, trieCfg TrieCfg, finish MiningFinishCfg, ) []*Stage
func PipelineStages ¶
func PipelineStages(ctx context.Context, snapshots SnapshotsCfg, blockHashCfg BlockHashesCfg, senders SendersCfg, exec ExecuteBlockCfg, hashState HashStateCfg, trieCfg TrieCfg, history HistoryCfg, logIndex LogIndexCfg, callTraces CallTracesCfg, txLookup TxLookupCfg, finish FinishCfg, test bool) []*Stage
func StateStages ¶
func StateStages(ctx context.Context, headers HeadersCfg, bodies BodiesCfg, blockHashCfg BlockHashesCfg, senders SendersCfg, exec ExecuteBlockCfg, hashState HashStateCfg, trieCfg TrieCfg) []*Stage
StateStages are all stages necessary for basic unwind and stage computation, it is primarily used to process side forks and memory execution.
type StageState ¶
type StageState struct { ID stages.SyncStage BlockNumber uint64 // BlockNumber is the current block number of the stage at the beginning of the state execution. // contains filtered or unexported fields }
StageState is the state of the stage.
func (*StageState) ExecutionAt ¶
func (s *StageState) ExecutionAt(db kv.Getter) (uint64, error)
ExecutionAt gets the current state of the "Execution" stage, which block is currently executed.
func (*StageState) IntermediateHashesAt ¶
func (s *StageState) IntermediateHashesAt(db kv.Getter) (uint64, error)
IntermediateHashesAt gets the current state of the "IntermediateHashes" stage. A block is fully validated after the IntermediateHashes stage is passed successfully.
func (*StageState) LogPrefix ¶
func (s *StageState) LogPrefix() string
func (*StageState) Update ¶
func (s *StageState) Update(db kv.Putter, newBlockNum uint64) error
Update updates the stage state (current block number) in the database. Can be called multiple times during stage execution.
func (*StageState) UpdatePrune ¶
func (s *StageState) UpdatePrune(db kv.Putter, blockNum uint64) error
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
func New ¶
func New(stagesList []*Stage, unwindOrder UnwindOrder, pruneOrder PruneOrder, logger log.Logger) *Sync
func (*Sync) DisableAllStages ¶
DisableAllStages - including their unwinds
func (*Sync) DisableStages ¶
func (*Sync) EnableStages ¶
func (*Sync) NewUnwindState ¶
func (s *Sync) NewUnwindState(id stages.SyncStage, unwindPoint, currentProgress uint64) *UnwindState
func (*Sync) PrevUnwindPoint ¶
func (*Sync) PrintTimings ¶
func (s *Sync) PrintTimings() []interface{}
func (*Sync) PruneStageState ¶
func (*Sync) RunNoInterrupt ¶
func (*Sync) StageState ¶
func (*Sync) UnwindTo ¶
func (s *Sync) UnwindTo(unwindPoint uint64, reason UnwindReason)
type TrieCfg ¶
type TrieCfg struct {
// contains filtered or unexported fields
}
func StageTrieCfg ¶
func StageTrieCfg(db kv.RwDB, checkRoot, saveNewHashesToDB, badBlockHalt bool, tmpDir string, blockReader services.FullBlockReader, hd *headerdownload.HeaderDownload, historyV3 bool, agg *state.AggregatorV3) TrieCfg
type TxLookupCfg ¶
type TxLookupCfg struct {
// contains filtered or unexported fields
}
func StageTxLookupCfg ¶
func StageTxLookupCfg( db kv.RwDB, prune prune.Mode, tmpdir string, borConfig *chain.BorConfig, blockReader services.FullBlockReader, ) TxLookupCfg
type TxPoolForMining ¶
type UnwindFunc ¶
type UnwindFunc func(firstCycle bool, u *UnwindState, s *StageState, tx kv.RwTx, logger log.Logger) error
UnwindFunc is the unwinding logic of the stage. * unwindState - contains information about the unwind itself. * stageState - represents the state of this stage at the beginning of unwind.
type UnwindOrder ¶
UnwindOrder represents the order in which the stages needs to be unwound. The unwind order is important and not always just stages going backwards. Let's say, there is tx pool can be unwound only after execution. It's ok to remove some stage from here to disable only unwind of stage
type UnwindReason ¶
type UnwindReason struct { // If we;re unwinding due to a fork - we want to unlink blocks but not mark // them as bad - as they may get replayed then deselected Block *libcommon.Hash // If unwind is caused by a bad block, this error is not empty Err error }
func ForkReset ¶
func ForkReset(badBlock libcommon.Hash) UnwindReason
func (UnwindReason) IsBadBlock ¶
func (u UnwindReason) IsBadBlock() bool
type UnwindState ¶
type UnwindState struct { ID stages.SyncStage // UnwindPoint is the block to unwind to. UnwindPoint uint64 CurrentBlockNumber uint64 Reason UnwindReason // contains filtered or unexported fields }
UnwindState contains the information about unwind.
func (*UnwindState) Done ¶
func (u *UnwindState) Done(db kv.Putter) error
Done updates the DB state of the stage.
func (*UnwindState) LogPrefix ¶
func (u *UnwindState) LogPrefix() string
type Unwinder ¶
type Unwinder interface { // UnwindTo begins staged sync unwind to the specified block. UnwindTo(unwindPoint uint64, reason UnwindReason) }
Unwinder allows the stage to cause an unwind.
Source Files ¶
- all_stages.go
- chain_reader.go
- default_stages.go
- exec3.go
- stage.go
- stage_blockhashes.go
- stage_bodies.go
- stage_bor_heimdall.go
- stage_call_traces.go
- stage_execute.go
- stage_finish.go
- stage_hashstate.go
- stage_headers.go
- stage_indexes.go
- stage_interhashes.go
- stage_log_index.go
- stage_mining_create_block.go
- stage_mining_exec.go
- stage_mining_finish.go
- stage_postexec.go
- stage_senders.go
- stage_snapshots.go
- stage_txlookup.go
- stage_verkle_trie.go
- stagebuilder.go
- sync.go
- testutil.go
- types.go