Skip to main content
This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.

engine Methods

The engine namespace provides 20 methods for consensus layer integration via the Engine API.
The Engine API is used for communication between execution layer (EL) and consensus layer (CL) clients in post-merge Ethereum. Most application developers won’t interact with these methods directly.

Overview

Access engine methods directly on the provider:

Engine API Context

The Engine API implements the communication protocol between:
  • Consensus Layer (CL) - Beacon chain, validators, attestations
  • Execution Layer (EL) - Transaction execution, state, EVM
Key Concepts:
  • Payload - Block execution data (transactions, state root, receipts root)
  • Forkchoice - Head, safe, and finalized block hashes
  • Payload ID - Identifier for a pending payload being built

Payload Methods

engine_newPayloadV1

Verify and execute a payload (pre-Shapella).

engine_newPayloadV2

Verify and execute a payload (Shapella/Shanghai).

engine_newPayloadV3

Verify and execute a payload (Cancun - includes blobs).
Parameters:
  • payload: ExecutionPayload - Block execution data
  • expectedBlobVersionedHashes: Hash[] - Blob KZG commitments (Cancun)
  • parentBeaconBlockRoot: Hash - Parent beacon block root (Cancun)
Payload Status:
  • VALID - Payload executed successfully
  • INVALID - Payload execution failed
  • SYNCING - Node is syncing, cannot validate yet
  • ACCEPTED - Optimistically accepted (pre-finality)
Example:

Forkchoice Methods

engine_forkchoiceUpdatedV1

Update forkchoice state and optionally start building a new payload (pre-Shapella).

engine_forkchoiceUpdatedV2

Update forkchoice state (Shapella/Shanghai).

engine_forkchoiceUpdatedV3

Update forkchoice state (Cancun).
Parameters:
  • forkchoiceState: ForkchoiceState - Head, safe, and finalized hashes
  • payloadAttributes?: PayloadAttributes - Optional payload building parameters
Forkchoice State:
Example:

Payload Building Methods

engine_getPayloadV1

Retrieve a built payload by ID (pre-Shapella).

engine_getPayloadV2

Retrieve a built payload by ID (Shapella/Shanghai).

engine_getPayloadV3

Retrieve a built payload by ID (Cancun - includes blobs).
Parameters:
  • payloadId: Hex - Payload identifier from forkchoiceUpdated
Example:

Blob Methods

engine_getBlobsV1

Retrieve blob sidecars for a list of blob versioned hashes.
Parameters:
  • blobVersionedHashes: Hash[] - KZG commitment hashes
Example:

Exchange Capabilities

engine_exchangeCapabilities

Exchange supported Engine API capabilities between CL and EL.
Example:

Transition Methods

engine_exchangeTransitionConfigurationV1

Exchange transition configuration (for merge preparation).
Note: This method was used during the merge transition and is rarely needed in post-merge operations.

Block Validation Methods

engine_getPayloadBodiesByHashV1

Get block bodies (transactions only) by block hashes.

engine_getPayloadBodiesByRangeV1

Get block bodies for a range of block numbers.
Example:

Usage Patterns

Block Production Flow

Version Compatibility

Always use the latest version compatible with your target fork.

Error Handling

Engine API methods return detailed error information:

Type Reference

All parameter and return types are defined in the JSON-RPC types module.

Next Steps

Resources