Skip to content

Commit

Permalink
ensure LC runs exchangeTransitionConfiguration loop (#5312)
Browse files Browse the repository at this point in the history
In #4465, a regression was introduced by deleting the periodic call to
`engine_exchangeTransitionConfiguration` in the Nimbus light client.
This led to the light client never treating the EL as online and,
subsequently, not sending `engine_newPayload` requests for new blocks.
Strangely, `engine_forkchoiceUpdated` requests still make it through :)

Geth still requires both `engine_newPayload` and `fcU` to be called.
By restoring the `exchangeTransitionConfiguration` loop, `newPayload`
requests are once more issued to the EL.
  • Loading branch information
etan-status committed Aug 18, 2023
1 parent 38b1baf commit 9a4a5d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beacon_chain/el/el_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2193,12 +2193,12 @@ proc startChainSyncingLoop(m: ELManager) {.async.} =
await syncedConnectionFut.cancelAndWait()
syncedConnectionFut = m.selectConnectionForChainSyncing()

proc start*(m: ELManager) {.gcsafe.} =
proc start*(m: ELManager, syncChain = true) {.gcsafe.} =
if m.elConnections.len == 0:
return

## Calling `ELManager.start()` on an already started ELManager is a noop
if m.chainSyncingLoopFut.isNil:
if syncChain and m.chainSyncingLoopFut.isNil:
m.chainSyncingLoopFut =
m.startChainSyncingLoop()

Expand Down
4 changes: 4 additions & 0 deletions beacon_chain/nimbus_light_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ programMain:
network, rng, config, cfg, forkDigests, getBeaconTime,
genesis_validators_root, LightClientFinalizationMode.Optimistic)

# Run `exchangeTransitionConfiguration` loop
if elManager != nil:
elManager.start(syncChain = false)

info "Listening to incoming network requests"
network.initBeaconSync(cfg, forkDigests, genesisBlockRoot, getBeaconTime)
network.addValidator(
Expand Down

0 comments on commit 9a4a5d0

Please sign in to comment.