Skip to content

engine_forkchoiceUpdatedV2 ​

served

Updates the forkchoice state

For consensus clients only

The consensus client calls this method on the authenticated Engine API port, with the JWT secret. Applications and wallets do not call it.

INFO

This page is generated from the specification. The text comes from the OpenRPC description of the method.

Parameters ​

NameTypeRequiredDescription
Forkchoice stateobjectyesForkchoice state object V1
Payload attributesobjectnoPayload attributes object V2

Returns ​

object: Response object

Live example ​

No live example: this method needs the JWT secret on the authenticated port.

Errors ​

CodeMessage
-38002Invalid forkchoice state
-38003Invalid payload attributes
-38005Unsupported fork
-38006Too deep reorg

Specification ​

The official specification: engine_forkchoiceUpdatedV2 in ethereum/execution-apis.

Schema (OpenRPC) ​

Parameter Forkchoice state: object
json
{
  "properties": {
    "finalizedBlockHash": {
      "pattern": "^0x[0-9a-f]{64}$",
      "title": "Finalized block hash",
      "type": "string"
    },
    "headBlockHash": {
      "pattern": "^0x[0-9a-f]{64}$",
      "title": "Head block hash",
      "type": "string"
    },
    "safeBlockHash": {
      "pattern": "^0x[0-9a-f]{64}$",
      "title": "Safe block hash",
      "type": "string"
    }
  },
  "required": [
    "headBlockHash",
    "safeBlockHash",
    "finalizedBlockHash"
  ],
  "title": "Forkchoice state object V1",
  "type": "object"
}
Parameter Payload attributes: object
json
{
  "properties": {
    "prevRandao": {
      "pattern": "^0x[0-9a-f]{64}$",
      "title": "Previous randao value",
      "type": "string"
    },
    "suggestedFeeRecipient": {
      "pattern": "^0x[0-9a-fA-F]{40}$",
      "title": "Suggested fee recipient",
      "type": "string"
    },
    "timestamp": {
      "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$",
      "title": "Timestamp",
      "type": "string"
    },
    "withdrawals": {
      "items": {
        "properties": {
          "address": {
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "title": "Withdrawal address",
            "type": "string"
          },
          "amount": {
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$",
            "title": "Withdrawal amount",
            "type": "string"
          },
          "index": {
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$",
            "title": "Withdrawal index",
            "type": "string"
          },
          "validatorIndex": {
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$",
            "title": "Validator index",
            "type": "string"
          }
        },
        "required": [
          "index",
          "validatorIndex",
          "address",
          "amount"
        ],
        "title": "Withdrawal object V1",
        "type": "object"
      },
      "title": "Withdrawals",
      "type": "array"
    }
  },
  "required": [
    "timestamp",
    "prevRandao",
    "suggestedFeeRecipient",
    "withdrawals"
  ],
  "title": "Payload attributes object V2",
  "type": "object"
}
Result: object
json
{
  "properties": {
    "payloadId": {
      "pattern": "^0x[0-9a-f]{16}$",
      "title": "Payload id",
      "type": "string"
    },
    "payloadStatus": {
      "properties": {
        "latestValidHash": {
          "pattern": "^0x[0-9a-f]{64}$",
          "title": "The hash of the most recent valid block",
          "type": "string"
        },
        "status": {
          "description": "Set of possible values is restricted to VALID, INVALID, SYNCING",
          "enum": [
            "VALID",
            "INVALID",
            "SYNCING"
          ],
          "title": "Payload validation status",
          "type": "string"
        },
        "validationError": {
          "title": "Validation error message",
          "type": "string"
        }
      },
      "required": [
        "status"
      ],
      "title": "Payload status",
      "type": "object"
    }
  },
  "required": [
    "payloadStatus"
  ],
  "title": "Forkchoice updated response",
  "type": "object"
}