fix `produceBlockV2` call for Capella (#4443)
Avoid issue when calling `/eth/v2/validator/blocks/{slot}` for a Capella slot via VC, same logic as in `validator_duties`.
This commit is contained in:
parent
adcc57e7ca
commit
12b428e3d7
|
@ -16,6 +16,7 @@ import ".."/[beacon_chain_db, beacon_node],
|
|||
"."/[rest_utils, state_ttl_cache]
|
||||
|
||||
from ".."/spec/datatypes/bellatrix import ExecutionPayload
|
||||
from ".."/spec/datatypes/capella import ExecutionPayload
|
||||
|
||||
export rest_utils
|
||||
|
||||
|
@ -374,6 +375,10 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
return RestApiResponse.jsonError(Http400, InvalidRandaoRevealValue)
|
||||
|
||||
let res =
|
||||
if qslot.epoch >= node.dag.cfg.CAPELLA_FORK_EPOCH:
|
||||
await makeBeaconBlockForHeadAndSlot[capella.ExecutionPayload](
|
||||
node, qrandao, proposer.get(), qgraffiti, qhead, qslot)
|
||||
else:
|
||||
await makeBeaconBlockForHeadAndSlot[bellatrix.ExecutionPayload](
|
||||
node, qrandao, proposer.get(), qgraffiti, qhead, qslot)
|
||||
if res.isErr():
|
||||
|
|
Loading…
Reference in New Issue