Skip to main content

engine_forkchoiceUpdatedV1

Updates the forkchoice state

Params

(2)

1. Forkchoice state (required)

headBlockHash
string
required
Match pattern:
^0x[0-9a-f]{64}$
safeBlockHash
string
required
Match pattern:
^0x[0-9a-f]{64}$
finalizedBlockHash
string
required
Match pattern:
^0x[0-9a-f]{64}$

2. Payload attributes

timestamp
string
required
Match pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$
prevRandao
string
required
Match pattern:
^0x[0-9a-f]{64}$
suggestedFeeRecipient
string
required
Match pattern:
^0x[0-9a-fA-F]{40}$

Result

(Response object)
payloadStatus
Payload status
required
status
string
required

Set of possible values is restricted to VALID, INVALID, SYNCING

Allowed values:
VALIDINVALIDSYNCING
latestValidHash
string
Match pattern:
^0x[0-9a-f]{64}$
validationError
string
payloadId
string
Match pattern:
^0x[0-9a-f]{16}$

Errors

CodeMessage
-38002Invalid forkchoice state
-38003Invalid payload attributes

Example

Request

await window.ethereum.request({
"method": "engine_forkchoiceUpdatedV1",
"params": [
{
"headBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858",
"safeBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858",
"finalizedBlockHash": "0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a"
},
{
"timestamp": "0x5",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"suggestedFeeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
}
]
});

Result

{
"payloadStatus": {
"status": "VALID",
"latestValidHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858",
"validationError": null
},
"payloadId": "0x0000000021f32cc1"
}

Params

Forkchoice state

Payload attributes


Request

await window.ethereum.request({
"method": "engine_forkchoiceUpdatedV1",
"params": [
null,
null
]
});