ponder 0.8.22 → 0.8.24
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 +30 -11
- package/dist/bin/ponder.js.map +1 -1
- package/package.json +1 -1
- package/src/indexing/service.ts +4 -1
- package/src/sync/events.ts +7 -5
- package/src/sync/index.ts +1 -1
- package/src/sync-historical/index.ts +15 -5
- package/src/sync-realtime/index.ts +14 -6
- package/src/sync-store/index.ts +2 -1
package/dist/bin/ponder.js
CHANGED
|
@@ -6102,6 +6102,8 @@ var processSetupEvents = async (indexingService, {
|
|
|
6102
6102
|
const source = sources.find(
|
|
6103
6103
|
(s) => s.type === "contract" && s.name === contractName && s.filter.chainId === network.chainId
|
|
6104
6104
|
);
|
|
6105
|
+
if (source === void 0)
|
|
6106
|
+
continue;
|
|
6105
6107
|
if (indexingService.isKilled)
|
|
6106
6108
|
return { status: "killed" };
|
|
6107
6109
|
indexingService.eventCount[eventName]++;
|
|
@@ -7295,7 +7297,7 @@ var createSyncStore = ({
|
|
|
7295
7297
|
const hasLog = row.log_id !== null;
|
|
7296
7298
|
const hasTransaction = row.tx_hash !== null;
|
|
7297
7299
|
const hasTrace = row.trace_id !== null;
|
|
7298
|
-
const hasTransactionReceipt = shouldGetTransactionReceipt(filter);
|
|
7300
|
+
const hasTransactionReceipt = shouldGetTransactionReceipt(filter) && row.txr_from !== null;
|
|
7299
7301
|
return {
|
|
7300
7302
|
chainId: filter.chainId,
|
|
7301
7303
|
sourceIndex: Number(row.event_filterIndex),
|
|
@@ -7738,7 +7740,7 @@ var buildEvents = ({
|
|
|
7738
7740
|
transaction: transactionCache.has(log.transactionHash) ? convertTransaction(
|
|
7739
7741
|
transactionCache.get(log.transactionHash)
|
|
7740
7742
|
) : void 0,
|
|
7741
|
-
transactionReceipt: shouldGetTransactionReceipt(filter) ? convertTransactionReceipt(
|
|
7743
|
+
transactionReceipt: transactionReceiptCache.has(log.transactionHash) && shouldGetTransactionReceipt(filter) ? convertTransactionReceipt(
|
|
7742
7744
|
transactionReceiptCache.get(log.transactionHash)
|
|
7743
7745
|
) : void 0,
|
|
7744
7746
|
trace: void 0
|
|
@@ -8672,9 +8674,19 @@ var createHistoricalSync = async (args) => {
|
|
|
8672
8674
|
if (shouldGetTransactionReceipt(filter)) {
|
|
8673
8675
|
const transactionReceipts = await Promise.all(
|
|
8674
8676
|
Array.from(requiredBlocks).map((blockHash) => {
|
|
8675
|
-
const blockTransactionHashes = new Set(
|
|
8676
|
-
|
|
8677
|
-
|
|
8677
|
+
const blockTransactionHashes = /* @__PURE__ */ new Set();
|
|
8678
|
+
for (const log of logs) {
|
|
8679
|
+
if (log.blockHash === blockHash) {
|
|
8680
|
+
if (log.transactionHash === zeroHash) {
|
|
8681
|
+
args.common.logger.warn({
|
|
8682
|
+
service: "sync",
|
|
8683
|
+
msg: `Detected log with empty transaction hash in block ${log.blockHash} at log index ${hexToNumber4(log.logIndex)}. This is expected for some networks like ZKsync.`
|
|
8684
|
+
});
|
|
8685
|
+
} else {
|
|
8686
|
+
blockTransactionHashes.add(log.transactionHash);
|
|
8687
|
+
}
|
|
8688
|
+
}
|
|
8689
|
+
}
|
|
8678
8690
|
return syncTransactionReceipts(blockHash, blockTransactionHashes);
|
|
8679
8691
|
})
|
|
8680
8692
|
).then((receipts) => receipts.flat());
|
|
@@ -9345,7 +9357,7 @@ var createRealtimeSync = (args) => {
|
|
|
9345
9357
|
for (const hash of Array.from(transactionHashes)) {
|
|
9346
9358
|
if (blockReceiptsTransactionHashes.has(hash) === false) {
|
|
9347
9359
|
throw new Error(
|
|
9348
|
-
`Detected inconsistent RPC responses.
|
|
9360
|
+
`Detected inconsistent RPC responses. 'transaction.hash' ${hash} not found in eth_getBlockReceipts response for block '${blockHash}'`
|
|
9349
9361
|
);
|
|
9350
9362
|
}
|
|
9351
9363
|
}
|
|
@@ -9428,11 +9440,18 @@ var createRealtimeSync = (args) => {
|
|
|
9428
9440
|
let isMatched = false;
|
|
9429
9441
|
for (const filter of logFilters) {
|
|
9430
9442
|
if (isLogFilterMatched({ filter, block, log })) {
|
|
9431
|
-
requiredTransactions.add(log.transactionHash);
|
|
9432
9443
|
isMatched = true;
|
|
9433
|
-
if (
|
|
9434
|
-
|
|
9435
|
-
|
|
9444
|
+
if (log.transactionHash === zeroHash2) {
|
|
9445
|
+
args.common.logger.warn({
|
|
9446
|
+
service: "sync",
|
|
9447
|
+
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.`
|
|
9448
|
+
});
|
|
9449
|
+
} else {
|
|
9450
|
+
requiredTransactions.add(log.transactionHash);
|
|
9451
|
+
if (shouldGetTransactionReceipt(filter)) {
|
|
9452
|
+
requiredTransactionReceipts.add(log.transactionHash);
|
|
9453
|
+
break;
|
|
9454
|
+
}
|
|
9436
9455
|
}
|
|
9437
9456
|
}
|
|
9438
9457
|
}
|
|
@@ -10217,7 +10236,6 @@ var createSync = async (args) => {
|
|
|
10217
10236
|
to: to < estimatedTo ? to : estimatedTo,
|
|
10218
10237
|
limit: getEventsMaxBatchSize
|
|
10219
10238
|
});
|
|
10220
|
-
consecutiveErrors = 0;
|
|
10221
10239
|
args.common.logger.debug({
|
|
10222
10240
|
service: "sync",
|
|
10223
10241
|
msg: `Fetched ${events.length} events from the database for a ${formatEta(estimateSeconds * 1e3)} range from ${decodeCheckpoint(from).blockTimestamp}`
|
|
@@ -10235,6 +10253,7 @@ var createSync = async (args) => {
|
|
|
10235
10253
|
prev: estimateSeconds,
|
|
10236
10254
|
maxIncrease: 1.08
|
|
10237
10255
|
});
|
|
10256
|
+
consecutiveErrors = 0;
|
|
10238
10257
|
yield { events, checkpoint: to };
|
|
10239
10258
|
from = cursor;
|
|
10240
10259
|
} catch (error) {
|