l1

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT, MIT Imports: 20 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")
View Source
var RootsOfUnity *[4096]fr.Element

Functions

This section is empty.

Types

type BlobFetcher

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

func NewBlobFetcher

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

func (*BlobFetcher) GetBlobsByHash

func (b *BlobFetcher) GetBlobsByHash(ctx context.Context, time uint64, hashes []common.Hash) ([]*eth.Blob, error)

GetBlobsByHash fetches blobs that were confirmed at the given timestamp with the given versioned hashes.

type BlobHint

type BlobHint []byte

func NewBlobHint

func NewBlobHint(blobHash common.Hash, timeStamp uint64) BlobHint

NewBlobHint constructs a 40 byte blob hint with timestamp.

func NewLegacyBlobHint

func NewLegacyBlobHint(blobHash common.Hash, index uint64, timeStamp uint64) BlobHint

NewLegacyBlobHint is deprecated, do not use. Constructs a 48 byte blob hint with timestamp and index.

func (BlobHint) Hint

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

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

func (*CachingOracle) HeaderByBlockHash

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

func (*CachingOracle) Precompile

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 common.Hash) *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

type PrecompileHint []byte

func (PrecompileHint) Hint

func (l PrecompileHint) Hint() string

type PrecompileHintV2

type PrecompileHintV2 []byte

func (PrecompileHintV2) Hint

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

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

func (*PreimageOracle) HeaderByBlockHash

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

func (*PreimageOracle) Precompile

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