ponder 0.8.10 → 0.8.11

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.
@@ -8394,6 +8394,18 @@ var createHistoricalSync = async (args) => {
8394
8394
  )
8395
8395
  )
8396
8396
  ).then((logs2) => logs2.flat());
8397
+ const logIds = /* @__PURE__ */ new Set();
8398
+ for (const log of logs) {
8399
+ const id = `${log.blockHash}-${log.logIndex}`;
8400
+ if (logIds.has(id)) {
8401
+ args.common.logger.warn({
8402
+ service: "sync",
8403
+ msg: `Detected invalid eth_getLogs response. Duplicate log for block ${log.blockHash} with index ${log.logIndex}.`
8404
+ });
8405
+ } else {
8406
+ logIds.add(id);
8407
+ }
8408
+ }
8397
8409
  if (getLogsRequestMetadata.has(filter) && getLogsRequestMetadata.get(filter).confirmedRange === void 0) {
8398
8410
  getLogsRequestMetadata.get(filter).estimatedRange = Math.round(
8399
8411
  getLogsRequestMetadata.get(filter).estimatedRange * 1.05
@@ -9476,7 +9488,15 @@ var createRequestQueue = ({
9476
9488
  for (let i = 0; i <= RETRY_COUNT2; i++) {
9477
9489
  try {
9478
9490
  const stopClock = startClock();
9491
+ common.logger.trace({
9492
+ service: "rpc",
9493
+ msg: `Sent ${request.method} request (params=${JSON.stringify(request.params)})`
9494
+ });
9479
9495
  const response = await network.transport.request(request);
9496
+ common.logger.trace({
9497
+ service: "rpc",
9498
+ msg: `Received ${request.method} response (duration=${stopClock()}, params=${JSON.stringify(request.params)})`
9499
+ });
9480
9500
  common.metrics.ponder_rpc_request_duration.observe(
9481
9501
  { method: request.method, network: network.name },
9482
9502
  stopClock()
@@ -9494,23 +9514,23 @@ var createRequestQueue = ({
9494
9514
  }
9495
9515
  if (shouldRetry(error) === false) {
9496
9516
  common.logger.warn({
9497
- service: "sync",
9498
- msg: `Failed '${request.method}' RPC request`
9517
+ service: "rpc",
9518
+ msg: `Failed ${request.method} request`
9499
9519
  });
9500
9520
  throw error;
9501
9521
  }
9502
9522
  if (i === RETRY_COUNT2) {
9503
9523
  common.logger.warn({
9504
- service: "sync",
9505
- msg: `Failed '${request.method}' RPC request after ${i + 1} attempts`,
9524
+ service: "rpc",
9525
+ msg: `Failed ${request.method} request after ${i + 1} attempts`,
9506
9526
  error
9507
9527
  });
9508
9528
  throw error;
9509
9529
  }
9510
9530
  const duration = BASE_DURATION2 * 2 ** i;
9511
9531
  common.logger.debug({
9512
- service: "sync",
9513
- msg: `Failed '${request.method}' RPC request, retrying after ${duration} milliseconds`,
9532
+ service: "rpc",
9533
+ msg: `Failed ${request.method} request, retrying after ${duration} milliseconds`,
9514
9534
  error
9515
9535
  });
9516
9536
  await wait(duration);