Documentation
¶
Index ¶
- Variables
- func ConnectP2P(t *testing.T, node1 *ethclient.Client, node2 *ethclient.Client)
- func FindBlock(client *ethclient.Client, from, to int, timeout time.Duration, ...) (*types.Block, error)
- func InitL1(blockTime uint64, finalizedDistance uint64, genesis *core.Genesis, ...) (*GethInstance, *FakePoS, error)
- func WaitForBlock(number *big.Int, client *ethclient.Client, opts ...WaitForBlockOption) (*types.Block, error)
- func WaitForBlockToBeFinalized(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error)
- func WaitForBlockToBeSafe(number *big.Int, client *ethclient.Client, timeout time.Duration) (*types.Block, error)
- func WaitForL1OriginOnL2(rollupCfg *rollup.Config, l1BlockNum uint64, client *ethclient.Client, ...) (*types.Block, error)
- func WaitForTransaction(hash common.Hash, client *ethclient.Client, timeout time.Duration) (*types.Receipt, error)
- func WaitUntilTransactionNotFound(client *ethclient.Client, hash common.Hash, timeout time.Duration) error
- func WithP2P() func(ethCfg *ethconfig.Config, nodeCfg *node.Config) error
- type Backend
- type Beacon
- type EngineAPI
- type FakePoS
- type GethInstance
- type GethOption
- type WaitForBlockOption
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
func ConnectP2P ¶
ConnectP2P creates a p2p peer connection between node1 and node2.
func FindBlock ¶ added in v1.7.2
func FindBlock(client *ethclient.Client, from, to int, timeout time.Duration, pred func(*types.Block) (bool, error), ) (*types.Block, error)
FindBlock finds the first block for which the predicate [pred] matches and returns it. It starts at [from] and iterates until [to], inclusively, using the provided [client]. It supports both search directions, forwards and backwards.
func WaitForBlock ¶
func WaitForBlock(number *big.Int, client *ethclient.Client, opts ...WaitForBlockOption) (*types.Block, error)
WaitForBlock waits for the chain to advance to the provided block number. It can be configured with two different timeout: an absolute timeout, and a no change timeout. The absolute timeout caps the maximum amount of time this method will run. The no change timeout will return an error if the block number does not change within that time window. This is useful to bail out early in the event of a stuck chain, but allow things to continue if the chain is still advancing.
This function will also retry fetch errors up to three times before returning an error in order to protect against transient network problems. This function uses polling rather than websockets.
func WaitForBlockToBeFinalized ¶ added in v1.4.2
func WaitForBlockToBeSafe ¶ added in v1.4.2
func WaitForL1OriginOnL2 ¶
func WaitForTransaction ¶
func WaitUntilTransactionNotFound ¶ added in v1.16.3
func WaitUntilTransactionNotFound(client *ethclient.Client, hash common.Hash, timeout time.Duration) error
WaitUntilTransactionNotFound polls TransactionByHash until the client returns ethereum.NotFound, indicating the EL has finished indexing and the transaction is definitively absent.
Types ¶
type Beacon ¶ added in v1.4.2
type Beacon interface {
StoreBlobsBundle(slot uint64, bundle *engine.BlobsBundle) error
}
type EngineAPI ¶ added in v1.14.0
type EngineAPI interface {
ForkchoiceUpdatedV3(engine.ForkchoiceStateV1, *engine.PayloadAttributes) (engine.ForkChoiceResponse, error)
ForkchoiceUpdatedV2(engine.ForkchoiceStateV1, *engine.PayloadAttributes) (engine.ForkChoiceResponse, error)
GetPayloadV5(engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error)
GetPayloadV4(engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error)
GetPayloadV3(engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error)
GetPayloadV2(engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error)
NewPayloadV4(engine.ExecutableData, []common.Hash, *common.Hash, []hexutil.Bytes) (engine.PayloadStatusV1, error)
NewPayloadV3(engine.ExecutableData, []common.Hash, *common.Hash) (engine.PayloadStatusV1, error)
NewPayloadV2(engine.ExecutableData) (engine.PayloadStatusV1, error)
}
type FakePoS ¶ added in v1.13.4
type FakePoS struct {
// contains filtered or unexported fields
}
fakePoS is a testing-only utility to attach to Geth, to build a fake proof-of-stake L1 chain with fixed block time and basic lagging safe/finalized blocks.
func NewFakePoS ¶ added in v1.14.0
func (*FakePoS) FakeBeaconBlockRoot ¶ added in v1.13.4
type GethInstance ¶ added in v1.9.1
func InitL2 ¶
func InitL2(name string, genesis *core.Genesis, jwtPath string, opts ...GethOption) (*GethInstance, error)
InitL2 inits a L2 geth node.
func (*GethInstance) AuthRPC ¶ added in v1.9.1
func (gi *GethInstance) AuthRPC() endpoint.RPC
func (*GethInstance) Close ¶ added in v1.9.1
func (gi *GethInstance) Close() error
func (*GethInstance) UserRPC ¶ added in v1.9.1
func (gi *GethInstance) UserRPC() endpoint.RPC
type GethOption ¶
func WithAuth ¶ added in v1.14.0
func WithAuth(jwtPath string) GethOption
type WaitForBlockOption ¶ added in v1.9.5
type WaitForBlockOption func(*waitForBlockOptions)
func WithAbsoluteTimeout ¶ added in v1.9.5
func WithAbsoluteTimeout(timeout time.Duration) WaitForBlockOption
func WithNoChangeTimeout ¶ added in v1.9.5
func WithNoChangeTimeout(timeout time.Duration) WaitForBlockOption