l1

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HintL1BlockHeader  = "l1-block-header"
	HintL1Transactions = "l1-transactions"
	HintL1Receipts     = "l1-receipts"
	HintL1Blob         = "l1-blob"
	HintL1Precompile   = "l1-precompile"
	HintL1PrecompileV2 = "l1-precompile-v2"
)

Variables

View Source
var (
	ErrNotFound     = ethereum.NotFound
	ErrUnknownLabel = errors.New("unknown label")
)
View Source
var InvalidHashesLengthError = errors.New("invalid hashes length")

Functions

This section is empty.

Types

type BlobFetcher added in v1.5.1

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

func NewBlobFetcher added in v1.5.1

func NewBlobFetcher(logger log.Logger, oracle Oracle) *BlobFetcher

func (*BlobFetcher) GetBlobs added in v1.5.1

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

GetBlobs fetches blobs that were confirmed in the given L1 block with the given indexed blob hashes.

type BlobHint added in v1.5.1

type BlobHint []byte

func (BlobHint) Hint added in v1.5.1

func (l BlobHint) Hint() string

type BlockHeaderHint

type BlockHeaderHint common.Hash

func (BlockHeaderHint) Hint

func (l BlockHeaderHint) Hint() string

type CachingOracle

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

CachingOracle is an implementation of Oracle that delegates to another implementation, adding caching of all results

func NewCachingOracle

func NewCachingOracle(oracle Oracle) *CachingOracle

func (*CachingOracle) GetBlob added in v1.5.1

func (o *CachingOracle) GetBlob(ref eth.L1BlockRef, blobHash eth.IndexedBlobHash) *eth.Blob

func (*CachingOracle) HeaderByBlockHash

func (o *CachingOracle) HeaderByBlockHash(blockHash common.Hash) eth.BlockInfo

func (*CachingOracle) Precompile added in v1.7.2

func (o *CachingOracle) Precompile(address common.Address, input []byte, requiredGas uint64) ([]byte, bool)

func (*CachingOracle) ReceiptsByBlockHash

func (o *CachingOracle) ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Receipts)

func (*CachingOracle) TransactionsByBlockHash

func (o *CachingOracle) TransactionsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Transactions)

type Oracle

type Oracle interface {
	// HeaderByBlockHash retrieves the block header with the given hash.
	HeaderByBlockHash(blockHash common.Hash) eth.BlockInfo

	// TransactionsByBlockHash retrieves the transactions from the block with the given hash.
	TransactionsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Transactions)

	// ReceiptsByBlockHash retrieves the receipts from the block with the given hash.
	ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Receipts)

	// GetBlob retrieves the blob with the given hash.
	GetBlob(ref eth.L1BlockRef, blobHash eth.IndexedBlobHash) *eth.Blob

	// Precompile retrieves the result and success indicator of a precompile call for the given input.
	Precompile(precompileAddress common.Address, input []byte, requiredGas uint64) ([]byte, bool)
}

type OracleL1Client

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

func NewOracleL1Client

func NewOracleL1Client(logger log.Logger, oracle Oracle, l1Head common.Hash) *OracleL1Client

func (*OracleL1Client) FetchReceipts

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

func (*OracleL1Client) InfoAndTxsByHash

func (o *OracleL1Client) InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, types.Transactions, error)

func (*OracleL1Client) InfoByHash

func (o *OracleL1Client) InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error)

func (*OracleL1Client) L1BlockRefByHash

func (o *OracleL1Client) L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)

func (*OracleL1Client) L1BlockRefByLabel

func (o *OracleL1Client) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)

func (*OracleL1Client) L1BlockRefByNumber

func (o *OracleL1Client) L1BlockRefByNumber(ctx context.Context, number uint64) (eth.L1BlockRef, error)

type PrecompileHint added in v1.7.2

type PrecompileHint []byte

func (PrecompileHint) Hint added in v1.7.2

func (l PrecompileHint) Hint() string

type PrecompileHintV2 added in v1.9.1

type PrecompileHintV2 []byte

func (PrecompileHintV2) Hint added in v1.9.1

func (l PrecompileHintV2) Hint() string

type PreimageOracle

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

PreimageOracle implements Oracle using by interfacing with the pure preimage.Oracle to fetch pre-images to decode into the requested data.

func NewPreimageOracle

func NewPreimageOracle(raw preimage.Oracle, hint preimage.Hinter) *PreimageOracle

func (*PreimageOracle) GetBlob added in v1.5.1

func (p *PreimageOracle) GetBlob(ref eth.L1BlockRef, blobHash eth.IndexedBlobHash) *eth.Blob

func (*PreimageOracle) HeaderByBlockHash

func (p *PreimageOracle) HeaderByBlockHash(blockHash common.Hash) eth.BlockInfo

func (*PreimageOracle) Precompile added in v1.7.2

func (p *PreimageOracle) Precompile(address common.Address, input []byte, requiredGas uint64) ([]byte, bool)

func (*PreimageOracle) ReceiptsByBlockHash

func (p *PreimageOracle) ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Receipts)

func (*PreimageOracle) TransactionsByBlockHash

func (p *PreimageOracle) TransactionsByBlockHash(blockHash common.Hash) (eth.BlockInfo, types.Transactions)

type ReceiptsHint

type ReceiptsHint common.Hash

func (ReceiptsHint) Hint

func (l ReceiptsHint) Hint() string

type TransactionsHint

type TransactionsHint common.Hash

func (TransactionsHint) Hint

func (l TransactionsHint) Hint() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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