ponder 0.8.15 → 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 +34 -9
- package/dist/bin/ponder.js.map +1 -1
- package/package.json +1 -1
- package/src/build/plugin.ts +5 -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/src/utils/pglite.ts +9 -1
package/dist/bin/ponder.js
CHANGED
|
@@ -1397,13 +1397,14 @@ export * from "${schemaPath}";
|
|
|
1397
1397
|
export default schema;
|
|
1398
1398
|
`;
|
|
1399
1399
|
var vitePluginPonder = (options) => {
|
|
1400
|
+
const schemaPath = options.schemaFile.replace(/\\/g, "/");
|
|
1400
1401
|
return {
|
|
1401
1402
|
name: "ponder",
|
|
1402
1403
|
load: (id) => {
|
|
1403
1404
|
if (id === "ponder:registry")
|
|
1404
1405
|
return virtualModule();
|
|
1405
1406
|
if (id === "ponder:schema")
|
|
1406
|
-
return schemaModule(
|
|
1407
|
+
return schemaModule(schemaPath);
|
|
1407
1408
|
return null;
|
|
1408
1409
|
}
|
|
1409
1410
|
};
|
|
@@ -3969,7 +3970,11 @@ function createPool(config, logger) {
|
|
|
3969
3970
|
import { mkdirSync as mkdirSync2 } from "node:fs";
|
|
3970
3971
|
import { PGlite } from "@electric-sql/pglite";
|
|
3971
3972
|
function createPglite(options) {
|
|
3972
|
-
|
|
3973
|
+
if (options.dataDir === "memory://") {
|
|
3974
|
+
options.dataDir = void 0;
|
|
3975
|
+
} else {
|
|
3976
|
+
mkdirSync2(options.dataDir, { recursive: true });
|
|
3977
|
+
}
|
|
3973
3978
|
return new PGlite(options);
|
|
3974
3979
|
}
|
|
3975
3980
|
|
|
@@ -7681,9 +7686,9 @@ var buildEvents = ({
|
|
|
7681
7686
|
}),
|
|
7682
7687
|
log: convertLog(log),
|
|
7683
7688
|
block: convertBlock(block),
|
|
7684
|
-
transaction: convertTransaction(
|
|
7689
|
+
transaction: transactionCache.has(log.transactionHash) ? convertTransaction(
|
|
7685
7690
|
transactionCache.get(log.transactionHash)
|
|
7686
|
-
),
|
|
7691
|
+
) : void 0,
|
|
7687
7692
|
transactionReceipt: shouldGetTransactionReceipt(filter) ? convertTransactionReceipt(
|
|
7688
7693
|
transactionReceiptCache.get(log.transactionHash)
|
|
7689
7694
|
) : void 0,
|
|
@@ -8320,7 +8325,8 @@ import { getLogsRetryHelper } from "@ponder/utils";
|
|
|
8320
8325
|
import {
|
|
8321
8326
|
hexToBigInt as hexToBigInt5,
|
|
8322
8327
|
hexToNumber as hexToNumber4,
|
|
8323
|
-
toHex
|
|
8328
|
+
toHex,
|
|
8329
|
+
zeroHash
|
|
8324
8330
|
} from "viem";
|
|
8325
8331
|
var createHistoricalSync = async (args) => {
|
|
8326
8332
|
let isKilled = false;
|
|
@@ -8570,9 +8576,16 @@ var createHistoricalSync = async (args) => {
|
|
|
8570
8576
|
);
|
|
8571
8577
|
}
|
|
8572
8578
|
if (block.transactions.find((t) => t.hash === log.transactionHash) === void 0) {
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
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
|
+
}
|
|
8576
8589
|
}
|
|
8577
8590
|
}
|
|
8578
8591
|
const transactionHashes = new Set(logs.map((l) => l.transactionHash));
|
|
@@ -8826,7 +8839,7 @@ var createHistoricalSync = async (args) => {
|
|
|
8826
8839
|
};
|
|
8827
8840
|
|
|
8828
8841
|
// src/sync-realtime/index.ts
|
|
8829
|
-
import { hexToNumber as hexToNumber6 } from "viem";
|
|
8842
|
+
import { hexToNumber as hexToNumber6, zeroHash as zeroHash2 } from "viem";
|
|
8830
8843
|
|
|
8831
8844
|
// src/sync-realtime/bloom.ts
|
|
8832
8845
|
import { hexToBytes, hexToNumber as hexToNumber5, keccak256 } from "viem";
|
|
@@ -9286,6 +9299,18 @@ var createRealtimeSync = (args) => {
|
|
|
9286
9299
|
`Detected invalid eth_getLogs response. 'log.blockHash' ${log.blockHash} does not match requested block hash ${block.hash}`
|
|
9287
9300
|
);
|
|
9288
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
|
+
}
|
|
9289
9314
|
}
|
|
9290
9315
|
}
|
|
9291
9316
|
if (shouldRequestLogs === false && args.sources.some((s) => s.filter.type === "log")) {
|