@aztec/prover-node 0.0.1-commit.d3ec352c → 0.0.1-commit.d6f2b3f94

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 (47) hide show
  1. package/dest/actions/download-epoch-proving-job.d.ts +1 -1
  2. package/dest/actions/rerun-epoch-proving-job.d.ts +3 -2
  3. package/dest/actions/rerun-epoch-proving-job.d.ts.map +1 -1
  4. package/dest/actions/rerun-epoch-proving-job.js +5 -3
  5. package/dest/config.d.ts +5 -4
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +4 -3
  8. package/dest/factory.d.ts +5 -4
  9. package/dest/factory.d.ts.map +1 -1
  10. package/dest/factory.js +28 -19
  11. package/dest/index.d.ts +2 -1
  12. package/dest/index.d.ts.map +1 -1
  13. package/dest/index.js +1 -0
  14. package/dest/job/epoch-proving-job-data.d.ts +2 -2
  15. package/dest/job/epoch-proving-job-data.d.ts.map +1 -1
  16. package/dest/job/epoch-proving-job-data.js +1 -1
  17. package/dest/job/epoch-proving-job.d.ts +3 -2
  18. package/dest/job/epoch-proving-job.d.ts.map +1 -1
  19. package/dest/job/epoch-proving-job.js +416 -29
  20. package/dest/metrics.d.ts +2 -2
  21. package/dest/metrics.d.ts.map +1 -1
  22. package/dest/metrics.js +26 -100
  23. package/dest/monitors/epoch-monitor.d.ts +1 -1
  24. package/dest/monitors/epoch-monitor.d.ts.map +1 -1
  25. package/dest/monitors/epoch-monitor.js +1 -10
  26. package/dest/prover-node-publisher.d.ts +9 -7
  27. package/dest/prover-node-publisher.d.ts.map +1 -1
  28. package/dest/prover-node-publisher.js +25 -20
  29. package/dest/prover-node.d.ts +3 -3
  30. package/dest/prover-node.d.ts.map +1 -1
  31. package/dest/prover-node.js +402 -24
  32. package/dest/prover-publisher-factory.d.ts +7 -3
  33. package/dest/prover-publisher-factory.d.ts.map +1 -1
  34. package/dest/prover-publisher-factory.js +4 -2
  35. package/package.json +23 -23
  36. package/src/actions/rerun-epoch-proving-job.ts +5 -3
  37. package/src/bin/run-failed-epoch.ts +1 -1
  38. package/src/config.ts +6 -4
  39. package/src/factory.ts +36 -22
  40. package/src/index.ts +1 -0
  41. package/src/job/epoch-proving-job-data.ts +1 -1
  42. package/src/job/epoch-proving-job.ts +45 -24
  43. package/src/metrics.ts +21 -84
  44. package/src/monitors/epoch-monitor.ts +1 -8
  45. package/src/prover-node-publisher.ts +33 -25
  46. package/src/prover-node.ts +7 -7
  47. package/src/prover-publisher-factory.ts +14 -6
@@ -1,9 +1,9 @@
1
1
  import type { Archiver } from '@aztec/archiver';
2
- import type { RollupContract } from '@aztec/ethereum';
2
+ import type { RollupContract } from '@aztec/ethereum/contracts';
3
3
  import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
4
4
  import { assertRequired, compact, pick, sum } from '@aztec/foundation/collection';
5
+ import type { Fr } from '@aztec/foundation/curves/bn254';
5
6
  import { memoize } from '@aztec/foundation/decorators';
6
- import type { Fr } from '@aztec/foundation/fields';
7
7
  import { createLogger } from '@aztec/foundation/log';
8
8
  import { DateProvider } from '@aztec/foundation/timer';
9
9
  import type { DataStoreConfig } from '@aztec/kv-store/config';
@@ -288,6 +288,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
288
288
  this.contractDataSource,
289
289
  this.dateProvider,
290
290
  this.telemetryClient,
291
+ this.log.getBindings(),
291
292
  );
292
293
 
293
294
  // Set deadline for this job to run. It will abort if it takes too long.
@@ -311,7 +312,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
311
312
  const l1ToL2Messages = await this.gatherMessages(epochNumber, checkpoints);
312
313
  const [firstBlock] = checkpoints[0].blocks;
313
314
  const previousBlockHeader = await this.gatherPreviousBlockHeader(epochNumber, firstBlock.number - 1);
314
- const [lastPublishedCheckpoint] = await this.l2BlockSource.getPublishedCheckpoints(checkpoints.at(-1)!.number, 1);
315
+ const [lastPublishedCheckpoint] = await this.l2BlockSource.getCheckpoints(checkpoints.at(-1)!.number, 1);
315
316
  const attestations = lastPublishedCheckpoint?.attestations ?? [];
316
317
 
317
318
  return { checkpoints, txs, l1ToL2Messages, epochNumber, previousBlockHeader, attestations };
@@ -342,9 +343,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
342
343
  }
343
344
 
344
345
  private async gatherMessages(epochNumber: EpochNumber, checkpoints: Checkpoint[]) {
345
- const messages = await Promise.all(
346
- checkpoints.map(c => this.l1ToL2MessageSource.getL1ToL2MessagesForCheckpoint(c.number)),
347
- );
346
+ const messages = await Promise.all(checkpoints.map(c => this.l1ToL2MessageSource.getL1ToL2Messages(c.number)));
348
347
  const messageCount = sum(messages.map(m => m.length));
349
348
  this.log.verbose(`Gathered all ${messageCount} messages for epoch ${epochNumber}`, { epochNumber });
350
349
  const messagesByCheckpoint: Record<CheckpointNumber, Fr[]> = {};
@@ -386,6 +385,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
386
385
  this.jobMetrics,
387
386
  deadline,
388
387
  { parallelBlockLimit, skipSubmitProof: proverNodeDisableProofPublish, ...opts },
388
+ this.log.getBindings(),
389
389
  );
390
390
  }
391
391
 
@@ -397,7 +397,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
397
397
  private validateConfig() {
398
398
  if (
399
399
  this.config.proverNodeFailedEpochStore &&
400
- (!this.config.dataDirectory || !this.config.l1ChainId || !this.config.rollupVersion)
400
+ (!this.config.dataDirectory || !this.config.l1ChainId || this.config.rollupVersion === undefined)
401
401
  ) {
402
402
  this.log.warn(
403
403
  `Invalid prover-node config (missing dataDirectory, l1ChainId, or rollupVersion)`,
@@ -1,4 +1,7 @@
1
- import type { L1TxUtils, PublisherManager, RollupContract } from '@aztec/ethereum';
1
+ import type { RollupContract } from '@aztec/ethereum/contracts';
2
+ import type { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
3
+ import type { PublisherManager } from '@aztec/ethereum/publisher-manager';
4
+ import type { LoggerBindings } from '@aztec/foundation/log';
2
5
  import type { PublisherConfig, TxSenderConfig } from '@aztec/sequencer-client';
3
6
  import type { TelemetryClient } from '@aztec/telemetry-client';
4
7
 
@@ -12,6 +15,7 @@ export class ProverPublisherFactory {
12
15
  publisherManager: PublisherManager<L1TxUtils>;
13
16
  telemetry?: TelemetryClient;
14
17
  },
18
+ private bindings?: LoggerBindings,
15
19
  ) {}
16
20
 
17
21
  public async start() {
@@ -28,10 +32,14 @@ export class ProverPublisherFactory {
28
32
  */
29
33
  public async create(): Promise<ProverNodePublisher> {
30
34
  const l1Publisher = await this.deps.publisherManager.getAvailablePublisher();
31
- return new ProverNodePublisher(this.config, {
32
- rollupContract: this.deps.rollupContract,
33
- l1TxUtils: l1Publisher,
34
- telemetry: this.deps.telemetry,
35
- });
35
+ return new ProverNodePublisher(
36
+ this.config,
37
+ {
38
+ rollupContract: this.deps.rollupContract,
39
+ l1TxUtils: l1Publisher,
40
+ telemetry: this.deps.telemetry,
41
+ },
42
+ this.bindings,
43
+ );
36
44
  }
37
45
  }