ponder 0.8.27-next.1 → 0.8.28

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.
@@ -1448,9 +1448,8 @@ function buildPre({
1448
1448
  msg: `Using Postgres database '${getDatabaseName(connectionString)}' (${source})`
1449
1449
  });
1450
1450
  const poolConfig = {
1451
- connectionString,
1452
1451
  max: config.database.poolConfig?.max ?? 30,
1453
- ssl: config.database.poolConfig?.ssl ?? false
1452
+ connectionString
1454
1453
  };
1455
1454
  databaseConfig = { kind: "postgres", poolConfig };
1456
1455
  } else {
@@ -1475,7 +1474,7 @@ function buildPre({
1475
1474
  level: "info",
1476
1475
  msg: `Using Postgres database ${getDatabaseName(connectionString)} (${source})`
1477
1476
  });
1478
- const poolConfig = { connectionString, max: 30 };
1477
+ const poolConfig = { max: 30, connectionString };
1479
1478
  databaseConfig = { kind: "postgres", poolConfig };
1480
1479
  } else {
1481
1480
  logs.push({
@@ -8733,7 +8732,7 @@ var createHistoricalSync = async (args) => {
8733
8732
  if (logIds.has(id)) {
8734
8733
  args.common.logger.warn({
8735
8734
  service: "sync",
8736
- msg: `Detected invalid eth_getLogs response. Duplicate log for block ${log.blockHash} with index ${log.logIndex}.`
8735
+ msg: `Detected invalid eth_getLogs response. Duplicate log index ${log.logIndex} for block ${log.blockHash}.`
8737
8736
  });
8738
8737
  } else {
8739
8738
  logIds.add(id);
@@ -9639,12 +9638,22 @@ var createRealtimeSync = (args) => {
9639
9638
  "Detected invalid eth_getLogs response. `block.logsBloom` is not empty but zero logs were returned."
9640
9639
  );
9641
9640
  }
9641
+ const logIds = /* @__PURE__ */ new Set();
9642
9642
  for (const log of logs) {
9643
9643
  if (log.blockHash !== block.hash) {
9644
9644
  throw new Error(
9645
9645
  `Detected invalid eth_getLogs response. 'log.blockHash' ${log.blockHash} does not match requested block hash ${block.hash}`
9646
9646
  );
9647
9647
  }
9648
+ const id = `${log.blockHash}-${log.logIndex}`;
9649
+ if (logIds.has(id)) {
9650
+ args.common.logger.warn({
9651
+ service: "sync",
9652
+ msg: `Detected invalid eth_getLogs response. Duplicate log index ${log.logIndex} for block ${log.blockHash}.`
9653
+ });
9654
+ } else {
9655
+ logIds.add(id);
9656
+ }
9648
9657
  if (block.transactions.find((t) => t.hash === log.transactionHash) === void 0) {
9649
9658
  if (log.transactionHash === zeroHash2) {
9650
9659
  args.common.logger.warn({