From 2924ed9604f2261253ba9aba96b9df721802cad1 Mon Sep 17 00:00:00 2001 From: tersec Date: Fri, 17 Jun 2022 06:32:52 +0000 Subject: [PATCH] remove some usage of calls not required by engine API (#3761) --- beacon_chain/eth1/eth1_monitor.nim | 11 +++++++---- beacon_chain/spec/datatypes/base.nim | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/beacon_chain/eth1/eth1_monitor.nim b/beacon_chain/eth1/eth1_monitor.nim index ea7dfc81a..db9614023 100644 --- a/beacon_chain/eth1/eth1_monitor.nim +++ b/beacon_chain/eth1/eth1_monitor.nim @@ -1056,7 +1056,13 @@ proc detectPrimaryProviderComingOnline(m: Eth1Monitor) {.async.} = continue var tempProvider = tempProviderRes.get - let testRequest = tempProvider.web3.provider.net_version() + + # Use one of the get/request-type methods from + # https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.9/src/engine/specification.md#underlying-protocol + # which does nit take parameters and returns a small structure, to ensure + # this works with engine API endpoints. Either eth_chainId or eth_syncing + # works for this purpose. + let testRequest = tempProvider.web3.provider.eth_syncing() yield testRequest or sleepAsync(web3Timeouts) @@ -1525,8 +1531,6 @@ proc testWeb3Provider*(web3Url: Uri, awaitWithRetries web3.provider.eth_getBlockByNumber(blockId("latest"), false) syncStatus = mustSucceed "get sync status": awaitWithRetries web3.provider.eth_syncing() - listening = mustSucceed "get network listening": - awaitWithRetries web3.provider.net_listening() peers = try: awaitWithRetries web3.provider.net_peerCount() @@ -1539,7 +1543,6 @@ proc testWeb3Provider*(web3Url: Uri, echo "Client Version: ", clientVersion echo "Network Version: ", networkVersion - echo "Network Listening: ", listening echo "Network Peers: ", peers echo "Syncing: ", syncStatus echo "Latest block: ", latestBlock.number.uint64 diff --git a/beacon_chain/spec/datatypes/base.nim b/beacon_chain/spec/datatypes/base.nim index 234bafc84..47e8a36b5 100644 --- a/beacon_chain/spec/datatypes/base.nim +++ b/beacon_chain/spec/datatypes/base.nim @@ -960,10 +960,11 @@ func clear*(cache: var StateCache) = cache.sync_committees.clear func checkForkConsistency*(cfg: RuntimeConfig) = - # TODO re-add cfg.CAPELLA_FORK_VERSION once eth-clients repos include it and - # fix SHARDING_FORK_VERSION to be its new FORK_VERSION. Until then make sure + # TODO add cfg.CAPELLA_FORK_VERSION once merge-testnets repo includes it and + # fixes SHARDING_FORK_VERSION to be a new FORK_VERSION. Until then make sure # that it will never actually use the Capella fork. doAssert cfg.CAPELLA_FORK_EPOCH == FAR_FUTURE_EPOCH + doAssert cfg.SHARDING_FORK_EPOCH == FAR_FUTURE_EPOCH let forkVersions = [cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_FORK_VERSION,