Skip to content

Commit a8a64bd

Browse files
eabdelmoneimclaude
andcommitted
fix: validate backfill hash format before use
Add isHex validation to prevent unexpected behavior if malformed data exists in the backfill table. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 53d5532 commit a8a64bd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/server/routes/transaction/blockchain/get-logs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
eth_getTransactionReceipt,
99
getContract,
1010
getRpcClient,
11+
isHex,
1112
parseEventLogs,
1213
prepareEvent,
1314
} from "thirdweb";
@@ -167,7 +168,7 @@ export async function getTransactionLogs(fastify: FastifyInstance) {
167168
// Fallback to backfill table if enabled and not found
168169
if (!hash && env.ENABLE_TX_BACKFILL_FALLBACK) {
169170
const backfillHash = await TransactionDB.getBackfillHash(queueId);
170-
if (backfillHash) {
171+
if (backfillHash && isHex(backfillHash)) {
171172
hash = backfillHash as Hex;
172173
}
173174
}

0 commit comments

Comments
 (0)