Engine API changes introduced in Shanghai.
This structure maps onto the validator withdrawal object from the beacon chain spec. The fields are encoded as follows:
index:QUANTITY, 64 BitsvalidatorIndex:QUANTITY, 64 Bitsaddress:DATA, 20 Bytesamount:QUANTITY, 64 Bits
Note: the amount value is represented on the beacon chain as a little-endian value in units of Gwei, whereas the
amount in this structure MUST be converted to a big-endian value in units of Gwei.
This structure has the syntax of ExecutionPayloadV1 and appends a single field: withdrawals.
parentHash:DATA, 32 BytesfeeRecipient:DATA, 20 BytesstateRoot:DATA, 32 BytesreceiptsRoot:DATA, 32 ByteslogsBloom:DATA, 256 BytesprevRandao:DATA, 32 BytesblockNumber:QUANTITY, 64 BitsgasLimit:QUANTITY, 64 BitsgasUsed:QUANTITY, 64 Bitstimestamp:QUANTITY, 64 BitsextraData:DATA, 0 to 32 BytesbaseFeePerGas:QUANTITY, 256 BitsblockHash:DATA, 32 Bytestransactions:Array of DATA- Array of transaction objects, each object is a byte list (DATA) representingTransactionType || TransactionPayloadorLegacyTransactionas defined in EIP-2718withdrawals:Array of WithdrawalV1- Array of withdrawals, each object is anOBJECTcontaining the fields of aWithdrawalV1structure.
This structure contains a body of an execution payload. The fields are encoded as follows:
transactions:Array of DATA- Array of transaction objects, each object is a byte list (DATA) representingTransactionType || TransactionPayloadorLegacyTransactionas defined in EIP-2718withdrawals:Array of WithdrawalV1- Array of withdrawals, each object is anOBJECTcontaining the fields of aWithdrawalV1structure.
This structure has the syntax of PayloadAttributesV1 and appends a single field: withdrawals.
timestamp:QUANTITY, 64 Bits - value for thetimestampfield of the new payloadprevRandao:DATA, 32 Bytes - value for theprevRandaofield of the new payloadsuggestedFeeRecipient:DATA, 20 Bytes - suggested value for thefeeRecipientfield of the new payloadwithdrawals:Array of WithdrawalV1- Array of withdrawals, each object is anOBJECTcontaining the fields of aWithdrawalV1structure.
- method:
engine_newPayloadV2 - params:
ExecutionPayloadV1|ExecutionPayloadV2, where:ExecutionPayloadV1MUST be used if thetimestampvalue is lower than the Shanghai timestamp,ExecutionPayloadV2MUST be used if thetimestampvalue is greater or equal to the Shanghai timestamp,- Client software MUST return
-32602: Invalid paramserror if the wrong version of the structure is used in the method call.
- timeout: 8s
- result:
PayloadStatusV1, values of thestatusfield are restricted in the following way:INVALID_BLOCK_HASHstatus value is supplanted byINVALID.
- error: code and message set in case an exception happens while processing the payload.
This method follows the same specification as engine_newPayloadV1 with the exception of the following:
- Client software MAY NOT validate terminal PoW block conditions during payload validation (point (2) in the Payload validation routine).
- Client software MUST return
{status: INVALID, latestValidHash: null, validationError: errorMessage | null}if theblockHashvalidation has failed. - Consensus layer client MUST call this method instead of
engine_newPayloadV1iftimestampvalue of a payload is greater or equal to the Shanghai timestamp.
- method: "engine_forkchoiceUpdatedV2"
- params:
forkchoiceState:Object- instance ofForkchoiceStateV1payloadAttributes:Object|null- instance ofPayloadAttributesV1|PayloadAttributesV2ornull, where:PayloadAttributesV1MUST be used to build a payload with thetimestampvalue lower than the Shanghai timestamp,PayloadAttributesV2MUST be used to build a payload with thetimestampvalue greater or equal to the Shanghai timestamp,- Client software MUST return
-38003: Invalid payload attributeserror if the wrong version of the structure is used in the method call.
- timeout: 8s
Refer to the response for engine_forkchoiceUpdatedV1.
This method follows the same specification as engine_forkchoiceUpdatedV1 with the exception of the following:
- Client software MAY NOT validate terminal PoW block conditions in the following places:
- during payload validation (point (2) in the Payload validation routine specification),
- when updating the forkchoice state (point (3) in the
engine_forkchoiceUpdatedV1method specification).
- Consensus layer client MUST call this method instead of
engine_forkchoiceUpdatedV1under any of the following conditions:headBlockHashreferences a block whichtimestampis greater or equal to the Shanghai timestamp,payloadAttributesis notnullandpayloadAttributes.timestampis greater or equal to the Shanghai timestamp.
- method:
engine_getPayloadV2 - params:
payloadId:DATA, 8 Bytes - Identifier of the payload build process
- timeout: 1s
- result:
objectexecutionPayload:ExecutionPayloadV1|ExecutionPayloadV2where:ExecutionPayloadV1MUST be returned if the payloadtimestampis lower than the Shanghai timestampExecutionPayloadV2MUST be returned if the payloadtimestampis greater or equal to the Shanghai timestamp
blockValue:QUANTITY, 256 Bits - The expected value to be received by thefeeRecipientin wei
- error: code and message set in case an exception happens while getting the payload.
This method follows the same specification as engine_getPayloadV1 with the addition of the following:
- Client software SHOULD use the sum of the block's priority fees or any other algorithm to determine
blockValue.
- method:
engine_getPayloadBodiesByHashV1 - params:
Array of DATA, 32 Bytes - Array ofblock_hashfield values of theExecutionPayloadstructure
- timeout: 10s
- result:
Array of ExecutionPayloadBodyV1- Array ofExecutionPayloadBodyV1objects. - error: code and message set in case an exception happens while processing the method call.
-
Given array of block hashes client software MUST respond with array of
ExecutionPayloadBodyV1objects with the corresponding hashes respecting the order of block hashes in the input array. -
Client software MUST place responses in the order given in the request, using
nullfor any missing blocks. For instance, if the request is[A.block_hash, B.block_hash, C.block_hash]and client software has data of payloadsAandC, but doesn't have data ofB, the response MUST be[A.body, null, C.body]. -
Client software MUST support request sizes of at least 32 block hashes. The call MUST return
-38004: Too large requesterror if the number of requested payload bodies is too large. -
Client software MAY NOT respond to requests for finalized blocks by hash.
-
Client software MUST set
withdrawalsfield tonullfor bodies of pre-Shanghai blocks. -
This request maps to
BeaconBlocksByRootin the consensus layerp2pspecification. Callers must be careful to use the execution block hash, instead of the beacon block root. -
Callers must consider that syncing execution layer client may not serve any block bodies, including those that were supplied by
engine_newPayloadcalls.
- method:
engine_getPayloadBodiesByRangeV1 - params:
start:QUANTITY, 64 bits - Starting block numbercount:QUANTITY, 64 bits - Number of blocks to return
- timeout: 10s
- result:
Array of ExecutionPayloadBodyV1- Array ofExecutionPayloadBodyV1objects. - error: code and message set in case an exception happens while processing the method call.
-
Given a
startand acount, the client software MUST respond with array ofExecutionPayloadBodyV1objects with the corresponding execution block number respecting the order of blocks in the canonical chain, as selected by the latestengine_forkchoiceUpdatedcall. -
Client software MUST support
countvalues of at least 32 blocks. The call MUST return-38004: Too large requesterror if the requested range is too large. -
Client software MUST return
-32602: Invalid paramserror if eitherstartorcountvalue is less than1. -
Client software MUST place
nullin the response array for unavailable blocks which numbers are lower than a number of the latest known block. Client software MUST NOT return trailingnullvalues if the request extends past the current latest known block. Execution Layer client software is expected to download and carry the full block history until EIP-4444 or a similar proposal takes into effect. Consider the following response examples:[B1.body, B2.body, ..., Bn.body]-- entire requested range is filled with block bodies,[null, null, B3.body, ..., Bn.body]-- first two blocks are unavailable (either pruned or not yet downloaded),[null, null, ..., null]-- requested range is behind the latest known block and all blocks are unavailable,[B1.body, B2.body, B3.body, B4.body]--B4is the latest known block and trailingnullvalues are trimmed,[]-- entire requested range is beyond the latest known block,[null, null, B3.body, B4.body]-- first two blocks are unavailable,B4is the latest known block.
-
Client software MUST set
withdrawalsfield tonullfor bodies of pre-Shanghai blocks. -
This request maps to
BeaconBlocksByRangein the consensus layerp2pspecification. -
Callers must be careful to not confuse
startwith a slot number, instead mapping the slot to a block number. Callers must also be careful to request non-finalized blocks by hash in order to avoid race conditions around the current view of the canonical chain. -
Callers must be careful to verify the hash of the received blocks when requesting non-finalized parts of the chain since the response is prone to being re-orged.
-
Callers must consider that syncing execution layer client may not serve any block bodies, including those that were supplied by
engine_newPayloadcalls.