Skip to content

Commit ea10460

Browse files
authored
Pass TimeConfig to OptimisticProcessor (#7622)
* Pass TimeConfig to OptimisticProcessor OptimisticProcessor (used to optimistically sync EL while CL is behind) needs SECONDS_PER_SLOT for logging, similar to ValidatorMonitor metrics. Pass it the TimeConfig to keep supporting that. * Lint
1 parent 2a9318a commit ea10460

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

beacon_chain/beacon_node_light_client.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ proc initLightClient*(
5252
forkyBlck.message)
5353
else: discard
5454
optimisticProcessor = initOptimisticProcessor(
55-
getBeaconTime, optimisticHandler)
55+
cfg.time, getBeaconTime, optimisticHandler)
5656

5757
shouldInhibitSync = func(): bool =
5858
if isNil(node.syncOverseer):

beacon_chain/gossip_processing/optimistic_processor.nim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# beacon_chain
2-
# Copyright (c) 2019-2024 Status Research & Development GmbH
2+
# Copyright (c) 2019-2025 Status Research & Development GmbH
33
# Licensed and distributed under either of
44
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
55
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
@@ -26,14 +26,17 @@ type
2626
): Future[void] {.async: (raises: [CancelledError]).}
2727

2828
OptimisticProcessor* = ref object
29+
timeConfig: TimeConfig
2930
getBeaconTime: GetBeaconTimeFn
3031
optimisticVerifier: OptimisticBlockVerifier
3132
processFut: Future[void].Raising([CancelledError])
3233

3334
proc initOptimisticProcessor*(
35+
timeConfig: TimeConfig,
3436
getBeaconTime: GetBeaconTimeFn,
3537
optimisticVerifier: OptimisticBlockVerifier): OptimisticProcessor =
3638
OptimisticProcessor(
39+
timeConfig: timeConfig,
3740
getBeaconTime: getBeaconTime,
3841
optimisticVerifier: optimisticVerifier)
3942

beacon_chain/nimbus_light_client.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ proc main() {.noinline, raises: [CatchableError].} =
108108
discard await elManager.newExecutionPayload(forkyBlck.message)
109109
else: discard
110110
optimisticProcessor = initOptimisticProcessor(
111-
getBeaconTime, optimisticHandler)
111+
cfg.time, getBeaconTime, optimisticHandler)
112112

113113
lightClient = createLightClient(
114114
network, rng, config, cfg, forkDigests, getBeaconTime,

0 commit comments

Comments
 (0)