Documentation
¶
Overview ¶
Package geth provides go-ethereum adapters for the execution interfaces. This package contains all go-ethereum dependencies, allowing the core execution package to remain free of CGO-dependent imports.
Index ¶
- func AdaptReceipts(receipts []*types.Receipt) []execution.Receipt
- type BlockAdapter
- type RPCNode
- func (n *RPCNode) BlockByNumber(ctx context.Context, number *big.Int) (execution.Block, error)
- func (n *RPCNode) BlockNumber(ctx context.Context) (*uint64, error)
- func (n *RPCNode) BlockReceipts(ctx context.Context, number *big.Int) ([]execution.Receipt, error)
- func (n *RPCNode) BlocksByNumbers(ctx context.Context, numbers []*big.Int) ([]execution.Block, error)
- func (n *RPCNode) ChainID() int64
- func (n *RPCNode) ClientType() string
- func (n *RPCNode) DebugTraceTransaction(ctx context.Context, hash string, blockNumber *big.Int, ...) (*execution.TraceTransaction, error)
- func (n *RPCNode) IsSynced() bool
- func (n *RPCNode) Metadata() *services.MetadataService
- func (n *RPCNode) Name() string
- func (n *RPCNode) OnReady(_ context.Context, callback func(ctx context.Context) error)
- func (n *RPCNode) Start(ctx context.Context) error
- func (n *RPCNode) Stop(ctx context.Context) error
- func (n *RPCNode) TransactionReceipt(ctx context.Context, hash string) (execution.Receipt, error)
- type ReceiptAdapter
- type TransactionAdapter
- func (t *TransactionAdapter) BlobGas() uint64
- func (t *TransactionAdapter) BlobGasFeeCap() *big.Int
- func (t *TransactionAdapter) BlobHashes() []execution.Hash
- func (t *TransactionAdapter) ChainId() *big.Int
- func (t *TransactionAdapter) Data() []byte
- func (t *TransactionAdapter) From() execution.Address
- func (t *TransactionAdapter) Gas() uint64
- func (t *TransactionAdapter) GasFeeCap() *big.Int
- func (t *TransactionAdapter) GasPrice() *big.Int
- func (t *TransactionAdapter) GasTipCap() *big.Int
- func (t *TransactionAdapter) Hash() execution.Hash
- func (t *TransactionAdapter) Nonce() uint64
- func (t *TransactionAdapter) Size() uint64
- func (t *TransactionAdapter) To() *execution.Address
- func (t *TransactionAdapter) Type() uint8
- func (t *TransactionAdapter) Value() *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockAdapter ¶
type BlockAdapter struct {
// contains filtered or unexported fields
}
BlockAdapter wraps a go-ethereum Block to implement execution.Block.
func NewBlockAdapter ¶
func NewBlockAdapter(block *types.Block) *BlockAdapter
NewBlockAdapter creates a new BlockAdapter from a go-ethereum Block. It extracts sender addresses for all transactions using the appropriate signer.
func (*BlockAdapter) BaseFee ¶
func (b *BlockAdapter) BaseFee() *big.Int
BaseFee returns the base fee per gas (EIP-1559), or nil for pre-London blocks.
func (*BlockAdapter) Hash ¶
func (b *BlockAdapter) Hash() execution.Hash
Hash returns the block hash.
func (*BlockAdapter) Number ¶
func (b *BlockAdapter) Number() *big.Int
Number returns the block number.
func (*BlockAdapter) ParentHash ¶
func (b *BlockAdapter) ParentHash() execution.Hash
ParentHash returns the parent block hash.
func (*BlockAdapter) Transactions ¶
func (b *BlockAdapter) Transactions() []execution.Transaction
Transactions returns all transactions in the block.
type RPCNode ¶
type RPCNode struct {
// contains filtered or unexported fields
}
RPCNode implements execution.Node using JSON-RPC connections.
func NewRPCNode ¶
func NewRPCNode(log logrus.FieldLogger, conf *execution.Config) *RPCNode
NewRPCNode creates a new RPC-based execution node.
func (*RPCNode) BlockByNumber ¶
BlockByNumber returns the block at the given number.
func (*RPCNode) BlockNumber ¶
BlockNumber returns the current block number.
func (*RPCNode) BlockReceipts ¶
BlockReceipts returns all receipts for the block at the given number.
func (*RPCNode) BlocksByNumbers ¶
func (n *RPCNode) BlocksByNumbers(ctx context.Context, numbers []*big.Int) ([]execution.Block, error)
BlocksByNumbers returns blocks at the given numbers using batch RPC. Returns blocks up to the first not-found (contiguous only).
func (*RPCNode) ClientType ¶
ClientType returns the client type from the metadata service.
func (*RPCNode) DebugTraceTransaction ¶
func (n *RPCNode) DebugTraceTransaction( ctx context.Context, hash string, blockNumber *big.Int, opts execution.TraceOptions, ) (*execution.TraceTransaction, error)
DebugTraceTransaction returns the execution trace for the transaction.
func (*RPCNode) Metadata ¶
func (n *RPCNode) Metadata() *services.MetadataService
Metadata returns the metadata service for this node.
type ReceiptAdapter ¶
type ReceiptAdapter struct {
// contains filtered or unexported fields
}
ReceiptAdapter wraps a go-ethereum Receipt to implement execution.Receipt.
func NewReceiptAdapter ¶
func NewReceiptAdapter(receipt *types.Receipt) *ReceiptAdapter
NewReceiptAdapter creates a new ReceiptAdapter from a go-ethereum Receipt.
func (*ReceiptAdapter) GasUsed ¶
func (r *ReceiptAdapter) GasUsed() uint64
GasUsed returns the gas used by the transaction.
func (*ReceiptAdapter) Status ¶
func (r *ReceiptAdapter) Status() uint64
Status returns the transaction status (1=success, 0=failure).
func (*ReceiptAdapter) TxHash ¶
func (r *ReceiptAdapter) TxHash() execution.Hash
TxHash returns the transaction hash.
type TransactionAdapter ¶
type TransactionAdapter struct {
// contains filtered or unexported fields
}
TransactionAdapter wraps a go-ethereum Transaction to implement execution.Transaction.
func NewTransactionAdapter ¶
func NewTransactionAdapter(tx *types.Transaction) *TransactionAdapter
NewTransactionAdapter creates a new TransactionAdapter from a go-ethereum Transaction. It computes the sender address using the appropriate signer.
func (*TransactionAdapter) BlobGas ¶
func (t *TransactionAdapter) BlobGas() uint64
BlobGas returns the blob gas used (for blob transactions).
func (*TransactionAdapter) BlobGasFeeCap ¶
func (t *TransactionAdapter) BlobGasFeeCap() *big.Int
BlobGasFeeCap returns the max blob fee per gas (for blob transactions).
func (*TransactionAdapter) BlobHashes ¶
func (t *TransactionAdapter) BlobHashes() []execution.Hash
BlobHashes returns the versioned hashes (for blob transactions).
func (*TransactionAdapter) ChainId ¶
func (t *TransactionAdapter) ChainId() *big.Int
ChainId returns the chain ID, or nil for legacy transactions.
func (*TransactionAdapter) Data ¶
func (t *TransactionAdapter) Data() []byte
Data returns the input data (calldata).
func (*TransactionAdapter) From ¶
func (t *TransactionAdapter) From() execution.Address
From returns the sender address.
func (*TransactionAdapter) Gas ¶
func (t *TransactionAdapter) Gas() uint64
Gas returns the gas limit.
func (*TransactionAdapter) GasFeeCap ¶
func (t *TransactionAdapter) GasFeeCap() *big.Int
GasFeeCap returns the max fee per gas (EIP-1559).
func (*TransactionAdapter) GasPrice ¶
func (t *TransactionAdapter) GasPrice() *big.Int
GasPrice returns the gas price (for legacy transactions).
func (*TransactionAdapter) GasTipCap ¶
func (t *TransactionAdapter) GasTipCap() *big.Int
GasTipCap returns the max priority fee per gas (EIP-1559).
func (*TransactionAdapter) Hash ¶
func (t *TransactionAdapter) Hash() execution.Hash
Hash returns the transaction hash.
func (*TransactionAdapter) Nonce ¶
func (t *TransactionAdapter) Nonce() uint64
Nonce returns the sender account nonce.
func (*TransactionAdapter) Size ¶
func (t *TransactionAdapter) Size() uint64
Size returns the encoded transaction size in bytes.
func (*TransactionAdapter) To ¶
func (t *TransactionAdapter) To() *execution.Address
To returns the recipient address, or nil for contract creation.
func (*TransactionAdapter) Type ¶
func (t *TransactionAdapter) Type() uint8
Type returns the transaction type.
func (*TransactionAdapter) Value ¶
func (t *TransactionAdapter) Value() *big.Int
Value returns the value transferred in wei.