stages

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStateRootMismatch = fmt.Errorf("state root mismatch")

Functions

func DumpDb

func DumpDb(eridb *db2.EriDb)

[zkevm] - print state

func PruneBatchesStage

func PruneBatchesStage(s *sync_stages.PruneState, tx kv.RwTx, cfg BatchesCfg, ctx context.Context) (err error)

func PruneL1SyncerStage

func PruneL1SyncerStage(s *sync_stages.PruneState, tx kv.RwTx, cfg L1SyncerCfg, ctx context.Context) (err error)

func RpcGetHighestTxNo

func RpcGetHighestTxNo(rpcEndpoint string) (uint64, error)

func RpcStateRootByTxNo

func RpcStateRootByTxNo(rpcUrl string, txNo *big.Int) (*libcommon.Hash, error)

func ShouldIncrementInterHashes

func ShouldIncrementInterHashes(tx kv.RwTx) (bool, uint64, error)

func ShouldShortCircuitExecution

func ShouldShortCircuitExecution(tx kv.RwTx) (bool, uint64, error)

func SpawnStageBatches

func SpawnStageBatches(
	s *sync_stages.StageState,
	u sync_stages.Unwinder,
	ctx context.Context,
	tx kv.RwTx,
	cfg BatchesCfg,
	firstCycle bool,
	quiet bool,
) error

func SpawnStageL1Syncer

func SpawnStageL1Syncer(
	s *sync_stages.StageState,
	u sync_stages.Unwinder,
	ctx context.Context,
	tx kv.RwTx,
	cfg L1SyncerCfg,
	firstCycle bool,
	quiet bool,
) error

func SpawnZkIntermediateHashesStage

func SpawnZkIntermediateHashesStage(s *sync_stages.StageState, u sync_stages.Unwinder, tx kv.RwTx, cfg ZkInterHashesCfg, ctx context.Context, quiet bool) (libcommon.Hash, error)

func TrimHexString

func TrimHexString(s string) string

func UnwindBatchesStage

func UnwindBatchesStage(u *sync_stages.UnwindState, tx kv.RwTx, cfg BatchesCfg, ctx context.Context) (err error)

func UnwindL1SyncerStage

func UnwindL1SyncerStage(u *sync_stages.UnwindState, tx kv.RwTx, cfg L1SyncerCfg, ctx context.Context) (err error)

func UnwindZkIntermediateHashesStage

func UnwindZkIntermediateHashesStage(u *sync_stages.UnwindState, s *sync_stages.StageState, tx kv.RwTx, cfg ZkInterHashesCfg, ctx context.Context) (err error)

Types

type BatchesCfg

type BatchesCfg struct {
	// contains filtered or unexported fields
}

func StageBatchesCfg

func StageBatchesCfg(db kv.RwDB, dsClient *dsclient.StreamClient) BatchesCfg

type ErigonDb

type ErigonDb interface {
	WriteHeader(batchNo *big.Int, stateRoot, txHash, parentHash common.Hash, coinbase common.Address, ts uint64) (*ethTypes.Header, error)
	WriteBody(batchNumber *big.Int, headerHash common.Hash, txs []ethTypes.Transaction) error
}

type HermezDb

type HermezDb interface {
	WriteForkId(batchNumber uint64, forkId uint64) error
	WriteBlockBatch(l2BlockNumber uint64, batchNumber uint64) error
	WriteEffectiveGasPricePercentage(txHash common.Hash, effectiveGasPricePercentage uint8) error
	WriteStateRoot(l2BlockNumber uint64, rpcRoot common.Hash) error

	DeleteForkIds(fromBatchNum, toBatchNum uint64) error
	DeleteBlockBatches(fromBatchNum, toBatchNum uint64) error

	WriteBlockGlobalExitRoot(l2BlockNo uint64, ger common.Hash) error

	WriteBatchGBatchGlobalExitRoot(batchNumber uint64, ger types.GerUpdate) error
}

type IL1Syncer

type IL1Syncer interface {

	// atomic
	IsSyncStarted() bool
	IsDownloading() bool
	GetLastCheckedL1Block() uint64

	// Channels
	GetVerificationsChan() chan types.L1BatchInfo
	GetSequencesChan() chan types.L1BatchInfo
	GetProgressMessageChan() chan string

	Run(lastCheckedBlock uint64)
}

type L1SyncerCfg

type L1SyncerCfg struct {
	// contains filtered or unexported fields
}

func StageL1SyncerCfg

func StageL1SyncerCfg(db kv.RwDB, syncer IL1Syncer, zkCfg *ethconfig.Zk) L1SyncerCfg

type ZkInterHashesCfg

type ZkInterHashesCfg struct {
	// contains filtered or unexported fields
}

func StageZkInterHashesCfg

func StageZkInterHashesCfg(db kv.RwDB, checkRoot, saveNewHashesToDB, badBlockHalt bool, tmpDir string, blockReader services.FullBlockReader, hd *headerdownload.HeaderDownload, historyV3 bool, agg *state.AggregatorV3, zk *ethconfig.Zk) ZkInterHashesCfg

Jump to

Keyboard shortcuts

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