From f8ee0def2b8de635006a171e96a2346e85f864a4 Mon Sep 17 00:00:00 2001 From: henridf Date: Sat, 21 Jan 2023 01:47:38 +0100 Subject: [PATCH] Add stubs for EIP4844 engine API calls (#4536) --- beacon_chain/eth1/eth1_monitor.nim | 22 ++++++++++++++++++++++ vendor/nim-web3 | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/beacon_chain/eth1/eth1_monitor.nim b/beacon_chain/eth1/eth1_monitor.nim index 3de2da9ea..f61d68a79 100644 --- a/beacon_chain/eth1/eth1_monitor.nim +++ b/beacon_chain/eth1/eth1_monitor.nim @@ -531,6 +531,28 @@ proc getPayloadV2*( return (await p.dataProvider.web3.provider.engine_getPayloadV2( FixedBytes[8] payloadId)).executionPayload +proc getPayloadV3*( + p: Eth1Monitor, payloadId: bellatrix.PayloadID): + Future[engine_api.ExecutionPayloadV3] {.async.} = + # Eth1 monitor can recycle connections without (external) warning; at least, + # don't crash. + if p.isNil or p.dataProvider.isNil: + return default(engine_api.ExecutionPayloadV3) + + return (await p.dataProvider.web3.provider.engine_getPayloadV3( + FixedBytes[8] payloadId)).executionPayload + +proc getBlobsBundleV1*( + p: Eth1Monitor, payloadId: bellatrix.PayloadID): + Future[engine_api.BlobsBundleV1] {.async.} = + # Eth1 monitor can recycle connections without (external) warning; at least, + # don't crash. + if p.isNil or p.dataProvider.isNil: + return default(engine_api.BlobsBundleV1) + + return (await p.dataProvider.web3.provider.engine_getBlobsBundleV1( + FixedBytes[8] payloadId)) + proc newPayload*(p: Eth1Monitor, payload: engine_api.ExecutionPayloadV1): Future[PayloadStatusV1] = # Eth1 monitor can recycle connections without (external) warning; at least, diff --git a/vendor/nim-web3 b/vendor/nim-web3 index b5188b067..98fba0fb0 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit b5188b0679aa36ae54ea083bcd68349ef1b344e7 +Subproject commit 98fba0fb0471abffdbe69fb8e66bb59152a7075c