Documentation
¶
Index ¶
- Variables
- func CheckProverBalance(ctx context.Context, rpc *Client, prover common.Address, ...) (bool, error)
- func DialClientWithBackoff(ctx context.Context, url string, retryInterval time.Duration, maxRetrys uint64) (*ethclient.Client, error)
- func GetPendingTxByNonce(ctx context.Context, cli *EthClient, address common.Address, nonce uint64) (*types.Transaction, error)
- func GetProtocolStateVariables(taikoL1Client *bindings.TaikoL1Client, opts *bind.CallOpts) (..., error)
- func IncreaseGasTipCap(ctx context.Context, cli *Client, opts *bind.TransactOpts, ...) (*bind.TransactOpts, error)
- func IsMaxPriorityFeePerGasNotFoundError(err error) bool
- func MakeSidecar(data []byte) (*types.BlobTxSidecar, error)
- func SetHead(ctx context.Context, client *EthClient, headNum *big.Int) error
- func StringToBytes32(str string) [32]byte
- func SubscribeBlockProposed(taikoL1 *bindings.TaikoL1Client, ch chan *bindings.TaikoL1ClientBlockProposed) event.Subscription
- func SubscribeBlockVerified(taikoL1 *bindings.TaikoL1Client, ch chan *bindings.TaikoL1ClientBlockVerified) event.Subscription
- func SubscribeChainHead(client *EthClient, ch chan *types.Header) event.Subscription
- func SubscribeEvent(eventName string, ...) event.Subscription
- func SubscribeTransitionContested(taikoL1 *bindings.TaikoL1Client, ...) event.Subscription
- func SubscribeTransitionProved(taikoL1 *bindings.TaikoL1Client, ...) event.Subscription
- type AccountPoolContent
- type AccountPoolContentFrom
- type BeaconClient
- type BlobData
- type BlobDataSeq
- type BlobDataSource
- type BlockProofStatus
- type Client
- func (c *Client) CheckL1Reorg(ctx context.Context, blockID *big.Int) (*ReorgCheckResult, error)
- func (c *Client) GetGenesisL1Header(ctx context.Context) (*types.Header, error)
- func (c *Client) GetL2BlockInfo(ctx context.Context, blockID *big.Int) (bindings.TaikoDataBlock, error)
- func (c *Client) GetPoolContent(ctx context.Context, beneficiary common.Address, blockMaxGasLimit uint32, ...) ([]*miner.PreBuiltTxList, error)
- func (c *Client) GetProtocolStateVariables(opts *bind.CallOpts) (..., error)
- func (c *Client) GetTaikoDataSlotBByNumber(ctx context.Context, number uint64) (*bindings.TaikoDataSlotB, error)
- func (c *Client) GetTiers(ctx context.Context) ([]*TierProviderTierWithID, error)
- func (c *Client) GetTransition(ctx context.Context, blockID *big.Int, transactionID uint32) (bindings.TaikoDataTransitionState, error)
- func (c *Client) L2AccountNonce(ctx context.Context, account common.Address, height *big.Int) (uint64, error)
- func (c *Client) L2ExecutionEngineSyncProgress(ctx context.Context) (*L2SyncProgress, error)
- func (c *Client) L2ParentByBlockID(ctx context.Context, blockID *big.Int) (*types.Header, error)
- func (c *Client) LatestL2KnownL1Header(ctx context.Context) (*types.Header, error)
- func (c *Client) WaitL2Header(ctx context.Context, blockID *big.Int) (*types.Header, error)
- func (c *Client) WaitTillL2ExecutionEngineSynced(ctx context.Context) error
- type ClientConfig
- type ConfigSpec
- type EngineClient
- func (c *EngineClient) ExchangeTransitionConfiguration(ctx context.Context, cfg *engine.TransitionConfigurationV1) (*engine.TransitionConfigurationV1, error)
- func (c *EngineClient) ForkchoiceUpdate(ctx context.Context, fc *engine.ForkchoiceStateV1, ...) (*engine.ForkChoiceResponse, error)
- func (c *EngineClient) GetPayload(ctx context.Context, payloadID *engine.PayloadID) (*engine.ExecutableData, error)
- func (c *EngineClient) NewPayload(ctx context.Context, payload *engine.ExecutableData) (*engine.PayloadStatusV1, error)
- func (c *EngineClient) TxPoolContent(ctx context.Context, beneficiary common.Address, baseFee *big.Int, ...) ([]*miner.PreBuiltTxList, error)
- type EthClient
- func (c *EthClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (c *EthClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (c *EthClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (c *EthClient) BlockNumber(ctx context.Context) (uint64, error)
- func (c *EthClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (c *EthClient) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error)
- func (c *EthClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
- func (c *EthClient) CreateBlobTx(opts *bind.TransactOpts, contract common.Address, input []byte, ...) (*types.BlobTx, error)
- func (c *EthClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
- func (c *EthClient) FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, ...) (*ethereum.FeeHistory, error)
- func (c *EthClient) FillTransaction(ctx context.Context, args *TransactionArgs) (*types.Transaction, error)
- func (c *EthClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (c *EthClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (c *EthClient) NetworkID(ctx context.Context) (*big.Int, error)
- func (c *EthClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
- func (c *EthClient) PeerCount(ctx context.Context) (uint64, error)
- func (c *EthClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)
- func (c *EthClient) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
- func (c *EthClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (c *EthClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (c *EthClient) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)
- func (c *EthClient) PendingTransactionCount(ctx context.Context) (uint, error)
- func (c *EthClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (c *EthClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, ...) ([]byte, error)
- func (c *EthClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (c *EthClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
- func (c *EthClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
- func (c *EthClient) TransactBlobTx(opts *bind.TransactOpts, contract common.Address, input []byte, ...) (*types.Transaction, error)
- func (c *EthClient) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
- func (c *EthClient) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)
- func (c *EthClient) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)
- func (c *EthClient) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)
- type GenesisResponse
- type L2SyncProgress
- type ReorgCheckResult
- type SignTransactionResult
- type TierProviderTierWithID
- type TransactionArgs
Constants ¶
This section is empty.
Variables ¶
var ( ZeroAddress common.Address BlobBytes = params.BlobTxBytesPerFieldElement * params.BlobTxFieldElementsPerBlob BlockMaxTxListBytes uint64 = (params.BlobTxBytesPerFieldElement - 1) * params.BlobTxFieldElementsPerBlob )
var (
ErrBlobInvalid = errors.New("invalid blob encoding")
)
var ( // FallbackGasTipCap is the default fallback gasTipCap used when we are // unable to query an L1 backend for a suggested gasTipCap. FallbackGasTipCap = big.NewInt(1500000000) )
Functions ¶
func CheckProverBalance ¶ added in v0.16.0
func CheckProverBalance( ctx context.Context, rpc *Client, prover common.Address, address common.Address, bond *big.Int, ) (bool, error)
CheckProverBalance checks if the prover has the necessary allowance and balance for a prover to pay the liveness bond.
func DialClientWithBackoff ¶
func DialClientWithBackoff( ctx context.Context, url string, retryInterval time.Duration, maxRetrys uint64) (*ethclient.Client, error)
DialClientWithBackoff connects a ethereum RPC client at the given URL with a backoff strategy. Added a retry limit so it doesn't retry endlessly
func GetPendingTxByNonce ¶ added in v0.13.0
func GetPendingTxByNonce( ctx context.Context, cli *EthClient, address common.Address, nonce uint64, ) (*types.Transaction, error)
GetPendingTxByNonce tries to retrieve a pending transaction with a given nonce in a node's mempool.
func GetProtocolStateVariables ¶ added in v0.1.8
func GetProtocolStateVariables( taikoL1Client *bindings.TaikoL1Client, opts *bind.CallOpts, ) (*struct { A bindings.TaikoDataSlotA B bindings.TaikoDataSlotB }, error)
GetProtocolStateVariables gets the protocol states from TaikoL1 contract.
func IncreaseGasTipCap ¶ added in v0.16.0
func IncreaseGasTipCap( ctx context.Context, cli *Client, opts *bind.TransactOpts, address common.Address, txReplacementTipMultiplier *big.Int, maxGasTipCap *big.Int, ) (*bind.TransactOpts, error)
IncreaseGasTipCap tries to increase the given transaction's gasTipCap.
func IsMaxPriorityFeePerGasNotFoundError ¶
IsMaxPriorityFeePerGasNotFoundError returns true if the provided error signals that the backend does not support the eth_maxPriorityFeePerGas method. In this case, the caller should fallback to using the constant above.
func MakeSidecar ¶ added in v0.19.0
func MakeSidecar(data []byte) (*types.BlobTxSidecar, error)
MakeSidecar makes a sidecar which only includes one blob with the given data.
func SetHead ¶
SetHead makes a `debug_setHead` RPC call to set the chain's head, should only be used for testing purpose.
func StringToBytes32 ¶ added in v0.9.0
StringToBytes32 converts the given string to [32]byte.
func SubscribeBlockProposed ¶ added in v0.2.3
func SubscribeBlockProposed( taikoL1 *bindings.TaikoL1Client, ch chan *bindings.TaikoL1ClientBlockProposed, ) event.Subscription
SubscribeBlockProposed subscribes the protocol's BlockProposed events.
func SubscribeBlockVerified ¶ added in v0.2.3
func SubscribeBlockVerified( taikoL1 *bindings.TaikoL1Client, ch chan *bindings.TaikoL1ClientBlockVerified, ) event.Subscription
SubscribeBlockVerified subscribes the protocol's BlockVerified events.
func SubscribeChainHead ¶ added in v0.2.3
func SubscribeChainHead( client *EthClient, ch chan *types.Header, ) event.Subscription
SubscribeChainHead subscribes the new chain heads.
func SubscribeEvent ¶ added in v0.2.3
func SubscribeEvent( eventName string, handler func(ctx context.Context) (event.Subscription, error), ) event.Subscription
SubscribeEvent creates a event subscription, will retry if the established subscription failed.
func SubscribeTransitionContested ¶ added in v0.17.0
func SubscribeTransitionContested( taikoL1 *bindings.TaikoL1Client, ch chan *bindings.TaikoL1ClientTransitionContested, ) event.Subscription
SubscribeTransitionContested subscribes the protocol's TransitionContested events.
func SubscribeTransitionProved ¶ added in v0.17.0
func SubscribeTransitionProved( taikoL1 *bindings.TaikoL1Client, ch chan *bindings.TaikoL1ClientTransitionProved, ) event.Subscription
SubscribeTransitionProved subscribes the protocol's TransitionProved events.
Types ¶
type AccountPoolContent ¶ added in v0.13.0
type AccountPoolContent map[string]map[string]map[string]*types.Transaction
type AccountPoolContentFrom ¶ added in v0.20.0
type AccountPoolContentFrom map[string]map[string]*types.Transaction
func ContentFrom ¶ added in v0.13.0
func ContentFrom( ctx context.Context, rawRPC *EthClient, address common.Address, ) (AccountPoolContentFrom, error)
ContentFrom fetches a given account's transactions list from a node's transactions pool.
type BeaconClient ¶ added in v0.20.0
func NewBeaconClient ¶ added in v0.20.0
func NewBeaconClient(endpoint string, timeout time.Duration) (*BeaconClient, error)
NewBeaconClient returns a new beacon client.
type BlobDataSeq ¶ added in v0.21.0
type BlobDataSeq struct {
Data []*BlobData `json:"data"`
}
type BlobDataSource ¶ added in v0.21.0
type BlobDataSource struct {
// contains filtered or unexported fields
}
func NewBlobDataSource ¶ added in v0.21.0
func (*BlobDataSource) GetBlobs ¶ added in v0.21.0
func (ds *BlobDataSource) GetBlobs( ctx context.Context, meta *bindings.TaikoDataBlockMetadata, ) ([]*blob.Sidecar, error)
GetBlobs get blob sidecar by meta
type BlockProofStatus ¶ added in v0.18.0
type BlockProofStatus struct { IsSubmitted bool Invalid bool CurrentTransitionState *bindings.TaikoDataTransitionState ParentHeader *types.Header }
BlockProofStatus represents the proving status of the given L2 block.
func GetBlockProofStatus ¶ added in v0.18.0
func GetBlockProofStatus( ctx context.Context, cli *Client, id *big.Int, proverAddress common.Address, ) (*BlockProofStatus, error)
GetBlockProofStatus checks whether the L2 block still needs a new proof or a new contest. Here are the possible status: 1. No proof on chain at all. 2. A valid proof has been submitted. 3. An invalid proof has been submitted, and there is no valid contest. 4. An invalid proof has been submitted, and there is a valid contest.
type Client ¶
type Client struct { // Geth ethclient clients L1 *EthClient L2 *EthClient L2CheckPoint *EthClient // Geth Engine API clients L2Engine *EngineClient // Beacon clients L1Beacon *BeaconClient // Protocol contracts clients TaikoL1 *bindings.TaikoL1Client TaikoL2 *bindings.TaikoL2Client TaikoToken *bindings.TaikoToken GuardianProver *bindings.GuardianProver }
Client contains all L1/L2 RPC clients that a driver needs.
func NewClient ¶
func NewClient(ctx context.Context, cfg *ClientConfig) (*Client, error)
NewClient initializes all RPC clients used by Taiko client software.
func (*Client) CheckL1Reorg ¶ added in v0.9.0
CheckL1Reorg checks whether the L2 block's corresponding L1 block has been reorged or not. We will skip the reorg check if:
- When the L2 chain has just finished a P2P sync, so there is no L1Origin information recorded in its local database, and we assume the last verified L2 block is old enough, so its corresponding L1 block should have also been finalized.
Then we will check: 1. If the L2 block's corresponding L1 block which in L1Origin has been reorged 2. If the L1 information which in the given L2 block's anchor transaction has been reorged
And if a reorg is detected, we return a new L1 block cursor which need to reset to.
func (*Client) GetGenesisL1Header ¶
GetGenesisL1Header fetches the L1 header that including L2 genesis block.
func (*Client) GetL2BlockInfo ¶ added in v0.20.0
func (c *Client) GetL2BlockInfo(ctx context.Context, blockID *big.Int) (bindings.TaikoDataBlock, error)
GetL2BlockInfo fetches the L2 block information from the protocol.
func (*Client) GetPoolContent ¶ added in v0.5.0
func (c *Client) GetPoolContent( ctx context.Context, beneficiary common.Address, blockMaxGasLimit uint32, maxBytesPerTxList uint64, locals []common.Address, maxTransactionsLists uint64, ) ([]*miner.PreBuiltTxList, error)
GetPoolContent fetches the transactions list from L2 execution engine's transactions pool with given upper limit.
func (*Client) GetProtocolStateVariables ¶ added in v0.1.8
func (c *Client) GetProtocolStateVariables(opts *bind.CallOpts) (*struct { A bindings.TaikoDataSlotA B bindings.TaikoDataSlotB }, error)
GetProtocolStateVariables gets the protocol states from TaikoL1 contract.
func (*Client) GetTaikoDataSlotBByNumber ¶ added in v0.20.0
func (c *Client) GetTaikoDataSlotBByNumber(ctx context.Context, number uint64) (*bindings.TaikoDataSlotB, error)
GetTaikoDataSlotBByNumber fetches the state variables by block number.
func (*Client) GetTiers ¶ added in v0.17.0
func (c *Client) GetTiers(ctx context.Context) ([]*TierProviderTierWithID, error)
GetTiers fetches all protocol supported tiers.
func (*Client) GetTransition ¶ added in v0.21.0
func (c *Client) GetTransition( ctx context.Context, blockID *big.Int, transactionID uint32, ) (bindings.TaikoDataTransitionState, error)
GetTransition fetches the L2 block's corresponding transition state from the protocol.
func (*Client) L2AccountNonce ¶
func (c *Client) L2AccountNonce( ctx context.Context, account common.Address, height *big.Int, ) (uint64, error)
L2AccountNonce fetches the nonce of the given L2 account at a specified height.
func (*Client) L2ExecutionEngineSyncProgress ¶ added in v0.2.4
func (c *Client) L2ExecutionEngineSyncProgress(ctx context.Context) (*L2SyncProgress, error)
L2ExecutionEngineSyncProgress fetches the sync progress of the given L2 execution engine.
func (*Client) L2ParentByBlockID ¶ added in v0.19.0
L2ParentByBlockID fetches the block header from L2 execution engine with the largest block id that smaller than the given `blockId`.
func (*Client) LatestL2KnownL1Header ¶
LatestL2KnownL1Header fetches the L2 execution engine's latest known L1 header, if we can't find the L1Origin data, we will use the L1 genesis header instead.
func (*Client) WaitL2Header ¶ added in v0.22.0
type ClientConfig ¶
type ClientConfig struct { L1Endpoint string L2Endpoint string L1BeaconEndpoint string L2CheckPoint string TaikoL1Address common.Address TaikoL2Address common.Address TaikoTokenAddress common.Address GuardianProverAddress common.Address L2EngineEndpoint string JwtSecret string Timeout time.Duration }
ClientConfig contains all configs which will be used to initializing an RPC client. If not providing L2EngineEndpoint or JwtSecret, then the L2Engine client won't be initialized.
type ConfigSpec ¶ added in v0.20.0
type ConfigSpec struct {
SecondsPerSlot string `json:"SECONDS_PER_SLOT"`
}
type EngineClient ¶
EngineClient represents a RPC client connecting to an Ethereum Engine API endpoint. ref: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md
func DialEngineClientWithBackoff ¶
func DialEngineClientWithBackoff( ctx context.Context, url string, jwtSecret string, retryInterval time.Duration, maxRetry uint64, ) (*EngineClient, error)
DialEngineClientWithBackoff connects an ethereum engine RPC client at the given URL with a backoff strategy. Added a retry limit so it doesn't retry endlessly
func NewJWTEngineClient ¶ added in v0.19.0
func NewJWTEngineClient(url, jwtSecret string) (*EngineClient, error)
func (*EngineClient) ExchangeTransitionConfiguration ¶ added in v0.11.0
func (c *EngineClient) ExchangeTransitionConfiguration( ctx context.Context, cfg *engine.TransitionConfigurationV1, ) (*engine.TransitionConfigurationV1, error)
ExchangeTransitionConfiguration exchanges transition configs with the L2 execution engine.
func (*EngineClient) ForkchoiceUpdate ¶
func (c *EngineClient) ForkchoiceUpdate( ctx context.Context, fc *engine.ForkchoiceStateV1, attributes *engine.PayloadAttributes, ) (*engine.ForkChoiceResponse, error)
ForkchoiceUpdate updates the forkchoice on the execution client.
func (*EngineClient) GetPayload ¶
func (c *EngineClient) GetPayload( ctx context.Context, payloadID *engine.PayloadID, ) (*engine.ExecutableData, error)
GetPayload gets the execution payload associated with the payload ID.
func (*EngineClient) NewPayload ¶
func (c *EngineClient) NewPayload( ctx context.Context, payload *engine.ExecutableData, ) (*engine.PayloadStatusV1, error)
NewPayload executes a built block on the execution engine.
func (*EngineClient) TxPoolContent ¶ added in v0.21.0
func (c *EngineClient) TxPoolContent( ctx context.Context, beneficiary common.Address, baseFee *big.Int, blockMaxGasLimit uint64, maxBytesPerTxList uint64, locals []string, maxTransactionsLists uint64, ) ([]*miner.PreBuiltTxList, error)
TxPoolContent fetches the transaction pool content from the L2 execution engine.
type EthClient ¶ added in v0.14.0
EthClient is a wrapper for go-ethereum eth client with a timeout attached.
func NewEthClient ¶ added in v0.19.0
func (*EthClient) BalanceAt ¶ added in v0.14.0
func (c *EthClient) BalanceAt( ctx context.Context, account common.Address, blockNumber *big.Int, ) (*big.Int, error)
BalanceAt returns the wei balance of the given account. The block number can be nil, in which case the balance is taken from the latest known block.
func (*EthClient) BlockByHash ¶ added in v0.14.0
BlockByHash returns the given full block.
Note that loading full blocks requires two requests. Use HeaderByHash if you don't need all transactions or uncle headers.
func (*EthClient) BlockByNumber ¶ added in v0.14.0
BlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.
Note that loading full blocks requires two requests. Use HeaderByNumber if you don't need all transactions or uncle headers.
func (*EthClient) BlockNumber ¶ added in v0.14.0
BlockNumber returns the most recent block number
func (*EthClient) CallContract ¶ added in v0.14.0
func (c *EthClient) CallContract( ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int, ) ([]byte, error)
CallContract executes a message call transaction, which is directly executed in the VM of the node, but never mined into the blockchain.
blockNumber selects the block height at which the call runs. It can be nil, in which case the code is taken from the latest known block. Note that state from very old blocks might not be available.
func (*EthClient) CallContractAtHash ¶ added in v0.14.0
func (c *EthClient) CallContractAtHash( ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash, ) ([]byte, error)
CallContractAtHash is almost the same as CallContract except that it selects the block by block hash instead of block height.
func (*EthClient) CodeAt ¶ added in v0.14.0
func (c *EthClient) CodeAt( ctx context.Context, account common.Address, blockNumber *big.Int, ) ([]byte, error)
CodeAt returns the contract code of the given account. The block number can be nil, in which case the code is taken from the latest known block.
func (*EthClient) CreateBlobTx ¶ added in v0.20.0
func (c *EthClient) CreateBlobTx( opts *bind.TransactOpts, contract common.Address, input []byte, sidecar *types.BlobTxSidecar, ) (*types.BlobTx, error)
CreateBlobTx creates a blob transaction by given parameters.
func (*EthClient) EstimateGas ¶ added in v0.14.0
EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.
func (*EthClient) FeeHistory ¶ added in v0.14.0
func (c *EthClient) FeeHistory( ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64, ) (*ethereum.FeeHistory, error)
FeeHistory retrieves the fee market history.
func (*EthClient) FillTransaction ¶ added in v0.19.0
func (c *EthClient) FillTransaction(ctx context.Context, args *TransactionArgs) (*types.Transaction, error)
FillTransaction fill transaction.
func (*EthClient) HeaderByHash ¶ added in v0.14.0
HeaderByHash returns the block header with the given hash.
func (*EthClient) HeaderByNumber ¶ added in v0.14.0
HeaderByNumber returns a block header from the current canonical chain. If number is nil, the latest known header is returned.
func (*EthClient) NonceAt ¶ added in v0.14.0
func (c *EthClient) NonceAt( ctx context.Context, account common.Address, blockNumber *big.Int, ) (uint64, error)
NonceAt returns the account nonce of the given account. The block number can be nil, in which case the nonce is taken from the latest known block.
func (*EthClient) PeerCount ¶ added in v0.14.0
PeerCount returns the number of p2p peers as reported by the net_peerCount method.
func (*EthClient) PendingBalanceAt ¶ added in v0.14.0
PendingBalanceAt returns the wei balance of the given account in the pending state.
func (*EthClient) PendingCallContract ¶ added in v0.14.0
PendingCallContract executes a message call transaction using the EVM. The state seen by the contract call is the pending state.
func (*EthClient) PendingCodeAt ¶ added in v0.14.0
PendingCodeAt returns the contract code of the given account in the pending state.
func (*EthClient) PendingNonceAt ¶ added in v0.14.0
PendingNonceAt returns the account nonce of the given account in the pending state. This is the nonce that should be used for the next transaction.
func (*EthClient) PendingStorageAt ¶ added in v0.14.0
func (c *EthClient) PendingStorageAt( ctx context.Context, account common.Address, key common.Hash, ) ([]byte, error)
PendingStorageAt returns the value of key in the contract storage of the given account in the pending state.
func (*EthClient) PendingTransactionCount ¶ added in v0.14.0
PendingTransactionCount returns the total number of transactions in the pending state.
func (*EthClient) SendTransaction ¶ added in v0.14.0
SendTransaction injects a signed transaction into the pending pool for execution.
If the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.
func (*EthClient) StorageAt ¶ added in v0.14.0
func (c *EthClient) StorageAt( ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int, ) ([]byte, error)
StorageAt returns the value of key in the contract storage of the given account. The block number can be nil, in which case the value is taken from the latest known block.
func (*EthClient) SuggestGasPrice ¶ added in v0.14.0
SuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.
func (*EthClient) SuggestGasTipCap ¶ added in v0.14.0
SuggestGasTipCap retrieves the currently suggested gas tip cap after 1559 to allow a timely execution of a transaction.
func (*EthClient) SyncProgress ¶ added in v0.14.0
SyncProgress retrieves the current progress of the sync algorithm. If there's no sync currently running, it returns nil.
func (*EthClient) TransactBlobTx ¶ added in v0.19.0
func (c *EthClient) TransactBlobTx( opts *bind.TransactOpts, contract common.Address, input []byte, sidecar *types.BlobTxSidecar, ) (*types.Transaction, error)
TransactBlobTx creates, signs and then sends blob transactions.
func (*EthClient) TransactionByHash ¶ added in v0.14.0
func (c *EthClient) TransactionByHash( ctx context.Context, hash common.Hash, ) (tx *types.Transaction, isPending bool, err error)
TransactionByHash returns the transaction with the given hash.
func (*EthClient) TransactionCount ¶ added in v0.14.0
TransactionCount returns the total number of transactions in the given block.
func (*EthClient) TransactionInBlock ¶ added in v0.14.0
func (c *EthClient) TransactionInBlock( ctx context.Context, blockHash common.Hash, index uint, ) (*types.Transaction, error)
TransactionInBlock returns a single transaction at index in the given block.
func (*EthClient) TransactionSender ¶ added in v0.14.0
func (c *EthClient) TransactionSender( ctx context.Context, tx *types.Transaction, block common.Hash, index uint, ) (common.Address, error)
TransactionSender returns the sender address of the given transaction. The transaction must be known to the remote node and included in the blockchain at the given block and index. The sender is the one derived by the protocol at the time of inclusion.
There is a fast-path for transactions retrieved by TransactionByHash and TransactionInBlock. Getting their sender address can be done without an RPC interaction.
type GenesisResponse ¶ added in v0.20.0
type GenesisResponse struct { Data struct { GenesisTime string `json:"genesis_time"` } `json:"data"` }
type L2SyncProgress ¶ added in v0.2.4
type L2SyncProgress struct { *ethereum.SyncProgress CurrentBlockID *big.Int HighestBlockID *big.Int }
L2SyncProgress represents the sync progress of a L2 execution engine, `ethereum.SyncProgress` is used to check the sync progress of verified blocks, and block IDs are used to check the sync progress of pending blocks.
type ReorgCheckResult ¶ added in v0.20.0
type ReorgCheckResult struct { IsReorged bool L1CurrentToReset *types.Header LastHandledBlockIDToReset *big.Int }
ReorgCheckResult represents the information about whether the L1 block has been reorged and how to reset the L1 cursor.
type SignTransactionResult ¶ added in v0.19.0
type SignTransactionResult struct { Raw hexutil.Bytes `json:"raw"` Tx *types.Transaction `json:"tx"` }
SignTransactionResult represents a RLP encoded signed transaction.
type TierProviderTierWithID ¶ added in v0.17.0
type TierProviderTierWithID struct { ID uint16 bindings.ITierProviderTier }
TierProviderTierWithID wraps protocol ITierProviderTier struct with an ID.
type TransactionArgs ¶ added in v0.19.0
type TransactionArgs struct { From *common.Address `json:"from"` To *common.Address `json:"to"` Gas *hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` MaxFeePerGas *hexutil.Big `json:"maxFeePerGas"` MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas"` Value *hexutil.Big `json:"value"` Nonce *hexutil.Uint64 `json:"nonce"` // We accept "data" and "input" for backwards-compatibility reasons. // "input" is the newer name and should be preferred by clients. // Issue detail: https://github.com/ethereum/go-ethereum/issues/15628 Data *hexutil.Bytes `json:"data"` Input *hexutil.Bytes `json:"input"` // Introduced by AccessListTxType transaction. AccessList *types.AccessList `json:"accessList,omitempty"` ChainID *hexutil.Big `json:"chainId,omitempty"` // Introduced by EIP-4844. BlobFeeCap *hexutil.Big `json:"maxFeePerBlobGas"` BlobHashes []common.Hash `json:"blobVersionedHashes,omitempty"` }
TransactionArgs represents the arguments to construct a new transaction or a message call.