From 8c8b74cc94560c5d0aee01f12564bc4c1b4db4e6 Mon Sep 17 00:00:00 2001 From: amateima Date: Wed, 11 Dec 2024 16:30:59 -0600 Subject: [PATCH] fix: strip unnecessary deposit fields --- .../src/utils/BlockchainEventRepository.ts | 14 -------------- .../indexer/src/data-indexing/service/Indexer.ts | 2 -- .../indexer/src/database/SpokePoolRepository.ts | 6 ++++++ 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/indexer-database/src/utils/BlockchainEventRepository.ts b/packages/indexer-database/src/utils/BlockchainEventRepository.ts index 081ecea1..b295f3b7 100644 --- a/packages/indexer-database/src/utils/BlockchainEventRepository.ts +++ b/packages/indexer-database/src/utils/BlockchainEventRepository.ts @@ -72,21 +72,7 @@ export class BlockchainEventRepository { const repository = this.postgres.getRepository(entity); if (!dbEntity) { - this.logger.debug({ - at: "BlockchainEventRepository#saveAndHandleFinalisation", - message: `Found entity ${entity} where ${JSON.stringify(where)}`, - dbEntity, - data, - where, - }); await repository.insert(data); - this.logger.debug({ - at: "BlockchainEventRepository#saveAndHandleFinalisation", - message: `Inserted entity ${entity} where ${JSON.stringify(where)}`, - dbEntity, - data, - where, - }); return { data: (await repository.findOne({ where })) as Entity, result: SaveQueryResultType.Inserted, diff --git a/packages/indexer/src/data-indexing/service/Indexer.ts b/packages/indexer/src/data-indexing/service/Indexer.ts index 4aa05c58..be2fd80b 100644 --- a/packages/indexer/src/data-indexing/service/Indexer.ts +++ b/packages/indexer/src/data-indexing/service/Indexer.ts @@ -69,8 +69,6 @@ export class Indexer { } blockRangeProcessedSuccessfully = true; } catch (error) { - // TODO: remove this after testing - console.error(error); this.logger.error({ at: "Indexer#start", message: "Error processing block range", diff --git a/packages/indexer/src/database/SpokePoolRepository.ts b/packages/indexer/src/database/SpokePoolRepository.ts index cd733f9c..a01777c8 100644 --- a/packages/indexer/src/database/SpokePoolRepository.ts +++ b/packages/indexer/src/database/SpokePoolRepository.ts @@ -40,6 +40,12 @@ export class SpokePoolRepository extends dbUtils.BlockchainEventRepository { lastFinalisedBlock: number, ) { const formattedEvents = v3FundsDepositedEvents.map((event) => { + // delete fields that are not needed for the database table + delete event.speedUpSignature; + delete event.updatedRecipient; + delete event.updatedOutputAmount; + delete event.updatedMessage; + return { ...event, relayHash: across.utils.getRelayHashFromEvent(event),