Documentation
¶
Index ¶
- type APIRouter
- type Backend
- type ELReader
- func (g *ELReader) ChainId(ctx context.Context) (hexutil.Big, error)
- func (g *ELReader) GetBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (g *ELReader) GetBlockByHashJSON(ctx context.Context, hash common.Hash, fullTx bool) (json.RawMessage, error)
- func (g *ELReader) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
- func (g *ELReader) GetBlockByNumberJSON(ctx context.Context, number rpc.BlockNumber, fullTx bool) (json.RawMessage, error)
- func (g *ELReader) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.Receipt, error)
- type HeaderNumberOnly
- type ReadOnlyELBackend
- type SyncTester
- func (s *SyncTester) ChainId(ctx context.Context) (hexutil.Big, error)
- func (s *SyncTester) DeleteSession(ctx context.Context) error
- func (s *SyncTester) ForkchoiceUpdatedV1(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
- func (s *SyncTester) ForkchoiceUpdatedV2(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
- func (s *SyncTester) ForkchoiceUpdatedV3(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
- func (s *SyncTester) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (json.RawMessage, error)
- func (s *SyncTester) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (json.RawMessage, error)
- func (s *SyncTester) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.Receipt, error)
- func (s *SyncTester) GetPayloadV1(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
- func (s *SyncTester) GetPayloadV2(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
- func (s *SyncTester) GetPayloadV3(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
- func (s *SyncTester) GetPayloadV4(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
- func (s *SyncTester) GetSession(ctx context.Context) (*eth.SyncTesterSession, error)
- func (s *SyncTester) ListSessions(ctx context.Context) ([]string, error)
- func (s *SyncTester) NewPayloadV1(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
- func (s *SyncTester) NewPayloadV2(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
- func (s *SyncTester) NewPayloadV3(ctx context.Context, payload *eth.ExecutionPayload, ...) (*eth.PayloadStatusV1, error)
- func (s *SyncTester) NewPayloadV4(ctx context.Context, payload *eth.ExecutionPayload, ...) (*eth.PayloadStatusV1, error)
- func (s *SyncTester) ResetSession(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func FromConfig ¶
func (*Backend) SyncTesters ¶
func (b *Backend) SyncTesters() (out map[sttypes.SyncTesterID]eth.ChainID)
type ELReader ¶
type ELReader struct {
// contains filtered or unexported fields
}
func NewELReader ¶
func (*ELReader) GetBlockByHash ¶
func (*ELReader) GetBlockByHashJSON ¶
func (*ELReader) GetBlockByNumber ¶
func (*ELReader) GetBlockByNumberJSON ¶
func (g *ELReader) GetBlockByNumberJSON(ctx context.Context, number rpc.BlockNumber, fullTx bool) (json.RawMessage, error)
func (*ELReader) GetBlockReceipts ¶
type HeaderNumberOnly ¶
HeaderNumberOnly is a lightweight header type that only contains the block number field. It is useful in contexts where the full Ethereum block header is not needed, and only the block number is required.
type ReadOnlyELBackend ¶
type ReadOnlyELBackend interface {
GetBlockByNumberJSON(ctx context.Context, number rpc.BlockNumber, fullTx bool) (json.RawMessage, error)
GetBlockByHashJSON(ctx context.Context, hash common.Hash, fullTx bool) (json.RawMessage, error)
GetBlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
GetBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.Receipt, error)
ChainId(ctx context.Context) (hexutil.Big, error)
}
ReadOnlyELBackend defines the minimal, read-only execution layer interface used by the sync tester and its mock backends. The interface exposes two flavors of block accessors:
- JSON-returning methods (GetBlockByNumberJSON, GetBlockByHashJSON) which return the raw RPC payload exactly as delivered by the EL. These are useful for relaying the response from read-only exec layer directly
- Typed methods (GetBlockByNumber, GetBlockByHash) which decode the RPC response into geth *types.Block for structured inspection in code.
- Additional helpers include GetBlockReceipts and ChainId
Implementation wraps ethclient.Client to forward RPC calls. For testing, a mock implementation can be provided to return deterministic values without requiring a live execution layer node.
type SyncTester ¶
type SyncTester struct {
// contains filtered or unexported fields
}
func NewSyncTester ¶
func NewSyncTester(logger log.Logger, m metrics.Metricer, stID sttypes.SyncTesterID, chainID eth.ChainID, elReader ReadOnlyELBackend) *SyncTester
func SyncTesterFromConfig ¶
func SyncTesterFromConfig(logger log.Logger, m metrics.Metricer, stID sttypes.SyncTesterID, stCfg *config.SyncTesterEntry) (*SyncTester, error)
func (*SyncTester) DeleteSession ¶
func (s *SyncTester) DeleteSession(ctx context.Context) error
func (*SyncTester) ForkchoiceUpdatedV1 ¶
func (s *SyncTester) ForkchoiceUpdatedV1(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
ForkchoiceUpdatedV1 is called for processing V1 attributes
func (*SyncTester) ForkchoiceUpdatedV2 ¶
func (s *SyncTester) ForkchoiceUpdatedV2(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
ForkchoiceUpdatedV2 is called for processing V2 attributes
func (*SyncTester) ForkchoiceUpdatedV3 ¶
func (s *SyncTester) ForkchoiceUpdatedV3(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
ForkchoiceUpdatedV3 must be only called with Ecotone attributes
func (*SyncTester) GetBlockByHash ¶
func (s *SyncTester) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (json.RawMessage, error)
func (*SyncTester) GetBlockByNumber ¶
func (s *SyncTester) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (json.RawMessage, error)
func (*SyncTester) GetBlockReceipts ¶
func (s *SyncTester) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.Receipt, error)
func (*SyncTester) GetPayloadV1 ¶
func (s *SyncTester) GetPayloadV1(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
GetPayloadV1 only supports V1 payloads.
func (*SyncTester) GetPayloadV2 ¶
func (s *SyncTester) GetPayloadV2(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
GetPayloadV2 supports V1, V2 payloads.
func (*SyncTester) GetPayloadV3 ¶
func (s *SyncTester) GetPayloadV3(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
GetPayloadV3 must be only called when Ecotone activated.
func (*SyncTester) GetPayloadV4 ¶
func (s *SyncTester) GetPayloadV4(ctx context.Context, payloadID eth.PayloadID) (*eth.ExecutionPayloadEnvelope, error)
GetPayloadV4 must be only called when Isthmus activated.
func (*SyncTester) GetSession ¶
func (s *SyncTester) GetSession(ctx context.Context) (*eth.SyncTesterSession, error)
func (*SyncTester) ListSessions ¶
func (s *SyncTester) ListSessions(ctx context.Context) ([]string, error)
func (*SyncTester) NewPayloadV1 ¶
func (s *SyncTester) NewPayloadV1(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
NewPayloadV1 must be only called with Bedrock Payload
func (*SyncTester) NewPayloadV2 ¶
func (s *SyncTester) NewPayloadV2(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
NewPayloadV2 must be only called with Bedrock, Canyon, Delta Payload
func (*SyncTester) NewPayloadV3 ¶
func (s *SyncTester) NewPayloadV3(ctx context.Context, payload *eth.ExecutionPayload, versionedHashes []common.Hash, beaconRoot *common.Hash) (*eth.PayloadStatusV1, error)
NewPayloadV3 must be only called with Ecotone Payload
func (*SyncTester) NewPayloadV4 ¶
func (s *SyncTester) NewPayloadV4(ctx context.Context, payload *eth.ExecutionPayload, versionedHashes []common.Hash, beaconRoot *common.Hash, executionRequests []hexutil.Bytes) (*eth.PayloadStatusV1, error)
NewPayloadV4 must be only called with Isthmus payload
func (*SyncTester) ResetSession ¶ added in v1.13.7
func (s *SyncTester) ResetSession(ctx context.Context) error