prefetcher

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSources                = errors.New("no sources specified")
	ErrNoL2ForRollup            = errors.New("no L2 RPC available for rollup")
	ErrNoRollupForL2            = errors.New("no rollup config available for L2 RPC")
	ErrDuplicateL2URLs          = errors.New("multiple L2 URLs provided for chain")
	ErrNoRollupForExperimental  = errors.New("no rollup config available for L2 experimental RPC")
	ErrDuplicateExperimentsURLs = errors.New("multiple experimental URLs provided for chain")
)
View Source
var (
	ErrAgreedPrestateUnavailable = errors.New("agreed prestate unavailable")
)

Functions

This section is empty.

Types

type BlockDataKey added in v1.11.0

type BlockDataKey [32]byte

func (BlockDataKey) Key added in v1.11.0

func (p BlockDataKey) Key() [32]byte

type L1BlobSource added in v1.5.1

type L1BlobSource interface {
	GetBlobSidecars(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.BlobSidecar, error)
	GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error)
}

type L1Source

type L1Source interface {
	InfoByHash(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, error)
	InfoAndTxsByHash(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Transactions, error)
	FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)
}

type Prefetcher

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

func NewPrefetcher

func NewPrefetcher(
	logger log.Logger,
	l1Fetcher L1Source,
	l1BlobFetcher L1BlobSource,
	defaultChainID eth.ChainID,
	l2Sources hosttypes.L2Sources,
	kvStore kvstore.KV,
	executor ProgramExecutor,
	l2Head common.Hash,
	agreedPrestate []byte,
) *Prefetcher

func (*Prefetcher) GetPreimage

func (p *Prefetcher) GetPreimage(ctx context.Context, key common.Hash) ([]byte, error)

func (*Prefetcher) Hint

func (p *Prefetcher) Hint(hint string) error

type ProgramExecutor added in v1.11.0

type ProgramExecutor interface {
	// RunProgram derives the block at the specified blockNumber
	RunProgram(ctx context.Context, prefetcher hostcommon.Prefetcher, blockNumber uint64, chainID eth.ChainID, db l2.KeyValueStore) error
}

type RetryingL1BlobSource added in v1.5.1

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

func NewRetryingL1BlobSource added in v1.5.1

func NewRetryingL1BlobSource(logger log.Logger, source L1BlobSource) *RetryingL1BlobSource

func (*RetryingL1BlobSource) GetBlobSidecars added in v1.5.1

func (s *RetryingL1BlobSource) GetBlobSidecars(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.BlobSidecar, error)

func (*RetryingL1BlobSource) GetBlobs added in v1.5.1

func (s *RetryingL1BlobSource) GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error)

type RetryingL1Source

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

func NewRetryingL1Source

func NewRetryingL1Source(logger log.Logger, source L1Source) *RetryingL1Source

func (*RetryingL1Source) FetchReceipts

func (s *RetryingL1Source) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)

func (*RetryingL1Source) InfoAndTxsByHash

func (s *RetryingL1Source) InfoAndTxsByHash(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Transactions, error)

func (*RetryingL1Source) InfoByHash

func (s *RetryingL1Source) InfoByHash(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, error)

type RetryingL2Source

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

func NewRetryingL2Source

func NewRetryingL2Source(logger log.Logger, source hosttypes.L2Source) *RetryingL2Source

func (*RetryingL2Source) CodeByHash

func (s *RetryingL2Source) CodeByHash(ctx context.Context, hash common.Hash) ([]byte, error)

func (*RetryingL2Source) ExperimentalEnabled added in v1.11.0

func (s *RetryingL2Source) ExperimentalEnabled() bool

func (*RetryingL2Source) FetchReceipts added in v1.11.0

func (s *RetryingL2Source) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)

func (*RetryingL2Source) GetProof added in v1.11.2

func (s *RetryingL2Source) GetProof(ctx context.Context, address common.Address, storage []common.Hash, blockTag string) (*eth.AccountResult, error)

func (*RetryingL2Source) InfoAndTxsByHash

func (s *RetryingL2Source) InfoAndTxsByHash(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Transactions, error)

func (*RetryingL2Source) NodeByHash

func (s *RetryingL2Source) NodeByHash(ctx context.Context, hash common.Hash) ([]byte, error)

func (*RetryingL2Source) OutputByNumber added in v1.11.0

func (s *RetryingL2Source) OutputByNumber(ctx context.Context, blockNum uint64) (eth.Output, error)

func (*RetryingL2Source) OutputByRoot added in v1.1.4

func (s *RetryingL2Source) OutputByRoot(ctx context.Context, blockRoot common.Hash) (eth.Output, error)

func (*RetryingL2Source) PayloadExecutionWitness added in v1.11.2

func (s *RetryingL2Source) PayloadExecutionWitness(ctx context.Context, parentHash common.Hash, payloadAttributes eth.PayloadAttributes) (*eth.ExecutionWitness, error)

func (*RetryingL2Source) RollupConfig added in v1.11.0

func (s *RetryingL2Source) RollupConfig() *rollup.Config

type RetryingL2Sources added in v1.11.0

type RetryingL2Sources struct {
	Sources map[eth.ChainID]*RetryingL2Source
}

func NewRetryingL2Sources added in v1.11.0

func NewRetryingL2Sources(ctx context.Context, logger log.Logger, configs []*rollup.Config, l2Clients []client.RPC, l2ExperimentalClients []client.RPC) (*RetryingL2Sources, error)

func NewRetryingL2SourcesFromURLs added in v1.11.0

func NewRetryingL2SourcesFromURLs(ctx context.Context, logger log.Logger, configs []*rollup.Config, l2URLs []string, l2ExperimentalURLs []string) (*RetryingL2Sources, error)

func (*RetryingL2Sources) ForChainID added in v1.11.0

func (s *RetryingL2Sources) ForChainID(chainID eth.ChainID) (types.L2Source, error)

func (*RetryingL2Sources) ForChainIDWithoutRetries added in v1.11.0

func (s *RetryingL2Sources) ForChainIDWithoutRetries(chainID eth.ChainID) (types.L2Source, error)

Jump to

Keyboard shortcuts

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