engine_forkchoiceUpdatedV3
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}$
withdrawals
array[Withdrawal object V1]index
stringMatch pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$
validatorIndex
stringMatch pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$
address
stringMatch pattern:
^0x[0-9a-fA-F]{40}$
amount
stringMatch pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$
parentBeaconBlockRoot
stringMatch pattern:
^0x[0-9a-f]{64}$
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 |
-32602 | Invalid params |
-38005 | Unsupported fork |
Example
Request
await window.ethereum.request({
"method": "engine_forkchoiceUpdatedV3",
"params": [
{
"headBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858",
"safeBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858",
"finalizedBlockHash": "0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a"
},
{
"timestamp": "0x64e7785b",
"prevRandao": "0xc130d5e63c61c935f6089e61140ca9136172677cf6aa5800dcc1cf0a02152a14",
"suggestedFeeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"withdrawals": [
{
"index": "0xf0",
"validatorIndex": "0xf0",
"address": "0x00000000000000000000000000000000000010f0",
"amount": "0x1"
},
{
"index": "0xf1",
"validatorIndex": "0xf1",
"address": "0x00000000000000000000000000000000000010f1",
"amount": "0x1"
}
],
"parentBeaconBlockRoot": "0x11f780a954bcba8889998e4e61deaae6388dd2391e9c810bd9c94962cc1eadc1"
}
]
});
Result
{
"payloadStatus": {
"status": "VALID",
"latestValidHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858",
"validationError": null
},
"payloadId": "0x0000000021f32cc1"
}