Documentation ¶
Index ¶
- Constants
- Variables
- func BodiesForward(s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, ...) error
- func DefaultStages(ctx context.Context, snapshots SnapshotsCfg, headers HeadersCfg, ...) []*sync_stages.Stage
- func DefaultZkStages(ctx context.Context, snapshots SnapshotsCfg, l1SyncerCfg zkStages.L1SyncerCfg, ...) []*sync_stages.Stage
- func DoUnwindCallTraces(logPrefix string, db kv.RwTx, from, to uint64, ctx context.Context, ...) error
- func DownloadAndIndexSnapshotsIfNeed(s *sync_stages.StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, ...) error
- func ExecBlockV3(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, toBlock uint64, ...) (err error)
- func ExecV3(ctx context.Context, execStage *sync_stages.StageState, u sync_stages.Unwinder, ...) error
- func FillDBFromSnapshots(logPrefix string, ctx context.Context, tx kv.RwTx, dirs datadir.Dirs, ...) error
- func FinishForward(s *sync_stages.StageState, tx kv.RwTx, cfg FinishCfg, initialCycle bool) error
- func HeadersPOS(s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, ...) error
- func HeadersPOW(s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, ...) error
- func HeadersPrune(p *sync_stages.PruneState, tx kv.RwTx, cfg HeadersCfg, ctx context.Context) (err error)
- func HeadersUnwind(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func MiningStages(ctx context.Context, createBlockCfg MiningCreateBlockCfg, ...) []*sync_stages.Stage
- func NotifyNewHeaders(ctx context.Context, finishStageBeforeSync uint64, finishStageAfterSync uint64, ...) error
- func NotifyPendingLogs(logPrefix string, notifier ChainEventNotifier, logs types.Logs)
- func PromoteHashedStateCleanly(logPrefix string, tx kv.RwTx, cfg HashStateCfg, ctx context.Context) error
- func PruneAccountHistoryIndex(s *sync_stages.PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
- func PruneBlockHashStage(p *sync_stages.PruneState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
- func PruneBodiesStage(s *sync_stages.PruneState, tx kv.RwTx, cfg BodiesCfg, ctx context.Context) (err error)
- func PruneCallTraces(s *sync_stages.PruneState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context) (err error)
- func PruneCumulativeIndexStage(p *sync_stages.PruneState, tx kv.RwTx, ctx context.Context) (err error)
- func PruneExecutionStage(s *sync_stages.PruneState, tx kv.RwTx, cfg ExecuteBlockCfg, ...) (err error)
- func PruneFinish(u *sync_stages.PruneState, tx kv.RwTx, cfg FinishCfg, ctx context.Context) (err error)
- func PruneHashStateStage(s *sync_stages.PruneState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context) (err error)
- func PruneIntermediateHashesStage(s *sync_stages.PruneState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
- func PruneLogIndex(s *sync_stages.PruneState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context) (err error)
- func PruneSendersStage(s *sync_stages.PruneState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
- func PruneStorageHistoryIndex(s *sync_stages.PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
- func PruneTxLookup(s *sync_stages.PruneState, tx kv.RwTx, cfg TxLookupCfg, ctx context.Context, ...) (err error)
- func PruneVerkleTries(s *sync_stages.PruneState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
- func ReadLogs(tx kv.Tx, from uint64, isUnwind bool) ([]*remote.SubscribeLogsReply, error)
- func ReconstituteState(ctx context.Context, s *sync_stages.StageState, dirs datadir.Dirs, ...) (err error)
- func RegenerateIntermediateHashes(logPrefix string, db kv.RwTx, cfg TrieCfg, expectedRootHash libcommon.Hash, ...) (libcommon.Hash, error)
- func SnapshotsPrune(s *sync_stages.PruneState, cfg SnapshotsCfg, ctx context.Context, tx kv.RwTx) (err error)
- func SpawnAccountHistoryIndex(s *sync_stages.StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) error
- func SpawnBlockHashStage(s *sync_stages.StageState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
- func SpawnCallTraces(s *sync_stages.StageState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context) error
- func SpawnExecuteBlocksStage(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, toBlock uint64, ...) (err error)
- func SpawnHashStateStage(s *sync_stages.StageState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context, ...) error
- func SpawnIntermediateHashesStage(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, cfg TrieCfg, ...) (libcommon.Hash, error)
- func SpawnLogIndex(s *sync_stages.StageState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context, ...) error
- func SpawnMiningCreateBlockStage(s *sync_stages.StageState, tx kv.RwTx, cfg MiningCreateBlockCfg, ...) (err error)
- func SpawnMiningExecStage(s *sync_stages.StageState, tx kv.RwTx, cfg MiningExecCfg, quit <-chan struct{}) error
- func SpawnMiningFinishStage(s *sync_stages.StageState, tx kv.RwTx, cfg MiningFinishCfg, ...) error
- func SpawnPostExecStage(s *sync_stages.StageState, tx kv.RwTx, cfg PostExecCfg, ctx context.Context) error
- func SpawnRecoverSendersStage(cfg SendersCfg, s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, ...) error
- func SpawnStageCumulativeIndex(cfg CumulativeIndexCfg, s *sync_stages.StageState, tx kv.RwTx, ...) error
- func SpawnStageHeaders(s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, ...) error
- func SpawnStageSnapshots(s *sync_stages.StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, ...) (err error)
- func SpawnStorageHistoryIndex(s *sync_stages.StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) error
- func SpawnTxLookup(s *sync_stages.StageState, tx kv.RwTx, toBlock uint64, cfg TxLookupCfg, ...) (err error)
- func SpawnVerkleTrie(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, cfg TrieCfg, ...) (libcommon.Hash, error)
- func StateStages(ctx context.Context, headers HeadersCfg, bodies BodiesCfg, ...) []*sync_stages.Stage
- func UnwindAccountHistoryIndex(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindBlockHashStage(u *sync_stages.UnwindState, tx kv.RwTx, cfg BlockHashesCfg, ...) (err error)
- func UnwindBodiesStage(u *sync_stages.UnwindState, tx kv.RwTx, cfg BodiesCfg, ctx context.Context) (err error)
- func UnwindCallTraces(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindCumulativeIndexStage(u *sync_stages.UnwindState, cfg CumulativeIndexCfg, tx kv.RwTx, ...) (err error)
- func UnwindExecutionStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindFinish(u *sync_stages.UnwindState, tx kv.RwTx, cfg FinishCfg, ctx context.Context) (err error)
- func UnwindHashStateStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindIntermediateHashesForTrieLoader(logPrefix string, rl *trie.RetainList, u *sync_stages.UnwindState, ...) (*trie.FlatDBTrieLoader, error)
- func UnwindIntermediateHashesStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg TrieCfg, ...) (err error)
- func UnwindLogIndex(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindPostExecStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindSendersStage(s *sync_stages.UnwindState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
- func UnwindStorageHistoryIndex(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindTxLookup(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ...) (err error)
- func UnwindVerkleTrie(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg TrieCfg, ...) (err error)
- func WaitForDownloader(s *sync_stages.StageState, ctx context.Context, cfg SnapshotsCfg, tx kv.RwTx) error
- type BlockHashesCfg
- type BodiesCfg
- type CallTracesCfg
- type ChainEventNotifier
- type ChainReader
- func (cr ChainReader) Config() *chain.Config
- func (cr ChainReader) CurrentHeader() *types.Header
- 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) Config() *chain.Config
- func (cr ChainReaderImpl) CurrentHeader() *types.Header
- 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
- type ChangeSetHook
- type CumulativeIndexCfg
- type DownloaderGlue
- 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, agg *state.AggregatorV3, from, to uint64, storage bool, ...) error
- func (p *HashPromoter) Unwind(logPrefix string, s *sync_stages.StageState, u *sync_stages.UnwindState, ...) error
- func (p *HashPromoter) UnwindOnHistoryV3(logPrefix string, agg *state.AggregatorV3, unwindFrom, unwindTo uint64, ...) error
- type HashStateCfg
- type HeadersCfg
- type HermezDb
- 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, quiet bool) error
- func (p *Promoter) PromoteOnHistoryV3(logPrefix string, agg *state.AggregatorV3, from, to uint64, ...) error
- func (p *Promoter) Unwind(logPrefix string, s *sync_stages.StageState, u *sync_stages.UnwindState, ...) error
- func (p *Promoter) UnwindOnHistoryV3(logPrefix string, agg *state.AggregatorV3, unwindFrom, unwindTo uint64, ...) error
- type SendersCfg
- type SnapshotsCfg
- type TrieCfg
- type TxLookupCfg
- type WithSnapshots
Constants ¶
const ( GLOBAL_EXIT_ROOT_STORAGE_POS = 0 ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2 = "0xa40D5f56745a118D0906a34E69aeC8C0Db1cB8fA" )
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 = sync_stages.UnwindOrder{ sync_stages.Snapshots, sync_stages.Headers, sync_stages.BlockHashes, sync_stages.Bodies, sync_stages.Senders, sync_stages.Execution, sync_stages.Translation, sync_stages.HashState, sync_stages.IntermediateHashes, sync_stages.CallTraces, sync_stages.AccountHistoryIndex, sync_stages.StorageHistoryIndex, sync_stages.LogIndex, sync_stages.TxLookup, sync_stages.Finish, }
var DefaultPruneOrder = sync_stages.PruneOrder{}
var DefaultUnwindOrder = sync_stages.UnwindOrder{}
var ExecRepeats = metrics.NewCounter(`exec_repeats`) //nolint
var ExecStepsInDB = metrics.NewCounter(`exec_steps_in_db`) //nolint
var ExecTriggers = metrics.NewCounter(`exec_triggers`) //nolint
var MiningPruneOrder = sync_stages.PruneOrder{} // nothing to unwind in mining - because mining does not commit db changes
var MiningUnwindOrder = sync_stages.UnwindOrder{} // nothing to unwind in mining - because mining does not commit db changes
var StateUnwindOrder = sync_stages.UnwindOrder{}
var ZkUnwindOrder = sync_stages.UnwindOrder{ sync_stages.L1Syncer, sync_stages.Batches, sync_stages.BlockHashes, sync_stages.IntermediateHashes, sync_stages.Execution, sync_stages.HashState, sync_stages.Senders, sync_stages.Translation, sync_stages.CallTraces, sync_stages.AccountHistoryIndex, sync_stages.StorageHistoryIndex, sync_stages.LogIndex, sync_stages.TxLookup, sync_stages.Finish, }
Functions ¶
func BodiesForward ¶
func BodiesForward( s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, tx kv.RwTx, cfg BodiesCfg, test bool, firstCycle bool, quiet bool, ) error
BodiesForward progresses Bodies stage in the forward direction
func DefaultStages ¶
func DefaultStages(ctx context.Context, snapshots SnapshotsCfg, headers HeadersCfg, cumulativeIndex CumulativeIndexCfg, blockHashCfg BlockHashesCfg, bodies BodiesCfg, senders SendersCfg, exec ExecuteBlockCfg, hashState HashStateCfg, trieCfg TrieCfg, history HistoryCfg, logIndex LogIndexCfg, callTraces CallTracesCfg, txLookup TxLookupCfg, finish FinishCfg, test bool) []*sync_stages.Stage
func DefaultZkStages ¶
func DefaultZkStages( ctx context.Context, snapshots SnapshotsCfg, l1SyncerCfg zkStages.L1SyncerCfg, batchesCfg zkStages.BatchesCfg, cumulativeIndex CumulativeIndexCfg, blockHashCfg BlockHashesCfg, senders SendersCfg, exec ExecuteBlockCfg, hashState HashStateCfg, zkInterHashesCfg zkStages.ZkInterHashesCfg, history HistoryCfg, logIndex LogIndexCfg, callTraces CallTracesCfg, txLookup TxLookupCfg, finish FinishCfg, test bool, ) []*sync_stages.Stage
func DoUnwindCallTraces ¶
func DownloadAndIndexSnapshotsIfNeed ¶
func DownloadAndIndexSnapshotsIfNeed(s *sync_stages.StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, initialCycle bool) error
func ExecBlockV3 ¶
func ExecBlockV3(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, cfg ExecuteBlockCfg, initialCycle bool) (err error)
func ExecV3 ¶
func ExecV3(ctx context.Context, execStage *sync_stages.StageState, u sync_stages.Unwinder, workerCount int, cfg ExecuteBlockCfg, applyTx kv.RwTx, parallel bool, logPrefix string, maxBlockNum uint64, ) error
func FillDBFromSnapshots ¶
func FillDBFromSnapshots(logPrefix string, ctx context.Context, tx kv.RwTx, dirs datadir.Dirs, sn *snapshotsync.RoSnapshots, blockReader services.FullBlockReader, chainConfig chain.Config, engine consensus.Engine, agg *state.AggregatorV3) error
func FinishForward ¶
func FinishForward(s *sync_stages.StageState, tx kv.RwTx, cfg FinishCfg, initialCycle bool) error
func HeadersPOS ¶
func HeadersPOS( s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, tx kv.RwTx, cfg HeadersCfg, initialCycle bool, test bool, useExternalTx bool, preProgress uint64, ) error
HeadersPOS processes Proof-of-Stake requests (newPayload, forkchoiceUpdated). It also saves PoS headers downloaded by (*HeaderDownload)StartPoSDownloader into the DB.
func HeadersPOW ¶
func HeadersPOW( s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, tx kv.RwTx, cfg HeadersCfg, initialCycle bool, test bool, useExternalTx bool, ) error
HeadersPOW progresses Headers stage for Proof-of-Work headers
func HeadersPrune ¶
func HeadersPrune(p *sync_stages.PruneState, tx kv.RwTx, cfg HeadersCfg, ctx context.Context) (err error)
func HeadersUnwind ¶
func HeadersUnwind(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg HeadersCfg, test bool) (err error)
func MiningStages ¶
func MiningStages( ctx context.Context, createBlockCfg MiningCreateBlockCfg, execCfg MiningExecCfg, hashStateCfg HashStateCfg, trieCfg TrieCfg, finish MiningFinishCfg, ) []*sync_stages.Stage
func NotifyNewHeaders ¶
func NotifyPendingLogs ¶
func NotifyPendingLogs(logPrefix string, notifier ChainEventNotifier, logs types.Logs)
func PruneAccountHistoryIndex ¶
func PruneAccountHistoryIndex(s *sync_stages.PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
func PruneBlockHashStage ¶
func PruneBlockHashStage(p *sync_stages.PruneState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
func PruneBodiesStage ¶
func PruneBodiesStage(s *sync_stages.PruneState, tx kv.RwTx, cfg BodiesCfg, ctx context.Context) (err error)
func PruneCallTraces ¶
func PruneCallTraces(s *sync_stages.PruneState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context) (err error)
func PruneCumulativeIndexStage ¶
func PruneCumulativeIndexStage(p *sync_stages.PruneState, tx kv.RwTx, ctx context.Context) (err error)
func PruneExecutionStage ¶
func PruneExecutionStage(s *sync_stages.PruneState, tx kv.RwTx, cfg ExecuteBlockCfg, ctx context.Context, initialCycle bool) (err error)
func PruneFinish ¶
func PruneFinish(u *sync_stages.PruneState, tx kv.RwTx, cfg FinishCfg, ctx context.Context) (err error)
func PruneHashStateStage ¶
func PruneHashStateStage(s *sync_stages.PruneState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context) (err error)
func PruneIntermediateHashesStage ¶
func PruneIntermediateHashesStage(s *sync_stages.PruneState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
func PruneLogIndex ¶
func PruneLogIndex(s *sync_stages.PruneState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context) (err error)
func PruneSendersStage ¶
func PruneSendersStage(s *sync_stages.PruneState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
func PruneStorageHistoryIndex ¶
func PruneStorageHistoryIndex(s *sync_stages.PruneState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
func PruneTxLookup ¶
func PruneTxLookup(s *sync_stages.PruneState, tx kv.RwTx, cfg TxLookupCfg, ctx context.Context, initialCycle bool) (err error)
func PruneVerkleTries ¶
func PruneVerkleTries(s *sync_stages.PruneState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
func ReconstituteState ¶
func ReconstituteState(ctx context.Context, s *sync_stages.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 *sync_stages.PruneState, 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 *sync_stages.StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) error
func SpawnBlockHashStage ¶
func SpawnBlockHashStage(s *sync_stages.StageState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
func SpawnCallTraces ¶
func SpawnCallTraces(s *sync_stages.StageState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context) error
func SpawnExecuteBlocksStage ¶
func SpawnExecuteBlocksStage(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, cfg ExecuteBlockCfg, initialCycle bool, quiet bool) (err error)
func SpawnHashStateStage ¶
func SpawnHashStateStage(s *sync_stages.StageState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context, quiet bool) error
func SpawnIntermediateHashesStage ¶
func SpawnIntermediateHashesStage(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, cfg TrieCfg, ctx context.Context, quiet bool) (libcommon.Hash, error)
func SpawnLogIndex ¶
func SpawnLogIndex(s *sync_stages.StageState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context, prematureEndBlock uint64) error
func SpawnMiningCreateBlockStage ¶
func SpawnMiningCreateBlockStage(s *sync_stages.StageState, tx kv.RwTx, cfg MiningCreateBlockCfg, quit <-chan struct{}) (err error)
SpawnMiningCreateBlockStage TODO: - resubmitAdjustCh - variable is not implemented
func SpawnMiningExecStage ¶
func SpawnMiningExecStage(s *sync_stages.StageState, tx kv.RwTx, cfg MiningExecCfg, quit <-chan struct{}) error
SpawnMiningExecStage TODO: - resubmitAdjustCh - variable is not implemented
func SpawnMiningFinishStage ¶
func SpawnMiningFinishStage(s *sync_stages.StageState, tx kv.RwTx, cfg MiningFinishCfg, quit <-chan struct{}) error
func SpawnPostExecStage ¶
func SpawnPostExecStage(s *sync_stages.StageState, tx kv.RwTx, cfg PostExecCfg, ctx context.Context) error
func SpawnRecoverSendersStage ¶
func SpawnRecoverSendersStage(cfg SendersCfg, s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, toBlock uint64, ctx context.Context, quiet bool) error
func SpawnStageCumulativeIndex ¶
func SpawnStageCumulativeIndex(cfg CumulativeIndexCfg, s *sync_stages.StageState, tx kv.RwTx, ctx context.Context) error
func SpawnStageHeaders ¶
func SpawnStageHeaders( s *sync_stages.StageState, u sync_stages.Unwinder, ctx context.Context, tx kv.RwTx, cfg HeadersCfg, initialCycle bool, test bool, ) error
func SpawnStageSnapshots ¶
func SpawnStageSnapshots( s *sync_stages.StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, initialCycle bool, ) (err error)
func SpawnStorageHistoryIndex ¶
func SpawnStorageHistoryIndex(s *sync_stages.StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) error
func SpawnTxLookup ¶
func SpawnTxLookup(s *sync_stages.StageState, tx kv.RwTx, toBlock uint64, cfg TxLookupCfg, ctx context.Context) (err error)
func SpawnVerkleTrie ¶
func SpawnVerkleTrie(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (libcommon.Hash, error)
func StateStages ¶
func StateStages(ctx context.Context, headers HeadersCfg, bodies BodiesCfg, blockHashCfg BlockHashesCfg, senders SendersCfg, exec ExecuteBlockCfg, hashState HashStateCfg, trieCfg TrieCfg) []*sync_stages.Stage
StateStages are all stages necessary for basic unwind and stage computation, it is primarily used to process side forks and memory execution.
func UnwindAccountHistoryIndex ¶
func UnwindAccountHistoryIndex(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
func UnwindBlockHashStage ¶
func UnwindBlockHashStage(u *sync_stages.UnwindState, tx kv.RwTx, cfg BlockHashesCfg, ctx context.Context) (err error)
func UnwindBodiesStage ¶
func UnwindBodiesStage(u *sync_stages.UnwindState, tx kv.RwTx, cfg BodiesCfg, ctx context.Context) (err error)
func UnwindCallTraces ¶
func UnwindCallTraces(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg CallTracesCfg, ctx context.Context) (err error)
func UnwindCumulativeIndexStage ¶
func UnwindCumulativeIndexStage(u *sync_stages.UnwindState, cfg CumulativeIndexCfg, tx kv.RwTx, ctx context.Context) (err error)
func UnwindExecutionStage ¶
func UnwindExecutionStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, ctx context.Context, cfg ExecuteBlockCfg, initialCycle bool) (err error)
func UnwindFinish ¶
func UnwindFinish(u *sync_stages.UnwindState, tx kv.RwTx, cfg FinishCfg, ctx context.Context) (err error)
func UnwindHashStateStage ¶
func UnwindHashStateStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg HashStateCfg, ctx context.Context) (err error)
func UnwindIntermediateHashesForTrieLoader ¶
func UnwindIntermediateHashesForTrieLoader(logPrefix string, rl *trie.RetainList, u *sync_stages.UnwindState, s *sync_stages.StageState, db kv.RwTx, cfg TrieCfg, accTrieCollectorFunc trie.HashCollector2, stTrieCollectorFunc trie.StorageHashCollector2, quit <-chan struct{}) (*trie.FlatDBTrieLoader, error)
func UnwindIntermediateHashesStage ¶
func UnwindIntermediateHashesStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
func UnwindLogIndex ¶
func UnwindLogIndex(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg LogIndexCfg, ctx context.Context) (err error)
func UnwindPostExecStage ¶
func UnwindPostExecStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg PostExecCfg, ctx context.Context) (err error)
func UnwindSendersStage ¶
func UnwindSendersStage(s *sync_stages.UnwindState, tx kv.RwTx, cfg SendersCfg, ctx context.Context) (err error)
func UnwindStorageHistoryIndex ¶
func UnwindStorageHistoryIndex(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg HistoryCfg, ctx context.Context) (err error)
func UnwindTxLookup ¶
func UnwindTxLookup(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg TxLookupCfg, ctx context.Context) (err error)
func UnwindVerkleTrie ¶
func UnwindVerkleTrie(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg TrieCfg, ctx context.Context) (err error)
func WaitForDownloader ¶
func WaitForDownloader(s *sync_stages.StageState, ctx context.Context, cfg SnapshotsCfg, tx kv.RwTx) error
WaitForDownloader - wait for Downloader service to download all expected snapshots for MVP we sync with Downloader only once, in future will send new snapshots also
Types ¶
type BlockHashesCfg ¶
type BlockHashesCfg struct {
// contains filtered or unexported fields
}
func StageBlockHashesCfg ¶
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, snapshots *snapshotsync.RoSnapshots, blockReader services.FullBlockReader, historyV3 bool, transactionsV3 bool) BodiesCfg
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) 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) 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.Getter, blockReader services.FullBlockReader) *ChainReaderImpl
func (ChainReaderImpl) Config ¶
func (cr ChainReaderImpl) Config() *chain.Config
func (ChainReaderImpl) CurrentHeader ¶
func (cr ChainReaderImpl) CurrentHeader() *types.Header
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 CumulativeIndexCfg ¶
type CumulativeIndexCfg struct {
// contains filtered or unexported fields
}
func StageCumulativeIndexCfg ¶
func StageCumulativeIndexCfg(db kv.RwDB) CumulativeIndexCfg
type DownloaderGlue ¶
type DownloaderGlue interface { SpawnHeaderDownloadStage([]func() error, *sync_stages.StageState, sync_stages.Unwinder) error SpawnBodyDownloadStage(string, string, *sync_stages.StageState, sync_stages.Unwinder, *bodydownload.PrefetchedBlocks) (bool, error) }
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, zk *ethconfig.Zk, ) ExecuteBlockCfg
type FinishCfg ¶
type FinishCfg struct {
// contains filtered or unexported fields
}
func StageFinishCfg ¶
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) *HashPromoter
func (*HashPromoter) PromoteOnHistoryV3 ¶
func (p *HashPromoter) PromoteOnHistoryV3(logPrefix string, agg *state.AggregatorV3, from, to uint64, storage bool, load func(k []byte, v []byte) error) error
func (*HashPromoter) Unwind ¶
func (p *HashPromoter) Unwind(logPrefix string, s *sync_stages.StageState, u *sync_stages.UnwindState, storage bool, load etl.LoadFunc) error
func (*HashPromoter) UnwindOnHistoryV3 ¶
func (p *HashPromoter) UnwindOnHistoryV3(logPrefix string, agg *state.AggregatorV3, unwindFrom, unwindTo uint64, storage bool, load func(k []byte, v []byte)) error
type HashStateCfg ¶
type HashStateCfg struct {
// contains filtered or unexported fields
}
func StageHashStateCfg ¶
func StageHashStateCfg(db kv.RwDB, dirs datadir.Dirs, historyV3 bool, agg *state.AggregatorV3) HashStateCfg
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, snapshots *snapshotsync.RoSnapshots, blockReader services.FullBlockReader, tmpdir string, notifications *shards.Notifications, forkValidator *engineapi.ForkValidator) 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, txPool2 *txpool.TxPool, txPool2DB kv.RoDB, blockBuilderParameters *core.BlockBuilderParameters, tmpdir string) 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 *txpool.TxPool, txPool2DB kv.RoDB, snapshots *snapshotsync.RoSnapshots, transactionsV3 bool, ) 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{}, ) 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 (*Promoter) PromoteOnHistoryV3 ¶
func (*Promoter) Unwind ¶
func (p *Promoter) Unwind(logPrefix string, s *sync_stages.StageState, u *sync_stages.UnwindState, storage bool, codes bool) error
func (*Promoter) UnwindOnHistoryV3 ¶
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, br *snapshotsync.BlockRetire, 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, snapshots *snapshotsync.RoSnapshots, blockRetire *snapshotsync.BlockRetire, snapshotDownloader proto_downloader.DownloaderClient, blockReader services.FullBlockReader, dbEventNotifier snapshotsync.DBEventNotifier, engine consensus.Engine, historyV3 bool, agg *state.AggregatorV3, ) SnapshotsCfg
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, snapshots *snapshotsync.RoSnapshots, borConfig *erigonchain.BorConfig, ) TxLookupCfg
type WithSnapshots ¶
type WithSnapshots interface {
Snapshots() *snapshotsync.RoSnapshots
}
Source Files ¶
- chain_reader.go
- default_stages.go
- exec3.go
- stage_blockhashes.go
- stage_bodies.go
- stage_call_traces.go
- stage_cumulative_index.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
- testutil.go
- types.go