remove some usage of calls not required by engine API (#3761)

This commit is contained in:
tersec 2022-06-17 06:32:52 +00:00 committed by GitHub
parent 0a8589986a
commit 2924ed9604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -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

View File

@ -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,