ponder 0.8.16 → 0.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/ponder.js +27 -7
- package/dist/bin/ponder.js.map +1 -1
- package/package.json +1 -1
- package/src/sync/events.ts +5 -3
- package/src/sync-historical/index.ts +11 -3
- package/src/sync-realtime/index.ts +17 -2
package/dist/bin/ponder.js
CHANGED
|
@@ -7686,9 +7686,9 @@ var buildEvents = ({
|
|
|
7686
7686
|
}),
|
|
7687
7687
|
log: convertLog(log),
|
|
7688
7688
|
block: convertBlock(block),
|
|
7689
|
-
transaction: convertTransaction(
|
|
7689
|
+
transaction: transactionCache.has(log.transactionHash) ? convertTransaction(
|
|
7690
7690
|
transactionCache.get(log.transactionHash)
|
|
7691
|
-
),
|
|
7691
|
+
) : void 0,
|
|
7692
7692
|
transactionReceipt: shouldGetTransactionReceipt(filter) ? convertTransactionReceipt(
|
|
7693
7693
|
transactionReceiptCache.get(log.transactionHash)
|
|
7694
7694
|
) : void 0,
|
|
@@ -8325,7 +8325,8 @@ import { getLogsRetryHelper } from "@ponder/utils";
|
|
|
8325
8325
|
import {
|
|
8326
8326
|
hexToBigInt as hexToBigInt5,
|
|
8327
8327
|
hexToNumber as hexToNumber4,
|
|
8328
|
-
toHex
|
|
8328
|
+
toHex,
|
|
8329
|
+
zeroHash
|
|
8329
8330
|
} from "viem";
|
|
8330
8331
|
var createHistoricalSync = async (args) => {
|
|
8331
8332
|
let isKilled = false;
|
|
@@ -8575,9 +8576,16 @@ var createHistoricalSync = async (args) => {
|
|
|
8575
8576
|
);
|
|
8576
8577
|
}
|
|
8577
8578
|
if (block.transactions.find((t) => t.hash === log.transactionHash) === void 0) {
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8579
|
+
if (log.transactionHash === zeroHash) {
|
|
8580
|
+
args.common.logger.warn({
|
|
8581
|
+
service: "sync",
|
|
8582
|
+
msg: `Detected log with empty transaction hash in block ${block.hash} at log index ${hexToNumber4(log.logIndex)}. This is expected for some networks like ZKsync.`
|
|
8583
|
+
});
|
|
8584
|
+
} else {
|
|
8585
|
+
throw new Error(
|
|
8586
|
+
`Detected inconsistent RPC responses. 'log.transactionHash' ${log.transactionHash} not found in 'block.transactions' ${block.hash}`
|
|
8587
|
+
);
|
|
8588
|
+
}
|
|
8581
8589
|
}
|
|
8582
8590
|
}
|
|
8583
8591
|
const transactionHashes = new Set(logs.map((l) => l.transactionHash));
|
|
@@ -8831,7 +8839,7 @@ var createHistoricalSync = async (args) => {
|
|
|
8831
8839
|
};
|
|
8832
8840
|
|
|
8833
8841
|
// src/sync-realtime/index.ts
|
|
8834
|
-
import { hexToNumber as hexToNumber6 } from "viem";
|
|
8842
|
+
import { hexToNumber as hexToNumber6, zeroHash as zeroHash2 } from "viem";
|
|
8835
8843
|
|
|
8836
8844
|
// src/sync-realtime/bloom.ts
|
|
8837
8845
|
import { hexToBytes, hexToNumber as hexToNumber5, keccak256 } from "viem";
|
|
@@ -9291,6 +9299,18 @@ var createRealtimeSync = (args) => {
|
|
|
9291
9299
|
`Detected invalid eth_getLogs response. 'log.blockHash' ${log.blockHash} does not match requested block hash ${block.hash}`
|
|
9292
9300
|
);
|
|
9293
9301
|
}
|
|
9302
|
+
if (block.transactions.find((t) => t.hash === log.transactionHash) === void 0) {
|
|
9303
|
+
if (log.transactionHash === zeroHash2) {
|
|
9304
|
+
args.common.logger.warn({
|
|
9305
|
+
service: "sync",
|
|
9306
|
+
msg: `Detected log with empty transaction hash in block ${block.hash} at log index ${hexToNumber6(log.logIndex)}. This is expected for some networks like ZKsync.`
|
|
9307
|
+
});
|
|
9308
|
+
} else {
|
|
9309
|
+
throw new Error(
|
|
9310
|
+
`Detected inconsistent RPC responses. 'log.transactionHash' ${log.transactionHash} not found in 'block.transactions' ${block.hash}`
|
|
9311
|
+
);
|
|
9312
|
+
}
|
|
9313
|
+
}
|
|
9294
9314
|
}
|
|
9295
9315
|
}
|
|
9296
9316
|
if (shouldRequestLogs === false && args.sources.some((s) => s.filter.type === "log")) {
|