From 7aa7a54d9c64dba7a8a7ed6d07753d8bd3ce1d6f Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 11 Mar 2026 08:59:03 -0700 Subject: [PATCH] =?UTF-8?q?fix(mining-blockchain-service):=20=E5=8F=8C?= =?UTF-8?q?=E4=BF=9D=E9=99=A9=E8=BF=87=E6=BB=A4=202026-03-10=20=E5=89=8D?= =?UTF-8?q?=E7=9A=84=20AdoptionFusdtInjectionRequested=20=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 防止 outbox connector 宕机期间积压的历史消息在恢复后触发意外的 fUSDT 注入。 只处理 created_at >= 2026-03-10T00:00:00+08:00 的事件,早于截止日期的事件直接丢弃并记录警告日志。 Co-Authored-By: Claude Sonnet 4.6 --- .../kafka/adoption-injection-consumer.service.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/services/mining-blockchain-service/src/infrastructure/kafka/adoption-injection-consumer.service.ts b/backend/services/mining-blockchain-service/src/infrastructure/kafka/adoption-injection-consumer.service.ts index ccb8d4fa..0c83c68a 100644 --- a/backend/services/mining-blockchain-service/src/infrastructure/kafka/adoption-injection-consumer.service.ts +++ b/backend/services/mining-blockchain-service/src/infrastructure/kafka/adoption-injection-consumer.service.ts @@ -139,6 +139,16 @@ export class AdoptionInjectionConsumerService implements OnModuleInit, OnModuleD return; } + // 双保险:丢弃 2026-03-10 前的事件,防止历史积压消息触发意外注入 + const CUTOFF_DATE = new Date('2026-03-10T00:00:00+08:00'); + const eventCreatedAt = parsed.created_at ? new Date(parsed.created_at) : null; + if (!eventCreatedAt || eventCreatedAt < CUTOFF_DATE) { + this.logger.warn( + `[SKIP] AdoptionFusdtInjectionRequested event discarded: created_at=${parsed.created_at} is before cutoff ${CUTOFF_DATE.toISOString()}`, + ); + return; + } + this.logger.log(`[RECEIVE] AdoptionFusdtInjectionRequested event received`); this.logger.log(`[RECEIVE] offset=${message.offset}, partition=${partition}`);