diff --git a/src/common/registry/main/abstract-registry.ts b/src/common/registry/main/abstract-registry.ts index e0c3fc2b..99ebe7d5 100644 --- a/src/common/registry/main/abstract-registry.ts +++ b/src/common/registry/main/abstract-registry.ts @@ -14,7 +14,7 @@ import { RegistryOperator } from '../storage/operator.entity'; import { compareOperators } from '../utils/operator.utils'; -import { BLOCKS_OVERLAP, REGISTRY_GLOBAL_OPTIONS_TOKEN } from './constants'; +import { REGISTRY_GLOBAL_OPTIONS_TOKEN } from './constants'; import { RegistryOptions } from './interfaces/module.interface'; import { chunk } from '@lido-nestjs/utils'; import { RegistryKeyBatchFetchService } from '../fetch/key-batch.fetch'; @@ -72,22 +72,9 @@ export abstract class AbstractRegistryService { */ public async operatorsWereChanged( moduleAddress: string, - { - fromBlockNumber, - toBlockNumber, - }: { - fromBlockNumber?: number; - toBlockNumber: number; - }, + fromBlockNumber: number, + toBlockNumber: number, ): Promise { - if (fromBlockNumber === undefined) return true; - - if (fromBlockNumber > toBlockNumber) { - throw new Error(`invalid blocks range: ${fromBlockNumber} (fromBlockNumber) > ${toBlockNumber} (toBlockNumber)`); - } - // check how big the difference between the blocks is, if it exceeds, we should update the state anyway - if (toBlockNumber - fromBlockNumber > BLOCKS_OVERLAP) return true; - // rename return await this.operatorFetch.operatorsWereChanged(moduleAddress, fromBlockNumber, toBlockNumber); } diff --git a/src/common/registry/main/constants.ts b/src/common/registry/main/constants.ts index 8a6fcc14..17883f7b 100644 --- a/src/common/registry/main/constants.ts +++ b/src/common/registry/main/constants.ts @@ -1,2 +1 @@ export const REGISTRY_GLOBAL_OPTIONS_TOKEN = Symbol('registryGlobalOptions'); -export const BLOCKS_OVERLAP = 120;