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
|
except ValueError as exc: raiseAssert exc.msg # Never fails
|
||||||
p.web3.provider.eth_getBlockByNumber(hexNumber, false)
|
p.web3.provider.eth_getBlockByNumber(hexNumber, false)
|
||||||
|
|
||||||
proc getPayload*(p: Eth1Monitor,
|
proc getPayloadV1*(
|
||||||
payloadId: bellatrix.PayloadID): Future[engine_api.ExecutionPayloadV1] =
|
p: Eth1Monitor, payloadId: bellatrix.PayloadID):
|
||||||
|
Future[engine_api.ExecutionPayloadV1] =
|
||||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||||
# don't crash.
|
# don't crash.
|
||||||
if p.isNil or p.dataProvider.isNil:
|
if p.isNil or p.dataProvider.isNil:
|
||||||
|
@ -554,6 +555,18 @@ proc getPayload*(p: Eth1Monitor,
|
||||||
|
|
||||||
p.dataProvider.web3.provider.engine_getPayloadV1(FixedBytes[8] payloadId)
|
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):
|
proc newPayload*(p: Eth1Monitor, payload: engine_api.ExecutionPayloadV1):
|
||||||
Future[PayloadStatusV1] =
|
Future[PayloadStatusV1] =
|
||||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||||
|
|
|
@ -319,10 +319,15 @@ proc get_execution_payload[EP](
|
||||||
else:
|
else:
|
||||||
when EP is bellatrix.ExecutionPayload:
|
when EP is bellatrix.ExecutionPayload:
|
||||||
asConsensusExecutionPayload(
|
asConsensusExecutionPayload(
|
||||||
await execution_engine.getPayload(payload_id.get))
|
await execution_engine.getPayloadV1(payload_id.get))
|
||||||
else:
|
elif EP is capella.ExecutionPayload:
|
||||||
debugRaiseAssert $capellaImplementationMissing & ": implement getPayload V2"
|
asConsensusExecutionPayload(
|
||||||
|
await execution_engine.getPayloadV2(payload_id.get))
|
||||||
|
elif EP is eip4844.ExecutionPayload:
|
||||||
|
debugRaiseAssert $eip4844ImplementationMissing & ": get_execution_payload"
|
||||||
default(EP)
|
default(EP)
|
||||||
|
else:
|
||||||
|
static: doAssert "unknown execution payload type"
|
||||||
|
|
||||||
proc getFeeRecipient(node: BeaconNode,
|
proc getFeeRecipient(node: BeaconNode,
|
||||||
pubkey: ValidatorPubKey,
|
pubkey: ValidatorPubKey,
|
||||||
|
|
Loading…
Reference in New Issue