mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-14 16:47:21 +00:00
Fix EL requests should do some sleep before repeating request again. (#6441)
This commit is contained in:
parent
20ede0ab35
commit
fd4398d4c5
@ -1359,6 +1359,14 @@ proc sendNewPayload*(
|
||||
if len(pendingRequests) == 0:
|
||||
# All requests failed, we will continue our attempts until deadline
|
||||
# is not finished.
|
||||
|
||||
# To avoid continous spam of requests when EL node is offline we
|
||||
# going to sleep until next attempt for
|
||||
# (NEWPAYLOAD_TIMEOUT / 4) time (2.seconds).
|
||||
let timeout =
|
||||
chronos.nanoseconds(NEWPAYLOAD_TIMEOUT.nanoseconds div 4)
|
||||
await sleepAsync(timeout)
|
||||
|
||||
break mainLoop
|
||||
|
||||
proc forkchoiceUpdatedForSingleEL(
|
||||
@ -1532,6 +1540,14 @@ proc forkchoiceUpdated*(
|
||||
if len(pendingRequests) == 0:
|
||||
# All requests failed, we will continue our attempts until deadline
|
||||
# is not finished.
|
||||
|
||||
# To avoid continous spam of requests when EL node is offline we
|
||||
# going to sleep until next attempt for
|
||||
# (FORKCHOICEUPDATED_TIMEOUT / 4) time (2.seconds).
|
||||
let timeout =
|
||||
chronos.nanoseconds(FORKCHOICEUPDATED_TIMEOUT.nanoseconds div 4)
|
||||
await sleepAsync(timeout)
|
||||
|
||||
break mainLoop
|
||||
|
||||
# TODO can't be defined within exchangeConfigWithSingleEL
|
||||
|
Loading…
x
Reference in New Issue
Block a user