tasks

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDepositOnlyBlock

func BuildDepositOnlyBlock(
	logger log.Logger,
	cfg *rollup.Config,
	l2Cfg *params.ChainConfig,
	optimisticBlock *types.Block,
	l1Head common.Hash,
	agreedL2OutputRoot eth.Bytes32,
	l1Oracle l1.Oracle,
	l2Oracle l2.Oracle,
) (common.Hash, eth.Bytes32, error)

BuildDepositOnlyBlock builds a deposits-only block replacement for the specified optimistic block and returns the block hash and output root for the new block. The specified l2OutputRoot must be the output root of the optimistic block's parent.

Types

type DerivationOptions

type DerivationOptions struct {
	// StoreBlockData controls whether block data, including intermediate trie nodes from transactions and receipts
	// of the derived block should be stored in the l2.KeyValueStore.
	StoreBlockData bool
}

type DerivationResult

type DerivationResult struct {
	Head       eth.L2BlockRef
	BlockHash  common.Hash
	OutputRoot eth.Bytes32
}

func RunDerivation

func RunDerivation(
	logger log.Logger,
	cfg *rollup.Config,
	l2Cfg *params.ChainConfig,
	l1Head common.Hash,
	l2OutputRoot common.Hash,
	l2ClaimBlockNum uint64,
	l1Oracle l1.Oracle,
	l2Oracle l2.Oracle,
	db l2.KeyValueStore,
	options DerivationOptions,
) (DerivationResult, error)

RunDerivation executes the L2 state transition, given a minimal interface to retrieve data. Returns the L2BlockRef of the safe head reached and the output root at l2ClaimBlockNum or the final safe head when l1Head is reached if l2ClaimBlockNum is not reached. Derivation may stop prior to l1Head if the l2ClaimBlockNum has already been reached though this is not guaranteed.

type L2Source

type L2Source interface {
	L2OutputRoot(uint64) (common.Hash, eth.Bytes32, error)
}

Jump to

Keyboard shortcuts

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