Fix EL requests should do some sleep before repeating request again. (#6441)

This commit is contained in:
Eugene Kabanov 2024-07-24 01:49:52 +03:00 committed by GitHub
parent 20ede0ab35
commit fd4398d4c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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