Documentation
¶
Index ¶
- Variables
- type Engine
- func (ee *Engine) GetLogs(ctx context.Context, blockHash primitives.ExecutionHash, ...) ([]coretypes.Log, error)
- func (ee *Engine) GetPayload(ctx context.Context, req *GetPayloadRequest) (types.ExecutionPayload, *engine.BlobsBundleV1, bool, error)
- func (ee *Engine) NotifyForkchoiceUpdate(ctx context.Context, req *ForkchoiceUpdateRequest) (*engine.PayloadID, *primitives.ExecutionHash, error)
- func (ee *Engine) Start(ctx context.Context)
- func (ee *Engine) Status() error
- func (ee *Engine) VerifyAndNotifyNewPayload(ctx context.Context, req *NewPayloadRequest) (bool, error)
- type ForkchoiceUpdateRequest
- type GetPayloadRequest
- type NewPayloadRequest
Constants ¶
This section is empty.
Variables ¶
var ( // ErrExecutionClientDisconnected represents an error when /// the execution client is disconnected. ErrExecutionClientDisconnected = errors.New( "execution client disconnected") // ErrAcceptedSyncingPayloadStatus represents an error when // the payload status is SYNCING or ACCEPTED. ErrAcceptedSyncingPayloadStatus = errors.New( "payload status is SYNCING or ACCEPTED") // ErrInvalidPayloadStatus represents an error when the // payload status is INVALID. ErrInvalidPayloadStatus = errors.New( "payload status is INVALID") // ErrBadBlockProduced represents an error when the beacon // chain has produced a bad block. ErrBadBlockProduced = errors.New( "beacon chain has produced a bad block, RIP walrus") )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is Beacon-Kit's implementation of the `ExecutionEngine` from the Ethereum 2.0 Specification.
func NewEngine ¶
func NewEngine( ec *client.EngineClient, logger log.Logger, ) *Engine
NewExecuitionEngine creates a new Engine.
func (*Engine) GetLogs ¶
func (ee *Engine) GetLogs( ctx context.Context, blockHash primitives.ExecutionHash, addrs []primitives.ExecutionAddress, ) ([]coretypes.Log, error)
TODO move.
func (*Engine) GetPayload ¶
func (ee *Engine) GetPayload( ctx context.Context, req *GetPayloadRequest, ) (types.ExecutionPayload, *engine.BlobsBundleV1, bool, error)
GetPayload returns the payload and blobs bundle for the given slot.
func (*Engine) NotifyForkchoiceUpdate ¶
func (ee *Engine) NotifyForkchoiceUpdate( ctx context.Context, req *ForkchoiceUpdateRequest, ) (*engine.PayloadID, *primitives.ExecutionHash, error)
NotifyForkchoiceUpdate notifies the execution client of a forkchoice update.
func (*Engine) VerifyAndNotifyNewPayload ¶
func (ee *Engine) VerifyAndNotifyNewPayload( ctx context.Context, req *NewPayloadRequest, ) (bool, error)
VerifyAndNotifyNewPayload verifies the new payload and notifies the execution client. It implictly handles: - IsValidBlockHash - IsValidVersionedHashes from the Ethereum 2.0 Specification from within the NewPayload call.
type ForkchoiceUpdateRequest ¶
type ForkchoiceUpdateRequest struct {
// State is the forkchoice state.
State *engine.ForkchoiceState
// PayloadAttributes is the payload attributer.
PayloadAttributes types.PayloadAttributer
// ForkVersion is the fork version that we
// are going to be submitting for.
ForkVersion uint32
}
ForkchoiceUpdateRequest.
func BuildForkchoiceUpdateRequest ¶
func BuildForkchoiceUpdateRequest( state *engine.ForkchoiceState, payloadAttributes types.PayloadAttributer, forkVersion uint32, ) *ForkchoiceUpdateRequest
BuildForkchoiceUpdateRequest builds a forkchoice update request.
type GetPayloadRequest ¶
type GetPayloadRequest struct {
// PayloadID is the payload ID.
PayloadID engine.PayloadID
// ForkVersion is the fork version that we are
// currently on.
ForkVersion uint32
}
GetPayloadRequest represents a request to get a payload.
func BuildGetPayloadRequest ¶
func BuildGetPayloadRequest( payloadID engine.PayloadID, forkVersion uint32, ) *GetPayloadRequest
BuildGetPayloadRequest builds a get payload request.
type NewPayloadRequest ¶
type NewPayloadRequest struct {
// ExecutionPayload is the payload to the execution client.
ExecutionPayload types.ExecutionPayload
// VersionedHashes is the versioned hashes of the execution payload.
VersionedHashes []primitives.ExecutionHash
// ParentBeaconBlockRoot is the root of the parent beacon block.
ParentBeaconBlockRoot *primitives.Root
}
NewPayloadRequest as per the Ethereum 2.0 specification: https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/beacon-chain.md#modified-newpayloadrequest
func BuildNewPayloadRequest ¶
func BuildNewPayloadRequest( executionPayload types.ExecutionPayload, versionedHashes []primitives.ExecutionHash, parentBeaconBlockRoot *primitives.Root, ) *NewPayloadRequest
BuildNewPayloadRequest builds a new payload request.