From 1a6b8f15e7ceebca11397ec06911815499b80282 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:23:28 +0000 Subject: [PATCH 1/3] chore(deps): bump micromatch from 4.0.5 to 4.0.8 Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8. - [Release notes](https://github.com/micromatch/micromatch/releases) - [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8) --- updated-dependencies: - dependency-name: micromatch dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index ca1c01a..a90f669 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2512,7 +2512,7 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2, braces@~3.0.2: +braces@^3.0.3, braces@~3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== @@ -5013,11 +5013,11 @@ methods@^1.1.2: integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== micromatch@^4.0.0, micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: - braces "^3.0.2" + braces "^3.0.3" picomatch "^2.3.1" mime-db@1.52.0: From 798be290decbfa67581fbbf4253b93b7118941df Mon Sep 17 00:00:00 2001 From: Taras Alekhin Date: Tue, 3 Sep 2024 15:14:58 +0200 Subject: [PATCH 2/3] feat: added logs for negative finalisation time --- src/waiting-time/waiting-time.service.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/waiting-time/waiting-time.service.ts b/src/waiting-time/waiting-time.service.ts index 716b83c..13791bc 100644 --- a/src/waiting-time/waiting-time.service.ts +++ b/src/waiting-time/waiting-time.service.ts @@ -320,6 +320,7 @@ export class WaitingTimeService { const requests = this.queueInfo.getRequests(); const requestTimestamp = request.timestamp.toNumber() * 1000; const queueStETH = calculateUnfinalizedEthToRequestId(requests, request); + const currentFrame = this.genesisTimeService.getFrameOfEpoch(this.genesisTimeService.getCurrentEpoch()); let currentType = type; let ms = this.genesisTimeService.timeToWithdrawalFrame(frame, requestTimestamp); @@ -327,6 +328,9 @@ export class WaitingTimeService { const isInPast = requestTimestamp + ms - Date.now() < 0; if (isInPast) { + this.logger.warn( + `Request with id ${request.id} was calculated with finalisation in past (finalizationIn=${finalizationIn}) and going to be recalculated`, + ); // if calculation wrong points to past then validators is not excited in time // we need recalculate const recalculatedResult = await this.calculateWithdrawalFrame({ @@ -338,10 +342,17 @@ export class WaitingTimeService { }); ms = this.genesisTimeService.timeToWithdrawalFrame(recalculatedResult.frame, requestTimestamp); - finalizationIn = validateTimeResponseWithFallback(ms) + GAP_AFTER_REPORT; currentType = recalculatedResult.type; } + // temporary fallback for negative results, can be deleted after validator balances computation improvements + if (ms < 0) { + this.logger.warn( + `Request with id ${request.id} was recalculated and finalisation still in points to past (recalculated finalizationIn=${ms}). Fallback to next frame`, + ); + finalizationIn = this.genesisTimeService.timeToWithdrawalFrame(currentFrame + 1, requestTimestamp); + } + return { type: currentType, finalizationIn, From a321aef77580f3e197a7bdb455478fd9b8bf388c Mon Sep 17 00:00:00 2001 From: Taras Alekhin Date: Tue, 3 Sep 2024 15:53:07 +0200 Subject: [PATCH 3/3] fix: fixed logs and fallback --- src/waiting-time/waiting-time.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/waiting-time/waiting-time.service.ts b/src/waiting-time/waiting-time.service.ts index 13791bc..bf64509 100644 --- a/src/waiting-time/waiting-time.service.ts +++ b/src/waiting-time/waiting-time.service.ts @@ -329,7 +329,7 @@ export class WaitingTimeService { if (isInPast) { this.logger.warn( - `Request with id ${request.id} was calculated with finalisation in past (finalizationIn=${finalizationIn}) and going to be recalculated`, + `Request with id ${request.id} was calculated with finalisation in past (finalizationIn=${ms}) and going to be recalculated`, ); // if calculation wrong points to past then validators is not excited in time // we need recalculate @@ -348,9 +348,10 @@ export class WaitingTimeService { // temporary fallback for negative results, can be deleted after validator balances computation improvements if (ms < 0) { this.logger.warn( - `Request with id ${request.id} was recalculated and finalisation still in points to past (recalculated finalizationIn=${ms}). Fallback to next frame`, + `Request with id ${request.id} was recalculated and finalisation still in past (recalculated finalizationIn=${ms}). Fallback to next frame`, ); - finalizationIn = this.genesisTimeService.timeToWithdrawalFrame(currentFrame + 1, requestTimestamp); + finalizationIn = + this.genesisTimeService.timeToWithdrawalFrame(currentFrame + 1, requestTimestamp) + GAP_AFTER_REPORT; } return {