mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-15 00:54:49 +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:
|
if len(pendingRequests) == 0:
|
||||||
# All requests failed, we will continue our attempts until deadline
|
# All requests failed, we will continue our attempts until deadline
|
||||||
# is not finished.
|
# 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
|
break mainLoop
|
||||||
|
|
||||||
proc forkchoiceUpdatedForSingleEL(
|
proc forkchoiceUpdatedForSingleEL(
|
||||||
@ -1532,6 +1540,14 @@ proc forkchoiceUpdated*(
|
|||||||
if len(pendingRequests) == 0:
|
if len(pendingRequests) == 0:
|
||||||
# All requests failed, we will continue our attempts until deadline
|
# All requests failed, we will continue our attempts until deadline
|
||||||
# is not finished.
|
# 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
|
break mainLoop
|
||||||
|
|
||||||
# TODO can't be defined within exchangeConfigWithSingleEL
|
# TODO can't be defined within exchangeConfigWithSingleEL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user