fix(mining-blockchain-service): 双保险过滤 2026-03-10 前的 AdoptionFusdtInjectionRequested 事件

防止 outbox connector 宕机期间积压的历史消息在恢复后触发意外的 fUSDT 注入。
只处理 created_at >= 2026-03-10T00:00:00+08:00 的事件,早于截止日期的事件直接丢弃并记录警告日志。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-11 08:59:03 -07:00
parent e4a2690130
commit 7aa7a54d9c
1 changed files with 10 additions and 0 deletions

View File

@ -139,6 +139,16 @@ export class AdoptionInjectionConsumerService implements OnModuleInit, OnModuleD
return; 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] AdoptionFusdtInjectionRequested event received`);
this.logger.log(`[RECEIVE] offset=${message.offset}, partition=${partition}`); this.logger.log(`[RECEIVE] offset=${message.offset}, partition=${partition}`);