engine_forkchoiceUpdatedV1
Updates the forkchoice state
Params
(2)1. Forkchoice state (required)
headBlockHash
stringMatch pattern:
^0x[0-9a-f]{64}$
safeBlockHash
stringMatch pattern:
^0x[0-9a-f]{64}$
finalizedBlockHash
stringMatch pattern:
^0x[0-9a-f]{64}$
2. Payload attributes
timestamp
stringMatch pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$
prevRandao
stringMatch pattern:
^0x[0-9a-f]{64}$
suggestedFeeRecipient
stringMatch pattern:
^0x[0-9a-fA-F]{40}$
Result
(Response object)payloadStatus
Payload statusstatus
stringSet of possible values is restricted to VALID, INVALID, SYNCING
Allowed values:
VALIDINVALIDSYNCING
latestValidHash
stringMatch pattern:
^0x[0-9a-f]{64}$
validationError
stringpayloadId
stringMatch pattern:
^0x[0-9a-f]{16}$
Errors
Code | Message |
---|---|
-38002 | Invalid forkchoice state |
-38003 | Invalid 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"
}