getPayloadV2 support for capella (#4457)
* getPayloadV2 support for capella * check execution payload type more rigorously
This commit is contained in:
parent
44aa1f5152
commit
ec01065555
|
@ -543,8 +543,9 @@ proc getBlockByNumber*(p: Web3DataProviderRef,
|
|||
except ValueError as exc: raiseAssert exc.msg # Never fails
|
||||
p.web3.provider.eth_getBlockByNumber(hexNumber, false)
|
||||
|
||||
proc getPayload*(p: Eth1Monitor,
|
||||
payloadId: bellatrix.PayloadID): Future[engine_api.ExecutionPayloadV1] =
|
||||
proc getPayloadV1*(
|
||||
p: Eth1Monitor, payloadId: bellatrix.PayloadID):
|
||||
Future[engine_api.ExecutionPayloadV1] =
|
||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||
# don't crash.
|
||||
if p.isNil or p.dataProvider.isNil:
|
||||
|
@ -554,6 +555,18 @@ proc getPayload*(p: Eth1Monitor,
|
|||
|
||||
p.dataProvider.web3.provider.engine_getPayloadV1(FixedBytes[8] payloadId)
|
||||
|
||||
proc getPayloadV2*(
|
||||
p: Eth1Monitor, payloadId: bellatrix.PayloadID):
|
||||
Future[engine_api.ExecutionPayloadV2] =
|
||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||
# don't crash.
|
||||
if p.isNil or p.dataProvider.isNil:
|
||||
let epr = newFuture[engine_api.ExecutionPayloadV2]("getPayload")
|
||||
epr.complete(default(engine_api.ExecutionPayloadV2))
|
||||
return epr
|
||||
|
||||
p.dataProvider.web3.provider.engine_getPayloadV2(FixedBytes[8] payloadId)
|
||||
|
||||
proc newPayload*(p: Eth1Monitor, payload: engine_api.ExecutionPayloadV1):
|
||||
Future[PayloadStatusV1] =
|
||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||
|
|
|
@ -319,10 +319,15 @@ proc get_execution_payload[EP](
|
|||
else:
|
||||
when EP is bellatrix.ExecutionPayload:
|
||||
asConsensusExecutionPayload(
|
||||
await execution_engine.getPayload(payload_id.get))
|
||||
else:
|
||||
debugRaiseAssert $capellaImplementationMissing & ": implement getPayload V2"
|
||||
await execution_engine.getPayloadV1(payload_id.get))
|
||||
elif EP is capella.ExecutionPayload:
|
||||
asConsensusExecutionPayload(
|
||||
await execution_engine.getPayloadV2(payload_id.get))
|
||||
elif EP is eip4844.ExecutionPayload:
|
||||
debugRaiseAssert $eip4844ImplementationMissing & ": get_execution_payload"
|
||||
default(EP)
|
||||
else:
|
||||
static: doAssert "unknown execution payload type"
|
||||
|
||||
proc getFeeRecipient(node: BeaconNode,
|
||||
pubkey: ValidatorPubKey,
|
||||
|
|
Loading…
Reference in New Issue