Skip to main content

engine_forkchoiceUpdatedV2

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}$
withdrawals
array[Withdrawal object V1]
required
index
string
required
Match pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$
validatorIndex
string
required
Match pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$
address
string
required
Match pattern:
^0x[0-9a-fA-F]{40}$
amount
string
required
Match pattern:
^0x(0|[1-9a-f][0-9a-f]{0,15})$

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_forkchoiceUpdatedV2",
"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"
}
]
}
]
});

Result

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

Params

Forkchoice state

Payload attributes

Withdrawals*

Request

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