Skip to content

Commit

Permalink
Merge pull request #234 from lidofinance/fix/retry-on-non-finalized-e…
Browse files Browse the repository at this point in the history
…poch

fix: retry on non finalized epoch
  • Loading branch information
AlexanderLukin authored Jan 17, 2024
2 parents afb5ee8 + 6766c86 commit ba56d2a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/common/consensus-provider/consensus-provider.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ export class ConsensusProviderService {
if (Number(r.data.header.message.slot) > this.latestSlot.slot) {
this.latestSlot = { slot: Number(r.data.header.message.slot), fetchTime: Number(Date.now()) };
}
if (processingState.epoch < Math.trunc(this.latestSlot.slot / this.config.get('FETCH_INTERVAL_SLOTS'))) {
// if our last processed epoch is less than last, we shouldn't use fallback
return false;
} else if (Number(Date.now()) - this.latestSlot.fetchTime > 420 * 1000) {
if (Number(Date.now()) - this.latestSlot.fetchTime > 420 * 1000) {
// if latest slot doesn't change ~7m we must switch to fallback
this.logger.error("Latest slot hasn't changed in ~7m");
return true;
Expand Down

0 comments on commit ba56d2a

Please sign in to comment.