diff --git a/lib/services/events.d.ts b/lib/services/events.d.ts index a4d5dda..6326242 100644 --- a/lib/services/events.d.ts +++ b/lib/services/events.d.ts @@ -1,117 +1,123 @@ import { BaseTornadoService, BaseEncryptedNotesService, BaseGovernanceService, BaseRegistryService, BaseTornadoServiceConstructor, BaseEncryptedNotesServiceConstructor, BaseGovernanceServiceConstructor, BaseRegistryServiceConstructor, BaseEchoServiceConstructor, BaseEchoService, CachedRelayers, BatchEventsService } from '@tornado/core'; -import type { BaseEvents, DepositsEvents, WithdrawalsEvents, EncryptedNotesEvents, RegistersEvents, AllGovernanceEvents, EchoEvents, BatchEventServiceConstructor, BatchEventOnProgress, NetIdType, MerkleTreeService } from '@tornado/core'; +import type { BaseEvents, DepositsEvents, WithdrawalsEvents, EncryptedNotesEvents, RegistersEvents, AllGovernanceEvents, EchoEvents, BatchEventServiceConstructor, BatchEventOnProgress, NetIdType } from '@tornado/core'; import type { Logger } from 'winston'; import { TreeCache } from './treeCache'; -export type NodeEventsConstructor = BatchEventServiceConstructor & { +export interface NodeEventsConstructor extends BatchEventServiceConstructor { netId: NetIdType; logger: Logger; getInstanceName: () => string; -}; +} export declare class NodeEventsService extends BatchEventsService { netId: NetIdType; logger: Logger; getInstanceName: () => string; constructor(serviceConstructor: NodeEventsConstructor); } -export type NodeTornadoServiceConstructor = BaseTornadoServiceConstructor & { +export interface NodeTornadoServiceConstructor extends BaseTornadoServiceConstructor { cacheDirectory: string; userDirectory: string; nativeCurrency: string; logger: Logger; - merkleTreeService?: MerkleTreeService; treeCache?: TreeCache; -}; +} export declare class NodeTornadoService extends BaseTornadoService { cacheDirectory: string; userDirectory: string; nativeCurrency: string; logger: Logger; - merkleTreeService?: MerkleTreeService; treeCache?: TreeCache; - constructor({ netId, provider, graphApi, subgraphName, Tornado, type, amount, currency, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, nativeCurrency, logger, merkleTreeService, treeCache, }: NodeTornadoServiceConstructor); + constructor(serviceConstructor: NodeTornadoServiceConstructor); updateEventProgress({ fromBlock, toBlock, count, }: Parameters[0]): void; getEventsFromDB(): Promise>; getEventsFromCache(): Promise>; + validateEvents({ events, lastBlock, hasNewEvents, }: BaseEvents & { + hasNewEvents?: boolean; + }): Promise; saveEvents({ events, lastBlock, }: BaseEvents): Promise; - updateEvents(): Promise<{ + updateEvents(): Promise<{ events: (DepositsEvents | WithdrawalsEvents)[]; lastBlock: number; + validateResult: Awaited; }>; } -export type NodeEchoServiceConstructor = BaseEchoServiceConstructor & { +export interface NodeEchoServiceConstructor extends BaseEchoServiceConstructor { cacheDirectory: string; userDirectory: string; logger: Logger; -}; +} export declare class NodeEchoService extends BaseEchoService { cacheDirectory: string; userDirectory: string; logger: Logger; - constructor({ netId, provider, graphApi, subgraphName, Echoer, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }: NodeEchoServiceConstructor); + constructor(serviceConstructor: NodeEchoServiceConstructor); updateEventProgress({ fromBlock, toBlock, count, }: Parameters[0]): void; getEventsFromDB(): Promise>; getEventsFromCache(): Promise>; saveEvents({ events, lastBlock }: BaseEvents): Promise; - updateEvents(): Promise<{ + updateEvents(): Promise<{ events: EchoEvents[]; lastBlock: number; + validateResult: Awaited; }>; } -export type NodeEncryptedNotesServiceConstructor = BaseEncryptedNotesServiceConstructor & { +export interface NodeEncryptedNotesServiceConstructor extends BaseEncryptedNotesServiceConstructor { cacheDirectory: string; userDirectory: string; logger: Logger; -}; +} export declare class NodeEncryptedNotesService extends BaseEncryptedNotesService { cacheDirectory: string; userDirectory: string; logger: Logger; - constructor({ netId, provider, graphApi, subgraphName, Router, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }: NodeEncryptedNotesServiceConstructor); + constructor(serviceConstructor: NodeEncryptedNotesServiceConstructor); updateEventProgress({ fromBlock, toBlock, count, }: Parameters[0]): void; getEventsFromDB(): Promise>; getEventsFromCache(): Promise>; saveEvents({ events, lastBlock }: BaseEvents): Promise; - updateEvents(): Promise<{ + updateEvents(): Promise<{ events: EncryptedNotesEvents[]; lastBlock: number; + validateResult: Awaited; }>; } -export type NodeGovernanceServiceConstructor = BaseGovernanceServiceConstructor & { +export interface NodeGovernanceServiceConstructor extends BaseGovernanceServiceConstructor { cacheDirectory: string; userDirectory: string; logger: Logger; -}; +} export declare class NodeGovernanceService extends BaseGovernanceService { cacheDirectory: string; userDirectory: string; logger: Logger; - constructor({ netId, provider, graphApi, subgraphName, Governance, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }: NodeGovernanceServiceConstructor); + constructor(serviceConstructor: NodeGovernanceServiceConstructor); updateEventProgress({ fromBlock, toBlock, count, }: Parameters[0]): void; getEventsFromDB(): Promise>; getEventsFromCache(): Promise>; saveEvents({ events, lastBlock }: BaseEvents): Promise; - updateEvents(): Promise<{ + updateEvents(): Promise<{ events: AllGovernanceEvents[]; lastBlock: number; + validateResult: Awaited; }>; } -export type NodeRegistryServiceConstructor = BaseRegistryServiceConstructor & { +export interface NodeRegistryServiceConstructor extends BaseRegistryServiceConstructor { cacheDirectory: string; userDirectory: string; logger: Logger; -}; +} export declare class NodeRegistryService extends BaseRegistryService { cacheDirectory: string; userDirectory: string; logger: Logger; - constructor({ netId, provider, graphApi, subgraphName, RelayerRegistry, Aggregator, relayerEnsSubdomains, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }: NodeRegistryServiceConstructor); + constructor(serviceConstructor: NodeRegistryServiceConstructor); updateEventProgress({ fromBlock, toBlock, count, }: Parameters[0]): void; getEventsFromDB(): Promise>; getEventsFromCache(): Promise>; saveEvents({ events, lastBlock }: BaseEvents): Promise; - updateEvents(): Promise<{ + updateEvents(): Promise<{ events: RegistersEvents[]; lastBlock: number; + validateResult: Awaited; }>; getRelayersFromDB(): Promise; getRelayersFromCache(): Promise; diff --git a/lib/services/events.js b/lib/services/events.js index 81c9bbc..11c1fab 100644 --- a/lib/services/events.js +++ b/lib/services/events.js @@ -9,6 +9,9 @@ const promises_1 = require("fs/promises"); const core_1 = require("@tornado/core"); const data_1 = require("./data"); class NodeEventsService extends core_1.BatchEventsService { + netId; + logger; + getInstanceName; constructor(serviceConstructor) { super(serviceConstructor); this.netId = serviceConstructor.netId; @@ -18,19 +21,14 @@ class NodeEventsService extends core_1.BatchEventsService { } exports.NodeEventsService = NodeEventsService; class NodeTornadoService extends core_1.BaseTornadoService { - constructor({ netId, provider, graphApi, subgraphName, Tornado, type, amount, currency, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, nativeCurrency, logger, merkleTreeService, treeCache, }) { - super({ - netId, - provider, - graphApi, - subgraphName, - Tornado, - type, - amount, - currency, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory; + userDirectory; + nativeCurrency; + logger; + treeCache; + constructor(serviceConstructor) { + super(serviceConstructor); + const { netId, provider, Tornado, type, amount, currency, cacheDirectory, userDirectory, nativeCurrency, logger, treeCache, } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; this.nativeCurrency = nativeCurrency; @@ -43,7 +41,6 @@ class NodeTornadoService extends core_1.BaseTornadoService { logger, getInstanceName: () => `${type.toLowerCase()}s_${netId}_${currency}_${amount}`, }); - this.merkleTreeService = merkleTreeService; this.treeCache = treeCache; } updateEventProgress({ fromBlock, toBlock, count, }) { @@ -64,25 +61,29 @@ class NodeTornadoService extends core_1.BaseTornadoService { deployedBlock: this.deployedBlock, }); } - async saveEvents({ events, lastBlock, }) { - const instanceName = this.getInstanceName(); - if (this.getType().toLowerCase() === core_1.DEPOSIT && - this.merkleTreeService) { - const tree = await this.merkleTreeService.verifyTree(events); - if (this.currency === this.nativeCurrency && this.treeCache) { - await this.treeCache.createTree(events, tree); - this.logger.debug(`${this.getInstanceName()}: Updated tree cache with root ${(0, core_1.toFixedHex)(BigInt(tree.root))}`); - } + async validateEvents({ events, lastBlock, hasNewEvents, }) { + const tree = await super.validateEvents({ + events, + lastBlock, + hasNewEvents, + }); + if (tree && this.currency === this.nativeCurrency && this.treeCache) { + const merkleTree = tree; + await this.treeCache.createTree(events, merkleTree); + console.log(`${this.getInstanceName()}: Updated tree cache with root ${(0, core_1.toFixedHex)(BigInt(merkleTree.root))}\n`); } + return tree; + } + async saveEvents({ events, lastBlock, }) { await (0, data_1.saveUserFile)({ - fileName: instanceName + '.json', + fileName: this.getInstanceName() + '.json', userDirectory: this.userDirectory, dataString: JSON.stringify(events, null, 2) + '\n', lastBlock, }); } async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + const { events, lastBlock, validateResult } = await super.updateEvents(); await (0, data_1.saveLastBlock)({ fileName: this.getInstanceName(), userDirectory: this.userDirectory, @@ -91,21 +92,18 @@ class NodeTornadoService extends core_1.BaseTornadoService { return { events, lastBlock, + validateResult, }; } } exports.NodeTornadoService = NodeTornadoService; class NodeEchoService extends core_1.BaseEchoService { - constructor({ netId, provider, graphApi, subgraphName, Echoer, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }) { - super({ - netId, - provider, - graphApi, - subgraphName, - Echoer, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory; + userDirectory; + logger; + constructor(serviceConstructor) { + super(serviceConstructor); + const { netId, provider, Echoer, cacheDirectory, userDirectory, logger, } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; this.logger = logger; @@ -146,7 +144,7 @@ class NodeEchoService extends core_1.BaseEchoService { }); } async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + const { events, lastBlock, validateResult } = await super.updateEvents(); await (0, data_1.saveLastBlock)({ fileName: this.getInstanceName(), userDirectory: this.userDirectory, @@ -155,21 +153,18 @@ class NodeEchoService extends core_1.BaseEchoService { return { events, lastBlock, + validateResult, }; } } exports.NodeEchoService = NodeEchoService; class NodeEncryptedNotesService extends core_1.BaseEncryptedNotesService { - constructor({ netId, provider, graphApi, subgraphName, Router, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }) { - super({ - netId, - provider, - graphApi, - subgraphName, - Router, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory; + userDirectory; + logger; + constructor(serviceConstructor) { + super(serviceConstructor); + const { netId, provider, Router, cacheDirectory, userDirectory, logger, } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; this.logger = logger; @@ -210,7 +205,7 @@ class NodeEncryptedNotesService extends core_1.BaseEncryptedNotesService { }); } async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + const { events, lastBlock, validateResult } = await super.updateEvents(); await (0, data_1.saveLastBlock)({ fileName: this.getInstanceName(), userDirectory: this.userDirectory, @@ -219,21 +214,18 @@ class NodeEncryptedNotesService extends core_1.BaseEncryptedNotesService { return { events, lastBlock, + validateResult, }; } } exports.NodeEncryptedNotesService = NodeEncryptedNotesService; class NodeGovernanceService extends core_1.BaseGovernanceService { - constructor({ netId, provider, graphApi, subgraphName, Governance, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }) { - super({ - netId, - provider, - graphApi, - subgraphName, - Governance, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory; + userDirectory; + logger; + constructor(serviceConstructor) { + super(serviceConstructor); + const { netId, provider, Governance, cacheDirectory, userDirectory, logger, } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; this.logger = logger; @@ -274,7 +266,7 @@ class NodeGovernanceService extends core_1.BaseGovernanceService { }); } async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + const { events, lastBlock, validateResult } = await super.updateEvents(); await (0, data_1.saveLastBlock)({ fileName: this.getInstanceName(), userDirectory: this.userDirectory, @@ -283,23 +275,18 @@ class NodeGovernanceService extends core_1.BaseGovernanceService { return { events, lastBlock, + validateResult, }; } } exports.NodeGovernanceService = NodeGovernanceService; class NodeRegistryService extends core_1.BaseRegistryService { - constructor({ netId, provider, graphApi, subgraphName, RelayerRegistry, Aggregator, relayerEnsSubdomains, deployedBlock, fetchDataOptions, cacheDirectory, userDirectory, logger, }) { - super({ - netId, - provider, - graphApi, - subgraphName, - RelayerRegistry, - Aggregator, - relayerEnsSubdomains, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory; + userDirectory; + logger; + constructor(serviceConstructor) { + super(serviceConstructor); + const { netId, provider, RelayerRegistry, cacheDirectory, userDirectory, logger, } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; this.logger = logger; @@ -340,7 +327,7 @@ class NodeRegistryService extends core_1.BaseRegistryService { }); } async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + const { events, lastBlock, validateResult } = await super.updateEvents(); await (0, data_1.saveLastBlock)({ fileName: this.getInstanceName(), userDirectory: this.userDirectory, @@ -349,6 +336,7 @@ class NodeRegistryService extends core_1.BaseRegistryService { return { events, lastBlock, + validateResult, }; } async getRelayersFromDB() { diff --git a/lib/services/router.js b/lib/services/router.js index cfd1d4b..46df6f6 100644 --- a/lib/services/router.js +++ b/lib/services/router.js @@ -266,6 +266,13 @@ function listenRouter(router) { (0, routerMsg_1.resolveMessages)(router); } class Router { + relayerConfig; + logger; + forkId; + app; + // For viewing error logs + admin; + messages; constructor(relayerConfig, forkId = 0) { this.relayerConfig = relayerConfig; this.logger = (0, logger_1.getLogger)(`[Router ${forkId}]`, relayerConfig.logLevel); diff --git a/lib/services/sync.js b/lib/services/sync.js index 54f82f3..2fdacd8 100644 --- a/lib/services/sync.js +++ b/lib/services/sync.js @@ -18,7 +18,7 @@ function setupServices(syncManager) { const config = (0, core_1.getConfig)(netId); const rpcUrl = relayerConfig.rpcUrls[netId]; const provider = (0, core_1.getProviderWithNetId)(netId, rpcUrl, config); - const { tokens, nativeCurrency, routerContract, echoContract, registryContract, aggregatorContract, governanceContract, multicallContract, offchainOracleContract, ovmGasPriceOracleContract, deployedBlock, constants: { GOVERNANCE_BLOCK, REGISTRY_BLOCK, NOTE_ACCOUNT_BLOCK, ENCRYPTED_NOTES_BLOCK, }, } = config; + const { tokens, nativeCurrency, routerContract, echoContract, registryContract, aggregatorContract, reverseRecordsContract, governanceContract, multicallContract, offchainOracleContract, ovmGasPriceOracleContract, deployedBlock, constants: { GOVERNANCE_BLOCK, REGISTRY_BLOCK, NOTE_ACCOUNT_BLOCK, ENCRYPTED_NOTES_BLOCK, }, } = config; if (!syncStatus[netId]) { syncStatus[netId] = { events: false, @@ -34,11 +34,15 @@ function setupServices(syncManager) { services.tornadoFeeOracle = new core_1.TornadoFeeOracle(provider, ovmGasPriceOracleContract ? core_1.OvmGasPriceOracle__factory.connect(ovmGasPriceOracleContract, provider) : undefined); - if (governanceContract) { + if (governanceContract && + aggregatorContract && + reverseRecordsContract) { services.governanceService = new events_1.NodeGovernanceService({ netId, provider, Governance: contracts_1.Governance__factory.connect(governanceContract, provider), + Aggregator: contracts_1.Aggregator__factory.connect(aggregatorContract, provider), + ReverseRecords: core_1.ReverseRecords__factory.connect(reverseRecordsContract, provider), deployedBlock: GOVERNANCE_BLOCK, cacheDirectory, userDirectory, @@ -97,23 +101,22 @@ function setupServices(syncManager) { nativeCurrency, logger, }; - const merkleTreeService = new core_1.MerkleTreeService({ - netId, - amount, - currency, - Tornado, - merkleWorkerPath, - }); - const treeCache = new treeCache_1.TreeCache({ - netId, - amount, - currency, - userDirectory: userTreeDir, - }); amountService.depositsService = new events_1.NodeTornadoService({ ...TornadoServiceConstructor, - merkleTreeService, - treeCache, + merkleTreeService: new core_1.MerkleTreeService({ + netId, + amount, + currency, + Tornado, + merkleWorkerPath, + }), + treeCache: new treeCache_1.TreeCache({ + netId, + amount, + currency, + userDirectory: userTreeDir, + }), + optionalTree: true, type: 'Deposit', }); amountService.withdrawalsService = new events_1.NodeTornadoService({ @@ -282,6 +285,17 @@ async function syncNetworkEvents(syncManager, netId) { } } class SyncManager { + relayerConfig; + logger; + cachedServices; + cachedEvents; + cachedPrices; + cachedGasPrices; + syncStatus; + latestBlocks; + latestBalances; + errors; + onSyncEvents; constructor(relayerConfig) { this.relayerConfig = relayerConfig; this.logger = (0, logger_1.getLogger)('[SyncManager]', relayerConfig.logLevel); diff --git a/lib/services/treeCache.js b/lib/services/treeCache.js index a08ecea..afda676 100644 --- a/lib/services/treeCache.js +++ b/lib/services/treeCache.js @@ -7,6 +7,11 @@ exports.TreeCache = void 0; const bloomfilter_js_1 = __importDefault(require("bloomfilter.js")); const data_1 = require("./data"); class TreeCache { + netId; + amount; + currency; + userDirectory; + PARTS_COUNT; constructor({ netId, amount, currency, userDirectory, PARTS_COUNT = 4, }) { this.netId = netId; this.amount = amount; diff --git a/lib/services/worker.js b/lib/services/worker.js index 1f0fbe1..ecd64bf 100644 --- a/lib/services/worker.js +++ b/lib/services/worker.js @@ -21,7 +21,7 @@ var RelayerStatus; RelayerStatus["CONFIRMED"] = "CONFIRMED"; RelayerStatus["FAILED"] = "FAILED"; })(RelayerStatus || (exports.RelayerStatus = RelayerStatus = {})); -exports.DEFAULT_GAS_LIMIT = 600000; +exports.DEFAULT_GAS_LIMIT = 600_000; function setupServices(relayerWorker) { const { relayerConfig: { enabledNetworks, txRpcUrls }, } = relayerWorker; for (const netId of enabledNetworks) { @@ -61,7 +61,7 @@ function getFeeParams(config, serviceFee, syncManager, { netId, contract, args } tokenDecimals: decimals, relayerFeePercent: serviceFee, isEth, - premiumPercent: 0, + premiumPercent: 5, }; } async function checkWithdrawalFees(relayerWorker, work) { @@ -180,6 +180,14 @@ async function processWithdrawals(relayerWorker) { Math.floor(Date.now() / 1000)); } class RelayerWorker { + relayerConfig; + logger; + syncManager; + cachedRelayerServices; + queue; + queueGas; + queueTimer; + errors; constructor(relayerConfig, syncManager) { this.relayerConfig = relayerConfig; this.syncManager = syncManager; diff --git a/package.json b/package.json index 9e5220c..796e2ff 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "license": "MIT", "dependencies": { "@fastify/cors": "^10.0.1", - "@tornado/core": "git+https://git.tornado.ws/tornadocontrib/tornado-core.git#4f0aaea790ff26bb8902bbf60f101ec240704685", + "@tornado/core": "git+https://git.tornado.ws/tornadocontrib/tornado-core.git#9f4044d11033e99e0a863989864d1578a93de531", "bloomfilter.js": "^1.0.2", "dotenv": "^16.4.5", "fastify": "^5.0.0", @@ -23,8 +23,8 @@ "devDependencies": { "@typechain/ethers-v6": "^0.5.1", "@types/node": "^22.7.5", - "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", + "@typescript-eslint/eslint-plugin": "^8.9.0", + "@typescript-eslint/parser": "^8.9.0", "eslint": "8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.3", diff --git a/src/services/events.ts b/src/services/events.ts index 3b3b1a4..0d0cbd1 100644 --- a/src/services/events.ts +++ b/src/services/events.ts @@ -13,7 +13,6 @@ import { BaseEchoService, CachedRelayers, BatchEventsService, - DEPOSIT, toFixedHex, } from '@tornado/core'; import type { @@ -27,8 +26,8 @@ import type { BatchEventServiceConstructor, BatchEventOnProgress, NetIdType, - MerkleTreeService, } from '@tornado/core'; +import type { MerkleTree } from '@tornado/fixed-merkle-tree'; import type { Logger } from 'winston'; import { saveUserFile, @@ -39,11 +38,11 @@ import { } from './data'; import { TreeCache } from './treeCache'; -export type NodeEventsConstructor = BatchEventServiceConstructor & { +export interface NodeEventsConstructor extends BatchEventServiceConstructor { netId: NetIdType; logger: Logger; getInstanceName: () => string; -}; +} export class NodeEventsService extends BatchEventsService { netId: NetIdType; @@ -59,14 +58,14 @@ export class NodeEventsService extends BatchEventsService { } } -export type NodeTornadoServiceConstructor = BaseTornadoServiceConstructor & { +export interface NodeTornadoServiceConstructor + extends BaseTornadoServiceConstructor { cacheDirectory: string; userDirectory: string; nativeCurrency: string; logger: Logger; - merkleTreeService?: MerkleTreeService; treeCache?: TreeCache; -}; +} export class NodeTornadoService extends BaseTornadoService { cacheDirectory: string; @@ -75,39 +74,24 @@ export class NodeTornadoService extends BaseTornadoService { nativeCurrency: string; logger: Logger; - merkleTreeService?: MerkleTreeService; treeCache?: TreeCache; - constructor({ - netId, - provider, - graphApi, - subgraphName, - Tornado, - type, - amount, - currency, - deployedBlock, - fetchDataOptions, - cacheDirectory, - userDirectory, - nativeCurrency, - logger, - merkleTreeService, - treeCache, - }: NodeTornadoServiceConstructor) { - super({ + constructor(serviceConstructor: NodeTornadoServiceConstructor) { + super(serviceConstructor); + + const { netId, provider, - graphApi, - subgraphName, Tornado, type, amount, currency, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory, + userDirectory, + nativeCurrency, + logger, + treeCache, + } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; @@ -125,7 +109,6 @@ export class NodeTornadoService extends BaseTornadoService { `${type.toLowerCase()}s_${netId}_${currency}_${amount}`, }); - this.merkleTreeService = merkleTreeService; this.treeCache = treeCache; } @@ -156,42 +139,50 @@ export class NodeTornadoService extends BaseTornadoService { }); } + async validateEvents({ + events, + lastBlock, + hasNewEvents, + }: BaseEvents & { + hasNewEvents?: boolean; + }): Promise { + const tree = await super.validateEvents({ + events, + lastBlock, + hasNewEvents, + }); + + if (tree && this.currency === this.nativeCurrency && this.treeCache) { + const merkleTree = tree as unknown as MerkleTree; + + await this.treeCache.createTree( + events as DepositsEvents[], + merkleTree, + ); + + console.log( + `${this.getInstanceName()}: Updated tree cache with root ${toFixedHex(BigInt(merkleTree.root))}\n`, + ); + } + + return tree; + } + async saveEvents({ events, lastBlock, }: BaseEvents) { - const instanceName = this.getInstanceName(); - - if ( - this.getType().toLowerCase() === DEPOSIT && - this.merkleTreeService - ) { - const tree = await this.merkleTreeService.verifyTree( - events as DepositsEvents[], - ); - - if (this.currency === this.nativeCurrency && this.treeCache) { - await this.treeCache.createTree( - events as DepositsEvents[], - tree, - ); - - this.logger.debug( - `${this.getInstanceName()}: Updated tree cache with root ${toFixedHex(BigInt(tree.root))}`, - ); - } - } - await saveUserFile({ - fileName: instanceName + '.json', + fileName: this.getInstanceName() + '.json', userDirectory: this.userDirectory, dataString: JSON.stringify(events, null, 2) + '\n', lastBlock, }); } - async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + async updateEvents() { + const { events, lastBlock, validateResult } = + await super.updateEvents(); await saveLastBlock({ fileName: this.getInstanceName(), @@ -202,15 +193,16 @@ export class NodeTornadoService extends BaseTornadoService { return { events, lastBlock, + validateResult, }; } } -export type NodeEchoServiceConstructor = BaseEchoServiceConstructor & { +export interface NodeEchoServiceConstructor extends BaseEchoServiceConstructor { cacheDirectory: string; userDirectory: string; logger: Logger; -}; +} export class NodeEchoService extends BaseEchoService { cacheDirectory: string; @@ -218,27 +210,17 @@ export class NodeEchoService extends BaseEchoService { logger: Logger; - constructor({ - netId, - provider, - graphApi, - subgraphName, - Echoer, - deployedBlock, - fetchDataOptions, - cacheDirectory, - userDirectory, - logger, - }: NodeEchoServiceConstructor) { - super({ + constructor(serviceConstructor: NodeEchoServiceConstructor) { + super(serviceConstructor); + + const { netId, provider, - graphApi, - subgraphName, Echoer, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory, + userDirectory, + logger, + } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; @@ -293,8 +275,9 @@ export class NodeEchoService extends BaseEchoService { }); } - async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + async updateEvents() { + const { events, lastBlock, validateResult } = + await super.updateEvents(); await saveLastBlock({ fileName: this.getInstanceName(), @@ -305,16 +288,17 @@ export class NodeEchoService extends BaseEchoService { return { events, lastBlock, + validateResult, }; } } -export type NodeEncryptedNotesServiceConstructor = - BaseEncryptedNotesServiceConstructor & { - cacheDirectory: string; - userDirectory: string; - logger: Logger; - }; +export interface NodeEncryptedNotesServiceConstructor + extends BaseEncryptedNotesServiceConstructor { + cacheDirectory: string; + userDirectory: string; + logger: Logger; +} export class NodeEncryptedNotesService extends BaseEncryptedNotesService { cacheDirectory: string; @@ -322,27 +306,17 @@ export class NodeEncryptedNotesService extends BaseEncryptedNotesService { logger: Logger; - constructor({ - netId, - provider, - graphApi, - subgraphName, - Router, - deployedBlock, - fetchDataOptions, - cacheDirectory, - userDirectory, - logger, - }: NodeEncryptedNotesServiceConstructor) { - super({ + constructor(serviceConstructor: NodeEncryptedNotesServiceConstructor) { + super(serviceConstructor); + + const { netId, provider, - graphApi, - subgraphName, Router, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory, + userDirectory, + logger, + } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; @@ -396,8 +370,9 @@ export class NodeEncryptedNotesService extends BaseEncryptedNotesService { }); } - async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + async updateEvents() { + const { events, lastBlock, validateResult } = + await super.updateEvents(); await saveLastBlock({ fileName: this.getInstanceName(), @@ -408,16 +383,17 @@ export class NodeEncryptedNotesService extends BaseEncryptedNotesService { return { events, lastBlock, + validateResult, }; } } -export type NodeGovernanceServiceConstructor = - BaseGovernanceServiceConstructor & { - cacheDirectory: string; - userDirectory: string; - logger: Logger; - }; +export interface NodeGovernanceServiceConstructor + extends BaseGovernanceServiceConstructor { + cacheDirectory: string; + userDirectory: string; + logger: Logger; +} export class NodeGovernanceService extends BaseGovernanceService { cacheDirectory: string; @@ -425,27 +401,17 @@ export class NodeGovernanceService extends BaseGovernanceService { logger: Logger; - constructor({ - netId, - provider, - graphApi, - subgraphName, - Governance, - deployedBlock, - fetchDataOptions, - cacheDirectory, - userDirectory, - logger, - }: NodeGovernanceServiceConstructor) { - super({ + constructor(serviceConstructor: NodeGovernanceServiceConstructor) { + super(serviceConstructor); + + const { netId, provider, - graphApi, - subgraphName, Governance, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory, + userDirectory, + logger, + } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; @@ -499,8 +465,9 @@ export class NodeGovernanceService extends BaseGovernanceService { }); } - async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + async updateEvents() { + const { events, lastBlock, validateResult } = + await super.updateEvents(); await saveLastBlock({ fileName: this.getInstanceName(), @@ -511,46 +478,34 @@ export class NodeGovernanceService extends BaseGovernanceService { return { events, lastBlock, + validateResult, }; } } -export type NodeRegistryServiceConstructor = BaseRegistryServiceConstructor & { +export interface NodeRegistryServiceConstructor + extends BaseRegistryServiceConstructor { cacheDirectory: string; userDirectory: string; logger: Logger; -}; +} export class NodeRegistryService extends BaseRegistryService { cacheDirectory: string; userDirectory: string; logger: Logger; - constructor({ - netId, - provider, - graphApi, - subgraphName, - RelayerRegistry, - Aggregator, - relayerEnsSubdomains, - deployedBlock, - fetchDataOptions, - cacheDirectory, - userDirectory, - logger, - }: NodeRegistryServiceConstructor) { - super({ + constructor(serviceConstructor: NodeRegistryServiceConstructor) { + super(serviceConstructor); + + const { netId, provider, - graphApi, - subgraphName, RelayerRegistry, - Aggregator, - relayerEnsSubdomains, - deployedBlock, - fetchDataOptions, - }); + cacheDirectory, + userDirectory, + logger, + } = serviceConstructor; this.cacheDirectory = cacheDirectory; this.userDirectory = userDirectory; @@ -604,8 +559,9 @@ export class NodeRegistryService extends BaseRegistryService { }); } - async updateEvents() { - const { events, lastBlock } = await super.updateEvents(); + async updateEvents() { + const { events, lastBlock, validateResult } = + await super.updateEvents(); await saveLastBlock({ fileName: this.getInstanceName(), @@ -616,6 +572,7 @@ export class NodeRegistryService extends BaseRegistryService { return { events, lastBlock, + validateResult, }; } diff --git a/src/services/sync.ts b/src/services/sync.ts index 3a385e7..fa3ffad 100644 --- a/src/services/sync.ts +++ b/src/services/sync.ts @@ -26,6 +26,7 @@ import { InstanceEventsStatus, TovarishSyncStatus, EventsStatus, + ReverseRecords__factory, } from '@tornado/core'; import { RelayerConfig } from '../config'; @@ -134,6 +135,7 @@ function setupServices(syncManager: SyncManager) { echoContract, registryContract, aggregatorContract, + reverseRecordsContract, governanceContract, multicallContract, offchainOracleContract, @@ -180,7 +182,11 @@ function setupServices(syncManager: SyncManager) { : undefined, ); - if (governanceContract) { + if ( + governanceContract && + aggregatorContract && + reverseRecordsContract + ) { services.governanceService = new NodeGovernanceService({ netId, provider, @@ -188,6 +194,14 @@ function setupServices(syncManager: SyncManager) { governanceContract, provider, ), + Aggregator: Aggregator__factory.connect( + aggregatorContract, + provider, + ), + ReverseRecords: ReverseRecords__factory.connect( + reverseRecordsContract, + provider, + ), deployedBlock: GOVERNANCE_BLOCK, cacheDirectory, userDirectory, @@ -267,25 +281,22 @@ function setupServices(syncManager: SyncManager) { logger, }; - const merkleTreeService = new MerkleTreeService({ - netId, - amount, - currency, - Tornado, - merkleWorkerPath, - }); - - const treeCache = new TreeCache({ - netId, - amount, - currency, - userDirectory: userTreeDir, - }); - amountService.depositsService = new NodeTornadoService({ ...TornadoServiceConstructor, - merkleTreeService, - treeCache, + merkleTreeService: new MerkleTreeService({ + netId, + amount, + currency, + Tornado, + merkleWorkerPath, + }), + treeCache: new TreeCache({ + netId, + amount, + currency, + userDirectory: userTreeDir, + }), + optionalTree: true, type: 'Deposit', }); diff --git a/src/services/worker.ts b/src/services/worker.ts index bcc42a7..73daa14 100644 --- a/src/services/worker.ts +++ b/src/services/worker.ts @@ -122,7 +122,7 @@ export function getFeeParams( tokenDecimals: decimals, relayerFeePercent: serviceFee, isEth, - premiumPercent: 0, + premiumPercent: 5, }; } diff --git a/tsconfig.json b/tsconfig.json index 4ecdc3c..0e3d5a0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,8 +4,8 @@ "./node_modules/@types", "./src/types" ], - "target": "es2020", - "lib": ["ES2016", "ES2021", "ESNext"], + "target": "es2022", + "lib": ["ES2016", "ES2021", "ES2022", "ESNext"], "module": "commonjs", "rootDir": "./src", "resolveJsonModule": true, diff --git a/yarn.lock b/yarn.lock index fa00fde..c3c1deb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -667,21 +667,20 @@ "@noble/hashes" "~1.4.0" "@scure/base" "~1.1.6" -"@tornado/contracts@^1.0.1": - version "1.0.1" - resolved "https://git.tornado.ws/api/packages/tornado-packages/npm/%40tornado%2Fcontracts/-/1.0.1/contracts-1.0.1.tgz#4ce0bb721c602155f087bc5526afb22b2dd05b31" - integrity sha512-5PHi2y/WybAF4uMjLenOEtqmaJ+sHkGYJJ9bHlOPlzbKooVzqVPpESKg1MEjofSpTLGG8XZAKEsXedyHX7+6qw== +"@tornado/contracts@git+https://git.tornado.ws/tornadocontrib/tornado-contracts.git#ece511f424dc811c3aec149a4bf0e3731c0598a4": + version "1.0.2" + resolved "git+https://git.tornado.ws/tornadocontrib/tornado-contracts.git#ece511f424dc811c3aec149a4bf0e3731c0598a4" dependencies: "@openzeppelin/contracts" "5.0.2" "@openzeppelin/contracts-v3" "npm:@openzeppelin/contracts@3.2.0-rc.0" - ethers "^6.4.0" + ethers "^6.13.4" -"@tornado/core@git+https://git.tornado.ws/tornadocontrib/tornado-core.git#4f0aaea790ff26bb8902bbf60f101ec240704685": +"@tornado/core@git+https://git.tornado.ws/tornadocontrib/tornado-core.git#9f4044d11033e99e0a863989864d1578a93de531": version "1.0.19" - resolved "git+https://git.tornado.ws/tornadocontrib/tornado-core.git#4f0aaea790ff26bb8902bbf60f101ec240704685" + resolved "git+https://git.tornado.ws/tornadocontrib/tornado-core.git#9f4044d11033e99e0a863989864d1578a93de531" dependencies: "@metamask/eth-sig-util" "^7.0.3" - "@tornado/contracts" "^1.0.1" + "@tornado/contracts" "git+https://git.tornado.ws/tornadocontrib/tornado-contracts.git#ece511f424dc811c3aec149a4bf0e3731c0598a4" "@tornado/fixed-merkle-tree" "^0.7.3" "@tornado/snarkjs" "^0.1.20" "@tornado/websnark" "^0.0.4" @@ -689,7 +688,7 @@ bn.js "^5.2.1" circomlibjs "0.1.7" cross-fetch "^4.0.0" - ethers "^6.13.3" + ethers "^6.13.4" ffjavascript "0.2.48" fflate "^0.8.2" idb "^8.0.0" @@ -764,12 +763,7 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433" integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== -"@types/node@18.15.13": - version "18.15.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" - integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== - -"@types/node@^22.7.5": +"@types/node@22.7.5", "@types/node@^22.7.5": version "22.7.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.5.tgz#cfde981727a7ab3611a481510b473ae54442b92b" integrity sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ== @@ -786,62 +780,62 @@ resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c" integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw== -"@typescript-eslint/eslint-plugin@^8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz#9364b756d4d78bcbdf6fd3e9345e6924c68ad371" - integrity sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ== +"@typescript-eslint/eslint-plugin@^8.9.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.11.0.tgz#c3f087d20715fa94310b30666c08b3349e0ab084" + integrity sha512-KhGn2LjW1PJT2A/GfDpiyOfS4a8xHQv2myUagTM5+zsormOmBlYsnQ6pobJ8XxJmh6hnHwa2Mbe3fPrDJoDhbA== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.8.1" - "@typescript-eslint/type-utils" "8.8.1" - "@typescript-eslint/utils" "8.8.1" - "@typescript-eslint/visitor-keys" "8.8.1" + "@typescript-eslint/scope-manager" "8.11.0" + "@typescript-eslint/type-utils" "8.11.0" + "@typescript-eslint/utils" "8.11.0" + "@typescript-eslint/visitor-keys" "8.11.0" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@^8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.8.1.tgz#5952ba2a83bd52024b872f3fdc8ed2d3636073b8" - integrity sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow== +"@typescript-eslint/parser@^8.9.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.11.0.tgz#2ad1481388dc1c937f50b2d138c9ca57cc6c5cce" + integrity sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg== dependencies: - "@typescript-eslint/scope-manager" "8.8.1" - "@typescript-eslint/types" "8.8.1" - "@typescript-eslint/typescript-estree" "8.8.1" - "@typescript-eslint/visitor-keys" "8.8.1" + "@typescript-eslint/scope-manager" "8.11.0" + "@typescript-eslint/types" "8.11.0" + "@typescript-eslint/typescript-estree" "8.11.0" + "@typescript-eslint/visitor-keys" "8.11.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz#b4bea1c0785aaebfe3c4ab059edaea1c4977e7ff" - integrity sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA== +"@typescript-eslint/scope-manager@8.11.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz#9d399ce624118966732824878bc9a83593a30405" + integrity sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ== dependencies: - "@typescript-eslint/types" "8.8.1" - "@typescript-eslint/visitor-keys" "8.8.1" + "@typescript-eslint/types" "8.11.0" + "@typescript-eslint/visitor-keys" "8.11.0" -"@typescript-eslint/type-utils@8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz#31f59ec46e93a02b409fb4d406a368a59fad306e" - integrity sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA== +"@typescript-eslint/type-utils@8.11.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.11.0.tgz#b7f9e6120c1ddee8a1a07615646642ad85fc91b5" + integrity sha512-ItiMfJS6pQU0NIKAaybBKkuVzo6IdnAhPFZA/2Mba/uBjuPQPet/8+zh5GtLHwmuFRShZx+8lhIs7/QeDHflOg== dependencies: - "@typescript-eslint/typescript-estree" "8.8.1" - "@typescript-eslint/utils" "8.8.1" + "@typescript-eslint/typescript-estree" "8.11.0" + "@typescript-eslint/utils" "8.11.0" debug "^4.3.4" ts-api-utils "^1.3.0" -"@typescript-eslint/types@8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.8.1.tgz#ebe85e0fa4a8e32a24a56adadf060103bef13bd1" - integrity sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q== +"@typescript-eslint/types@8.11.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.11.0.tgz#7c766250502097f49bbc2e651132e6bf489e20b8" + integrity sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw== -"@typescript-eslint/typescript-estree@8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz#34649f4e28d32ee49152193bc7dedc0e78e5d1ec" - integrity sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg== +"@typescript-eslint/typescript-estree@8.11.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz#35fe5d3636fc5727c52429393415412e552e222b" + integrity sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg== dependencies: - "@typescript-eslint/types" "8.8.1" - "@typescript-eslint/visitor-keys" "8.8.1" + "@typescript-eslint/types" "8.11.0" + "@typescript-eslint/visitor-keys" "8.11.0" debug "^4.3.4" fast-glob "^3.3.2" is-glob "^4.0.3" @@ -849,22 +843,22 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.8.1.tgz#9e29480fbfa264c26946253daa72181f9f053c9d" - integrity sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w== +"@typescript-eslint/utils@8.11.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.11.0.tgz#4480d1e9f2bb18ea3510c79f870a1aefc118103d" + integrity sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.8.1" - "@typescript-eslint/types" "8.8.1" - "@typescript-eslint/typescript-estree" "8.8.1" + "@typescript-eslint/scope-manager" "8.11.0" + "@typescript-eslint/types" "8.11.0" + "@typescript-eslint/typescript-estree" "8.11.0" -"@typescript-eslint/visitor-keys@8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz#0fb1280f381149fc345dfde29f7542ff4e587fc5" - integrity sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag== +"@typescript-eslint/visitor-keys@8.11.0": + version "8.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz#273de1cbffe63d9f9cd7dfc20b5a5af66310cb92" + integrity sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw== dependencies: - "@typescript-eslint/types" "8.8.1" + "@typescript-eslint/types" "8.11.0" eslint-visitor-keys "^3.4.3" "@ungap/structured-clone@^1.2.0": @@ -1967,17 +1961,17 @@ ethers@^5.5.1: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" -ethers@^6.13.3, ethers@^6.4.0: - version "6.13.3" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.3.tgz#b87afdadb91cc8df5f56b9c59c96e5b206f4a600" - integrity sha512-/DzbZOLVtoO4fKvvQwpEucHAQgIwBGWuRvBdwE/lMXgXvvHHTSkn7XqAQ2b+gjJzZDJjWA9OD05bVceVOsBHbg== +ethers@^6.13.4: + version "6.13.4" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.4.tgz#bd3e1c3dc1e7dc8ce10f9ffb4ee40967a651b53c" + integrity sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA== dependencies: "@adraffy/ens-normalize" "1.10.1" "@noble/curves" "1.2.0" "@noble/hashes" "1.3.2" - "@types/node" "18.15.13" + "@types/node" "22.7.5" aes-js "4.0.0-beta.5" - tslib "2.4.0" + tslib "2.7.0" ws "8.17.1" event-target-shim@^5.0.0: @@ -3956,21 +3950,16 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@2.7.0, tslib@^2.6.2: + version "2.7.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" + integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.6.2: - version "2.7.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" - integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== - tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596"