@aztec-labs/archiver 6.0.0-rc.2 → 6.0.0-rc.4

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.
Files changed (62) hide show
  1. package/dest/archiver.d.ts +11 -2
  2. package/dest/archiver.d.ts.map +1 -1
  3. package/dest/archiver.js +94 -2
  4. package/dest/config.js +1 -1
  5. package/dest/errors.d.ts +12 -1
  6. package/dest/errors.d.ts.map +1 -1
  7. package/dest/errors.js +12 -0
  8. package/dest/l1/bin/retrieve-calldata.js +7 -5
  9. package/dest/l1/calldata_retriever.d.ts +5 -2
  10. package/dest/l1/calldata_retriever.d.ts.map +1 -1
  11. package/dest/l1/calldata_retriever.js +8 -3
  12. package/dest/l1/data_retrieval.d.ts +2 -1
  13. package/dest/l1/data_retrieval.d.ts.map +1 -1
  14. package/dest/l1/data_retrieval.js +14 -9
  15. package/dest/l1/validate_trace.d.ts +3 -1
  16. package/dest/l1/validate_trace.d.ts.map +1 -1
  17. package/dest/l1/validate_trace.js +8 -3
  18. package/dest/modules/checkpoint_ingestor.d.ts +71 -0
  19. package/dest/modules/checkpoint_ingestor.d.ts.map +1 -0
  20. package/dest/modules/checkpoint_ingestor.js +516 -0
  21. package/dest/modules/data_store_updater.d.ts +6 -11
  22. package/dest/modules/data_store_updater.d.ts.map +1 -1
  23. package/dest/modules/data_store_updater.js +4 -3
  24. package/dest/modules/instrumentation.d.ts +8 -4
  25. package/dest/modules/instrumentation.d.ts.map +1 -1
  26. package/dest/modules/instrumentation.js +8 -2
  27. package/dest/modules/l1_synchronizer.d.ts +3 -7
  28. package/dest/modules/l1_synchronizer.d.ts.map +1 -1
  29. package/dest/modules/l1_synchronizer.js +84 -420
  30. package/dest/modules/pending_chain_validation_tracker.d.ts +21 -0
  31. package/dest/modules/pending_chain_validation_tracker.d.ts.map +1 -0
  32. package/dest/modules/pending_chain_validation_tracker.js +32 -0
  33. package/dest/modules/validation.d.ts +2 -2
  34. package/dest/modules/validation.d.ts.map +1 -1
  35. package/dest/modules/validation.js +17 -11
  36. package/dest/store/block_store.d.ts +1 -1
  37. package/dest/store/block_store.d.ts.map +1 -1
  38. package/dest/store/block_store.js +8 -2
  39. package/dest/store/log_store_codec.d.ts +2 -1
  40. package/dest/store/log_store_codec.d.ts.map +1 -1
  41. package/dest/store/log_store_codec.js +1 -0
  42. package/dest/test/fake_l1_state.d.ts +21 -1
  43. package/dest/test/fake_l1_state.d.ts.map +1 -1
  44. package/dest/test/fake_l1_state.js +82 -30
  45. package/package.json +15 -15
  46. package/src/archiver.ts +112 -3
  47. package/src/config.ts +1 -1
  48. package/src/errors.ts +21 -0
  49. package/src/l1/README.md +5 -0
  50. package/src/l1/bin/retrieve-calldata.ts +5 -3
  51. package/src/l1/calldata_retriever.ts +8 -3
  52. package/src/l1/data_retrieval.ts +13 -11
  53. package/src/l1/validate_trace.ts +11 -2
  54. package/src/modules/checkpoint_ingestor.ts +742 -0
  55. package/src/modules/data_store_updater.ts +7 -13
  56. package/src/modules/instrumentation.ts +17 -3
  57. package/src/modules/l1_synchronizer.ts +116 -563
  58. package/src/modules/pending_chain_validation_tracker.ts +43 -0
  59. package/src/modules/validation.ts +13 -9
  60. package/src/store/block_store.ts +6 -0
  61. package/src/store/log_store_codec.ts +1 -0
  62. package/src/test/fake_l1_state.ts +94 -31
@@ -52,6 +52,8 @@ export interface TraceAvailability {
52
52
  debugTraceOld: boolean;
53
53
  /** Whether trace_transaction works for old blocks (512 blocks ago) */
54
54
  traceTransactionOld: boolean;
55
+ /** Whether no recent block had a transaction to probe with, so availability could not be determined */
56
+ noTxToProbe: boolean;
55
57
  }
56
58
 
57
59
  /**
@@ -71,6 +73,7 @@ export async function validateTraceAvailability(
71
73
  traceTransactionRecent: false,
72
74
  debugTraceOld: false,
73
75
  traceTransactionOld: false,
76
+ noTxToProbe: false,
74
77
  };
75
78
 
76
79
  try {
@@ -86,6 +89,7 @@ export async function validateTraceAvailability(
86
89
 
87
90
  if (!hasTxs(latestBlock)) {
88
91
  logger.warn('No blocks with transactions found from latest back to genesis, cannot validate trace availability');
92
+ result.noTxToProbe = true;
89
93
  return result;
90
94
  }
91
95
 
@@ -213,16 +217,21 @@ export async function validateAndLogTraceAvailability(
213
217
  logger.warn(
214
218
  `Ethereum client only supports trace methods for recent blocks (${methods.join(', ')}). Historical transaction traces may not be available.`,
215
219
  );
220
+ } else if (availability.noTxToProbe) {
221
+ // An idle dev or test chain can have no recent transaction to trace, which says nothing about the endpoint
222
+ logger.warn('Starting without confirming that the Ethereum debug client supports trace methods');
216
223
  } else {
217
224
  // Error case: no support at all
218
225
  const errorMessage =
219
- 'Ethereum debug client does not support debug_traceTransaction or trace_transaction methods. Transaction tracing will not be available. This may impact archiver syncing.';
226
+ 'Ethereum debug client does not support debug_traceTransaction or trace_transaction methods. ' +
227
+ 'The archiver needs a trace to read checkpoints published through contracts it does not recognize, ' +
228
+ 'and stops syncing at the first one it cannot read. Point ETHEREUM_DEBUG_HOSTS at a trace-capable endpoint.';
220
229
 
221
230
  if (ethereumAllowNoDebugHosts) {
222
231
  logger.warn(`${errorMessage} Continuing because ETHEREUM_ALLOW_NO_DEBUG_HOSTS is set to true.`);
223
232
  } else {
224
233
  logger.error(errorMessage);
225
- throw new Error(`${errorMessage} Set ETHEREUM_ALLOW_NO_DEBUG_HOSTS=true to bypass this check.`);
234
+ throw new Error(`${errorMessage} Set ETHEREUM_ALLOW_NO_DEBUG_HOSTS=true to start anyway.`);
226
235
  }
227
236
  }
228
237
  }