Skip to content

Commit

Permalink
rm require engine API check (#4144)
Browse files Browse the repository at this point in the history
The `eth1_monitor` check to require engine API from bellatrix onward
has issues in setups where the EL and CL are started simultaneously
because the EL may not be ready to answer requests by the time that the
check is performed. This can be observed, e.g., on Raspberry Pi 4 when
using Besu as the EL client. Now that the merge transition happened, the
check is also not that useful anymore, as users have other ways to know
that their setup is not working correctly (e.g., repeated exchange logs)
  • Loading branch information
etan-status authored Sep 19, 2022
1 parent 77d28f4 commit 0708fcd
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 28 deletions.
4 changes: 2 additions & 2 deletions beacon_chain/conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ type
name: "web3-force-polling" .}: bool

requireEngineAPI* {.
defaultValue: true
hidden # Deprecated > 22.9
desc: "Require Nimbus to be configured with an Engine API end-point after the Bellatrix fork epoch"
name: "require-engine-api-in-bellatrix" .}: bool
name: "require-engine-api-in-bellatrix" .}: Option[bool]

nonInteractive* {.
desc: "Do not display interative prompts. Quit on missing configuration"
Expand Down
18 changes: 2 additions & 16 deletions beacon_chain/eth1/eth1_monitor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ type
stopFut: Future[void]
getBeaconTime: GetBeaconTimeFn

requireEngineAPI: bool

when hasGenesisDetection:
genesisValidators: seq[ImmutableValidatorData]
genesisValidatorKeyToIndex: Table[ValidatorPubKey, ValidatorIndex]
Expand Down Expand Up @@ -1041,8 +1039,7 @@ proc init*(T: type Eth1Monitor,
depositContractSnapshot: Option[DepositContractSnapshot],
eth1Network: Option[Eth1Network],
forcePolling: bool,
jwtSecret: Option[seq[byte]],
requireEngineAPI: bool): T =
jwtSecret: Option[seq[byte]]): T =
doAssert web3Urls.len > 0
var web3Urls = web3Urls
for url in mitems(web3Urls):
Expand All @@ -1060,8 +1057,7 @@ proc init*(T: type Eth1Monitor,
eth1Progress: newAsyncEvent(),
forcePolling: forcePolling,
jwtSecret: jwtSecret,
blocksPerLogsRequest: targetBlocksPerLogsRequest,
requireEngineAPI: requireEngineAPI)
blocksPerLogsRequest: targetBlocksPerLogsRequest)

proc safeCancel(fut: var Future[void]) =
if not fut.isNil and not fut.finished:
Expand Down Expand Up @@ -1349,16 +1345,6 @@ proc startEth1Syncing(m: Eth1Monitor, delayBeforeStart: Duration) {.async.} =
await m.ensureDataProvider()
doAssert m.dataProvider != nil, "close not called concurrently"

if m.currentEpoch >= m.cfg.BELLATRIX_FORK_EPOCH:
let status = await m.exchangeTransitionConfiguration()
if status != EtcStatus.match and isFirstRun and m.requireEngineAPI:
fatal "The Bellatrix hard fork requires the beacon node to be connected to a properly configured Engine API end-point. " &
"See https://nimbus.guide/merge.html for more details. " &
"If you want to temporarily continue operating Nimbus without configuring an Engine API end-point, " &
"please specify the command-line option --require-engine-api-in-bellatrix=no when launching it. " &
"Please note that you MUST complete the migration before the network TTD is reached (estimated to happen near 13th of September)"
quit 1

# We might need to reset the chain if the new provider disagrees
# with the previous one regarding the history of the chain or if
# we have detected a conensus violation - our view disagreeing with
Expand Down
12 changes: 8 additions & 4 deletions beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,7 @@ proc init*(T: type BeaconNode,
getDepositContractSnapshot(),
eth1Network,
config.web3ForcePolling,
optJwtSecret,
config.requireEngineAPI)
optJwtSecret)

eth1Monitor.loadPersistedDeposits()

Expand Down Expand Up @@ -643,8 +642,7 @@ proc init*(T: type BeaconNode,
getDepositContractSnapshot(),
eth1Network,
config.web3ForcePolling,
optJwtSecret,
config.requireEngineAPI)
optJwtSecret)

if config.rpcEnabled:
warn "Nimbus's JSON-RPC server has been removed. This includes the --rpc, --rpc-port, and --rpc-address configuration options. https://nimbus.guide/rest-api.html shows how to enable and configure the REST Beacon API server which replaces it."
Expand Down Expand Up @@ -1806,6 +1804,12 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
cmdParams = commandLineParams(),
config

template ignoreDeprecatedOption(option: untyped): untyped =
if config.option.isSome:
warn "Config option is deprecated",
option = config.option.get
ignoreDeprecatedOption requireEngineAPI

createPidFile(config.dataDir.string / "beacon_node.pid")

config.createDumpDirs()
Expand Down
3 changes: 1 addition & 2 deletions beacon_chain/nimbus_light_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ programMain:
cfg, db = nil, getBeaconTime, config.web3Urls,
none(DepositContractSnapshot), metadata.eth1Network,
forcePolling = false,
rng[].loadJwtSecret(config, allowCreate = false),
true)
rng[].loadJwtSecret(config, allowCreate = false))
waitFor res.ensureDataProvider()
res
else:
Expand Down
4 changes: 2 additions & 2 deletions docs/the_nimbus_book/src/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ The following options are available:
--secrets-dir A directory containing validator keystore passwords.
--wallets-dir A directory containing wallet files.
--web3-url One or more execution layer Web3 provider URLs.
--require-engine-api-in-bellatrix Require Nimbus to be configured with an Engine API end-point after the Bellatrix
fork epoch [=true].
--non-interactive Do not display interative prompts. Quit on missing configuration.
--netkey-file Source of network (secp256k1) private key file (random|<path>) [=random].
--insecure-netkey-password Use pre-generated INSECURE password for network private key file [=false].
Expand Down Expand Up @@ -113,6 +111,8 @@ The following options are available:
--validator-monitor-totals Publish metrics to single 'totals' label for better collection performance when
monitoring many validators (BETA) [=false].
--suggested-fee-recipient Suggested fee recipient.
--payload-builder Enable external payload builder [=false].
--payload-builder-url Payload builder URL.
...
```
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_merge_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ proc run() {.async.} =
eth1Monitor = Eth1Monitor.init(
defaultRuntimeConfig, db = nil, nil, @[paramStr(1)],
none(DepositContractSnapshot), none(Eth1Network), false,
some readJwtSecret(paramStr(2)).get, true)
some readJwtSecret(paramStr(2)).get)

await eth1Monitor.ensureDataProvider()
try:
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_merge_vectors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ proc run() {.async.} =
eth1Monitor = Eth1Monitor.init(
defaultRuntimeConfig, db = nil, nil, @[web3Url],
none(DepositContractSnapshot), none(Eth1Network),
false, jwtSecret, true)
false, jwtSecret)
web3Provider = (await Web3DataProvider.new(
default(Eth1Address), web3Url, jwtSecret)).get

Expand Down

0 comments on commit 0708fcd

Please sign in to comment.