@@ -37,6 +37,7 @@ proc serveSyncCommitteeMessage*(
3737 vc = service.client
3838 startTime = Moment .now ()
3939 fork = vc.forkAtEpoch (slot.epoch)
40+ currentFork = vc.getConsensusFork (fork)
4041 genesisValidatorsRoot = vc.beaconGenesis.genesis_validators_root
4142 vindex = duty.validator_index
4243 validator = vc.getValidatorForDuties (
@@ -63,7 +64,8 @@ proc serveSyncCommitteeMessage*(
6364
6465 debug " Sending sync committee message" ,
6566 delay = vc.getDelay (
66- message.slot.sync_committee_message_deadline (vc.timeParams))
67+ message.slot.sync_committee_message_deadline (
68+ vc.timeParams, currentFork))
6769
6870 let res =
6971 try :
@@ -78,7 +80,8 @@ proc serveSyncCommitteeMessage*(
7880
7981 let
8082 delay = vc.getDelay (
81- message.slot.sync_committee_message_deadline (vc.timeParams))
83+ message.slot.sync_committee_message_deadline (
84+ vc.timeParams, currentFork))
8285 dur = Moment .now () - startTime
8386
8487 if res:
@@ -133,7 +136,9 @@ proc produceAndPublishSyncCommitteeMessages(
133136 (succeed, errored, failed)
134137
135138 let
136- delay = vc.getDelay (slot.attestation_deadline (vc.timeParams))
139+ consensusFork = vc.getConsensusFork (vc.forkAtEpoch (slot.epoch))
140+ delay = vc.getDelay (slot.attestation_deadline (
141+ vc.timeParams, consensusFork))
137142 dur = Moment .now () - startTime
138143
139144 debug " Sync committee message statistics" ,
@@ -154,6 +159,7 @@ proc serveContributionAndProof*(
154159 slot = proof.contribution.slot
155160 genesisRoot = vc.beaconGenesis.genesis_validators_root
156161 fork = vc.forkAtEpoch (slot.epoch)
162+ consensusFork = vc.getConsensusFork (fork)
157163
158164 logScope:
159165 validator = validatorLog (validator)
@@ -176,7 +182,8 @@ proc serveContributionAndProof*(
176182 res.get ()
177183
178184 debug " Sending sync contribution" ,
179- delay = vc.getDelay (slot.sync_contribution_deadline (vc.timeParams))
185+ delay = vc.getDelay (slot.sync_contribution_deadline (
186+ vc.timeParams, consensusFork))
180187
181188 let restSignedProof = RestSignedContributionAndProof .init (
182189 proof, signature)
@@ -328,7 +335,8 @@ proc produceAndPublishContributions(
328335 (succeed, errored, failed)
329336
330337 let
331- delay = vc.getDelay (slot.aggregate_deadline (vc.timeParams))
338+ consensusFork = vc.getConsensusFork (vc.forkAtEpoch (slot.epoch))
339+ delay = vc.getDelay (slot.aggregate_deadline (vc.timeParams, consensusFork))
332340 dur = Moment .now () - startTime
333341
334342 debug " Sync message contribution statistics" ,
@@ -355,8 +363,10 @@ proc publishSyncMessagesAndContributions(
355363 slot = slot
356364
357365 block :
358- let delay = vc.getDelay (
359- slot.sync_committee_message_deadline (vc.timeParams))
366+ let
367+ currentFork = vc.getConsensusFork (vc.forkAtEpoch (slot.epoch))
368+ delay = vc.getDelay (
369+ slot.sync_committee_message_deadline (vc.timeParams, currentFork))
360370 debug " Producing sync committee messages" , delay = delay,
361371 duties_count = len (duties)
362372
@@ -396,15 +406,19 @@ proc publishSyncMessagesAndContributions(
396406 return
397407
398408 let currentTime = vc.beaconClock.now ()
399- if slot.sync_contribution_deadline (vc.timeParams) > currentTime:
409+ let consensusFork = vc.getConsensusFork (vc.forkAtEpoch (slot.epoch))
410+ if slot.sync_contribution_deadline (
411+ vc.timeParams, consensusFork) > currentTime:
400412 let waitDur = nanoseconds ((
401- slot.sync_contribution_deadline (vc.timeParams) - currentTime).nanoseconds)
413+ slot.sync_contribution_deadline (
414+ vc.timeParams, consensusFork) - currentTime).nanoseconds)
402415 # Sleeping until `sync_contribution_deadline`.
403416 debug " Waiting for sync contribution deadline" , wait_time = waitDur
404417 await sleepAsync (waitDur)
405418
406419 block :
407- let delay = vc.getDelay (slot.sync_contribution_deadline (vc.timeParams))
420+ let delay = vc.getDelay (
421+ slot.sync_contribution_deadline (vc.timeParams, consensusFork))
408422 debug " Producing contribution and proofs" , delay = delay
409423
410424 try :
0 commit comments