File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -320,13 +320,17 @@ export class WaitingTimeService {
320
320
const requests = this . queueInfo . getRequests ( ) ;
321
321
const requestTimestamp = request . timestamp . toNumber ( ) * 1000 ;
322
322
const queueStETH = calculateUnfinalizedEthToRequestId ( requests , request ) ;
323
+ const currentFrame = this . genesisTimeService . getFrameOfEpoch ( this . genesisTimeService . getCurrentEpoch ( ) ) ;
323
324
324
325
let currentType = type ;
325
326
let ms = this . genesisTimeService . timeToWithdrawalFrame ( frame , requestTimestamp ) ;
326
327
let finalizationIn = validateTimeResponseWithFallback ( ms ) + GAP_AFTER_REPORT ;
327
328
const isInPast = requestTimestamp + ms - Date . now ( ) < 0 ;
328
329
329
330
if ( isInPast ) {
331
+ this . logger . warn (
332
+ `Request with id ${ request . id } was calculated with finalisation in past (finalizationIn=${ ms } ) and going to be recalculated` ,
333
+ ) ;
330
334
// if calculation wrong points to past then validators is not excited in time
331
335
// we need recalculate
332
336
const recalculatedResult = await this . calculateWithdrawalFrame ( {
@@ -338,10 +342,18 @@ export class WaitingTimeService {
338
342
} ) ;
339
343
340
344
ms = this . genesisTimeService . timeToWithdrawalFrame ( recalculatedResult . frame , requestTimestamp ) ;
341
- finalizationIn = validateTimeResponseWithFallback ( ms ) + GAP_AFTER_REPORT ;
342
345
currentType = recalculatedResult . type ;
343
346
}
344
347
348
+ // temporary fallback for negative results, can be deleted after validator balances computation improvements
349
+ if ( ms < 0 ) {
350
+ this . logger . warn (
351
+ `Request with id ${ request . id } was recalculated and finalisation still in past (recalculated finalizationIn=${ ms } ). Fallback to next frame` ,
352
+ ) ;
353
+ finalizationIn =
354
+ this . genesisTimeService . timeToWithdrawalFrame ( currentFrame + 1 , requestTimestamp ) + GAP_AFTER_REPORT ;
355
+ }
356
+
345
357
return {
346
358
type : currentType ,
347
359
finalizationIn,
Original file line number Diff line number Diff line change @@ -2512,7 +2512,7 @@ brace-expansion@^2.0.1:
2512
2512
dependencies :
2513
2513
balanced-match "^1.0.0"
2514
2514
2515
- braces@^3.0.2 , braces@~3.0.2 :
2515
+ braces@^3.0.3 , braces@~3.0.2 :
2516
2516
version "3.0.3"
2517
2517
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
2518
2518
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
@@ -5013,11 +5013,11 @@ methods@^1.1.2:
5013
5013
integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==
5014
5014
5015
5015
micromatch@^4.0.0, micromatch@^4.0.4 :
5016
- version "4.0.5 "
5017
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5 .tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6 "
5018
- integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA ==
5016
+ version "4.0.8 "
5017
+ resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8 .tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202 "
5018
+ integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA ==
5019
5019
dependencies :
5020
- braces "^3.0.2 "
5020
+ braces "^3.0.3 "
5021
5021
picomatch "^2.3.1"
5022
5022
5023
5023
You can’t perform that action at this time.
0 commit comments