@aztec/prover-node 3.0.3 → 3.9.9-nightly.20260312

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 (44) 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/bin/run-failed-epoch.js +5 -2
  6. package/dest/config.d.ts +4 -7
  7. package/dest/config.d.ts.map +1 -1
  8. package/dest/config.js +15 -18
  9. package/dest/factory.d.ts +19 -15
  10. package/dest/factory.d.ts.map +1 -1
  11. package/dest/factory.js +23 -60
  12. package/dest/index.d.ts +2 -1
  13. package/dest/index.d.ts.map +1 -1
  14. package/dest/index.js +1 -0
  15. package/dest/job/epoch-proving-job.d.ts +3 -2
  16. package/dest/job/epoch-proving-job.d.ts.map +1 -1
  17. package/dest/job/epoch-proving-job.js +427 -29
  18. package/dest/metrics.d.ts +11 -1
  19. package/dest/metrics.d.ts.map +1 -1
  20. package/dest/metrics.js +51 -100
  21. package/dest/monitors/epoch-monitor.d.ts +1 -1
  22. package/dest/monitors/epoch-monitor.d.ts.map +1 -1
  23. package/dest/monitors/epoch-monitor.js +1 -10
  24. package/dest/prover-node-publisher.d.ts +6 -5
  25. package/dest/prover-node-publisher.d.ts.map +1 -1
  26. package/dest/prover-node-publisher.js +11 -10
  27. package/dest/prover-node.d.ts +19 -9
  28. package/dest/prover-node.d.ts.map +1 -1
  29. package/dest/prover-node.js +410 -29
  30. package/dest/prover-publisher-factory.d.ts +6 -4
  31. package/dest/prover-publisher-factory.d.ts.map +1 -1
  32. package/dest/prover-publisher-factory.js +4 -2
  33. package/package.json +24 -23
  34. package/src/actions/rerun-epoch-proving-job.ts +5 -3
  35. package/src/bin/run-failed-epoch.ts +4 -1
  36. package/src/config.ts +22 -30
  37. package/src/factory.ts +58 -102
  38. package/src/index.ts +1 -0
  39. package/src/job/epoch-proving-job.ts +62 -24
  40. package/src/metrics.ts +54 -83
  41. package/src/monitors/epoch-monitor.ts +1 -8
  42. package/src/prover-node-publisher.ts +13 -10
  43. package/src/prover-node.ts +15 -9
  44. package/src/prover-publisher-factory.ts +13 -7
package/src/metrics.ts CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  type TelemetryClient,
14
14
  type Tracer,
15
15
  type UpDownCounter,
16
- ValueType,
16
+ createUpDownCounterWithDefault,
17
17
  } from '@aztec/telemetry-client';
18
18
 
19
19
  import { formatEther, formatUnits } from 'viem';
@@ -25,33 +25,30 @@ export class ProverNodeJobMetrics {
25
25
  provingJobBlocks: Gauge;
26
26
  provingJobTransactions: Gauge;
27
27
 
28
+ private blobProcessingDuration: Gauge;
29
+ private chonkVerifierDuration: Gauge;
30
+ private blockProcessingDuration: Histogram;
31
+ private checkpointProcessingDuration: Histogram;
32
+ private allCheckpointsProcessingDuration: Gauge;
33
+
28
34
  constructor(
29
35
  private meter: Meter,
30
36
  public readonly tracer: Tracer,
31
37
  private logger = createLogger('prover-node:publisher:metrics'),
32
38
  ) {
33
- this.proverEpochExecutionDuration = this.meter.createHistogram(Metrics.PROVER_NODE_EXECUTION_DURATION, {
34
- description: 'Duration of execution of an epoch by the prover',
35
- unit: 'ms',
36
- valueType: ValueType.INT,
37
- });
38
- this.provingJobDuration = this.meter.createHistogram(Metrics.PROVER_NODE_JOB_DURATION, {
39
- description: 'Duration of proving job',
40
- unit: 's',
41
- valueType: ValueType.DOUBLE,
42
- });
43
- this.provingJobCheckpoints = this.meter.createGauge(Metrics.PROVER_NODE_JOB_CHECKPOINTS, {
44
- description: 'Number of checkpoints in a proven epoch',
45
- valueType: ValueType.INT,
46
- });
47
- this.provingJobBlocks = this.meter.createGauge(Metrics.PROVER_NODE_JOB_BLOCKS, {
48
- description: 'Number of blocks in a proven epoch',
49
- valueType: ValueType.INT,
50
- });
51
- this.provingJobTransactions = this.meter.createGauge(Metrics.PROVER_NODE_JOB_TRANSACTIONS, {
52
- description: 'Number of transactions in a proven epoch',
53
- valueType: ValueType.INT,
54
- });
39
+ this.proverEpochExecutionDuration = this.meter.createHistogram(Metrics.PROVER_NODE_EXECUTION_DURATION);
40
+ this.provingJobDuration = this.meter.createHistogram(Metrics.PROVER_NODE_JOB_DURATION);
41
+ this.provingJobCheckpoints = this.meter.createGauge(Metrics.PROVER_NODE_JOB_CHECKPOINTS);
42
+ this.provingJobBlocks = this.meter.createGauge(Metrics.PROVER_NODE_JOB_BLOCKS);
43
+ this.provingJobTransactions = this.meter.createGauge(Metrics.PROVER_NODE_JOB_TRANSACTIONS);
44
+
45
+ this.blobProcessingDuration = this.meter.createGauge(Metrics.PROVER_NODE_BLOB_PROCESSING_LAST_DURATION);
46
+ this.chonkVerifierDuration = this.meter.createGauge(Metrics.PROVER_NODE_CHONK_VERIFIER_LAST_DURATION);
47
+ this.blockProcessingDuration = this.meter.createHistogram(Metrics.PROVER_NODE_BLOCK_PROCESSING_DURATION);
48
+ this.checkpointProcessingDuration = this.meter.createHistogram(Metrics.PROVER_NODE_CHECKPOINT_PROCESSING_DURATION);
49
+ this.allCheckpointsProcessingDuration = this.meter.createGauge(
50
+ Metrics.PROVER_NODE_ALL_CHECKPOINTS_PROCESSING_LAST_DURATION,
51
+ );
55
52
  }
56
53
 
57
54
  public recordProvingJob(
@@ -67,6 +64,26 @@ export class ProverNodeJobMetrics {
67
64
  this.provingJobBlocks.record(Math.floor(numBlocks));
68
65
  this.provingJobTransactions.record(Math.floor(numTxs));
69
66
  }
67
+
68
+ public recordBlobProcessing(durationMs: number) {
69
+ this.blobProcessingDuration.record(Math.ceil(durationMs));
70
+ }
71
+
72
+ public recordChonkVerifier(durationMs: number) {
73
+ this.chonkVerifierDuration.record(Math.ceil(durationMs));
74
+ }
75
+
76
+ public recordBlockProcessing(durationMs: number) {
77
+ this.blockProcessingDuration.record(Math.ceil(durationMs));
78
+ }
79
+
80
+ public recordCheckpointProcessing(durationMs: number) {
81
+ this.checkpointProcessingDuration.record(Math.ceil(durationMs));
82
+ }
83
+
84
+ public recordAllCheckpointsProcessing(durationMs: number) {
85
+ this.allCheckpointsProcessingDuration.record(Math.ceil(durationMs));
86
+ }
70
87
  }
71
88
 
72
89
  export class ProverNodeRewardsMetrics {
@@ -81,15 +98,9 @@ export class ProverNodeRewardsMetrics {
81
98
  private rollup: RollupContract,
82
99
  private logger = createLogger('prover-node:publisher:metrics'),
83
100
  ) {
84
- this.rewards = this.meter.createObservableGauge(Metrics.PROVER_NODE_REWARDS_PER_EPOCH, {
85
- valueType: ValueType.DOUBLE,
86
- description: 'The rewards earned',
87
- });
101
+ this.rewards = this.meter.createObservableGauge(Metrics.PROVER_NODE_REWARDS_PER_EPOCH);
88
102
 
89
- this.accumulatedRewards = this.meter.createUpDownCounter(Metrics.PROVER_NODE_REWARDS_TOTAL, {
90
- valueType: ValueType.DOUBLE,
91
- description: 'The rewards earned (total)',
92
- });
103
+ this.accumulatedRewards = createUpDownCounterWithDefault(this.meter, Metrics.PROVER_NODE_REWARDS_TOTAL);
93
104
  }
94
105
 
95
106
  public async start() {
@@ -150,68 +161,28 @@ export class ProverNodePublisherMetrics {
150
161
  ) {
151
162
  this.meter = client.getMeter(name);
152
163
 
153
- this.gasPrice = this.meter.createHistogram(Metrics.L1_PUBLISHER_GAS_PRICE, {
154
- description: 'The gas price used for transactions',
155
- unit: 'gwei',
156
- valueType: ValueType.DOUBLE,
157
- });
164
+ this.gasPrice = this.meter.createHistogram(Metrics.L1_PUBLISHER_GAS_PRICE);
158
165
 
159
- this.txCount = this.meter.createUpDownCounter(Metrics.L1_PUBLISHER_TX_COUNT, {
160
- description: 'The number of transactions processed',
166
+ this.txCount = createUpDownCounterWithDefault(this.meter, Metrics.L1_PUBLISHER_TX_COUNT, {
167
+ [Attributes.L1_TX_TYPE]: ['submitProof'],
168
+ [Attributes.OK]: [true, false],
161
169
  });
162
170
 
163
- this.txDuration = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_DURATION, {
164
- description: 'The duration of transaction processing',
165
- unit: 'ms',
166
- valueType: ValueType.INT,
167
- });
171
+ this.txDuration = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_DURATION);
168
172
 
169
- this.txGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_GAS, {
170
- description: 'The gas consumed by transactions',
171
- unit: 'gas',
172
- valueType: ValueType.INT,
173
- });
173
+ this.txGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_GAS);
174
174
 
175
- this.txCalldataSize = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_SIZE, {
176
- description: 'The size of the calldata in transactions',
177
- unit: 'By',
178
- valueType: ValueType.INT,
179
- });
175
+ this.txCalldataSize = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_SIZE);
180
176
 
181
- this.txCalldataGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_GAS, {
182
- description: 'The gas consumed by the calldata in transactions',
183
- unit: 'gas',
184
- valueType: ValueType.INT,
185
- });
177
+ this.txCalldataGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_GAS);
186
178
 
187
- this.txBlobDataGasUsed = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_USED, {
188
- description: 'The amount of blob gas used in transactions',
189
- unit: 'gas',
190
- valueType: ValueType.INT,
191
- });
179
+ this.txBlobDataGasUsed = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_USED);
192
180
 
193
- this.txBlobDataGasCost = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_COST, {
194
- description: 'The gas cost of blobs in transactions',
195
- unit: 'gwei',
196
- valueType: ValueType.INT,
197
- });
181
+ this.txBlobDataGasCost = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_COST);
198
182
 
199
- this.txTotalFee = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_TOTAL_FEE, {
200
- description: 'How much L1 tx costs',
201
- unit: 'gwei',
202
- valueType: ValueType.DOUBLE,
203
- advice: {
204
- explicitBucketBoundaries: [
205
- 0.001, 0.002, 0.004, 0.008, 0.01, 0.02, 0.04, 0.08, 0.1, 0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.8, 2,
206
- ],
207
- },
208
- });
183
+ this.txTotalFee = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_TOTAL_FEE);
209
184
 
210
- this.senderBalance = this.meter.createGauge(Metrics.L1_PUBLISHER_BALANCE, {
211
- unit: 'eth',
212
- description: 'The balance of the sender address',
213
- valueType: ValueType.DOUBLE,
214
- });
185
+ this.senderBalance = this.meter.createGauge(Metrics.L1_PUBLISHER_BALANCE);
215
186
  }
216
187
 
217
188
  recordFailedTx() {
@@ -4,13 +4,7 @@ import { RunningPromise } from '@aztec/foundation/running-promise';
4
4
  import { sleep } from '@aztec/foundation/sleep';
5
5
  import type { L2BlockSource } from '@aztec/stdlib/block';
6
6
  import { type L1RollupConstants, getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
7
- import {
8
- type TelemetryClient,
9
- type Traceable,
10
- type Tracer,
11
- getTelemetryClient,
12
- trackSpan,
13
- } from '@aztec/telemetry-client';
7
+ import { type TelemetryClient, type Traceable, type Tracer, getTelemetryClient } from '@aztec/telemetry-client';
14
8
 
15
9
  export interface EpochMonitorHandler {
16
10
  handleEpochReadyToProve(epochNumber: EpochNumber): Promise<boolean>;
@@ -73,7 +67,6 @@ export class EpochMonitor implements Traceable {
73
67
  this.log.info('Stopped EpochMonitor');
74
68
  }
75
69
 
76
- @trackSpan('EpochMonitor.work')
77
70
  public async work() {
78
71
  const { epochToProve, blockNumber, slotNumber } = await this.getEpochNumberToProve();
79
72
  this.log.debug(`Epoch to prove: ${epochToProve}`, { blockNumber, slotNumber });
@@ -1,5 +1,5 @@
1
1
  import { BatchedBlob, getEthBlobEvaluationInputs } from '@aztec/blob-lib';
2
- import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
2
+ import { MAX_CHECKPOINTS_PER_EPOCH } from '@aztec/constants';
3
3
  import type { RollupContract, ViemCommitteeAttestation } from '@aztec/ethereum/contracts';
4
4
  import type { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
5
5
  import { makeTuple } from '@aztec/foundation/array';
@@ -7,7 +7,7 @@ import { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
7
7
  import { areArraysEqual } from '@aztec/foundation/collection';
8
8
  import { Fr } from '@aztec/foundation/curves/bn254';
9
9
  import { EthAddress } from '@aztec/foundation/eth-address';
10
- import { createLogger } from '@aztec/foundation/log';
10
+ import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
11
11
  import type { Tuple } from '@aztec/foundation/serialize';
12
12
  import { Timer } from '@aztec/foundation/timer';
13
13
  import { RollupAbi } from '@aztec/l1-artifacts';
@@ -31,7 +31,7 @@ export type L1SubmitEpochProofArgs = {
31
31
  endTimestamp: Fr;
32
32
  outHash: Fr;
33
33
  proverId: Fr;
34
- fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>;
34
+ fees: Tuple<FeeRecipient, typeof MAX_CHECKPOINTS_PER_EPOCH>;
35
35
  proof: Proof;
36
36
  };
37
37
 
@@ -39,7 +39,7 @@ export class ProverNodePublisher {
39
39
  private interrupted = false;
40
40
  private metrics: ProverNodePublisherMetrics;
41
41
 
42
- protected log = createLogger('prover-node:l1-tx-publisher');
42
+ protected log: Logger;
43
43
 
44
44
  protected rollupContract: RollupContract;
45
45
 
@@ -52,10 +52,12 @@ export class ProverNodePublisher {
52
52
  l1TxUtils: L1TxUtils;
53
53
  telemetry?: TelemetryClient;
54
54
  },
55
+ bindings?: LoggerBindings,
55
56
  ) {
56
57
  const telemetry = deps.telemetry ?? getTelemetryClient();
57
58
 
58
59
  this.metrics = new ProverNodePublisherMetrics(telemetry, 'ProverNode');
60
+ this.log = createLogger('prover-node:l1-tx-publisher', bindings);
59
61
 
60
62
  this.rollupContract = deps.rollupContract;
61
63
  this.l1TxUtils = deps.l1TxUtils;
@@ -172,17 +174,17 @@ export class ProverNodePublisher {
172
174
 
173
175
  // Check the archive for the immediate checkpoint before the epoch
174
176
  const checkpointLog = await this.rollupContract.getCheckpoint(CheckpointNumber(fromCheckpoint - 1));
175
- if (publicInputs.previousArchiveRoot.toString() !== checkpointLog.archive) {
177
+ if (!publicInputs.previousArchiveRoot.equals(checkpointLog.archive)) {
176
178
  throw new Error(
177
- `Previous archive root mismatch: ${publicInputs.previousArchiveRoot.toString()} !== ${checkpointLog.archive}`,
179
+ `Previous archive root mismatch: ${publicInputs.previousArchiveRoot.toString()} !== ${checkpointLog.archive.toString()}`,
178
180
  );
179
181
  }
180
182
 
181
183
  // Check the archive for the last checkpoint in the epoch
182
184
  const endCheckpointLog = await this.rollupContract.getCheckpoint(toCheckpoint);
183
- if (publicInputs.endArchiveRoot.toString() !== endCheckpointLog.archive) {
185
+ if (!publicInputs.endArchiveRoot.equals(endCheckpointLog.archive)) {
184
186
  throw new Error(
185
- `End archive root mismatch: ${publicInputs.endArchiveRoot.toString()} !== ${endCheckpointLog.archive}`,
187
+ `End archive root mismatch: ${publicInputs.endArchiveRoot.toString()} !== ${endCheckpointLog.archive.toString()}`,
186
188
  );
187
189
  }
188
190
 
@@ -200,7 +202,7 @@ export class ProverNodePublisher {
200
202
  );
201
203
  const argsPublicInputs = [...publicInputs.toFields()];
202
204
 
203
- if (!areArraysEqual(rollupPublicInputs.map(Fr.fromHexString), argsPublicInputs, (a, b) => a.equals(b))) {
205
+ if (!areArraysEqual(rollupPublicInputs, argsPublicInputs, (a, b) => a.equals(b))) {
204
206
  const fmt = (inputs: Fr[] | readonly string[]) => inputs.map(x => x.toString()).join(', ');
205
207
  throw new Error(
206
208
  `Root rollup public inputs mismatch:\nRollup: ${fmt(rollupPublicInputs)}\nComputed:${fmt(argsPublicInputs)}`,
@@ -266,9 +268,10 @@ export class ProverNodePublisher {
266
268
  {
267
269
  previousArchive: args.publicInputs.previousArchiveRoot.toString(),
268
270
  endArchive: args.publicInputs.endArchiveRoot.toString(),
271
+ outHash: args.publicInputs.outHash.toString(),
269
272
  proverId: EthAddress.fromField(args.publicInputs.constants.proverId).toString(),
270
273
  } /*_args*/,
271
- makeTuple(AZTEC_MAX_EPOCH_DURATION * 2, i =>
274
+ makeTuple(MAX_CHECKPOINTS_PER_EPOCH * 2, i =>
272
275
  i % 2 === 0
273
276
  ? args.publicInputs.fees[i / 2].recipient.toField().toString()
274
277
  : args.publicInputs.fees[(i - 1) / 2].value.toString(),
@@ -1,5 +1,6 @@
1
1
  import type { Archiver } from '@aztec/archiver';
2
2
  import type { RollupContract } from '@aztec/ethereum/contracts';
3
+ import type { Delayer } from '@aztec/ethereum/l1-tx-utils';
3
4
  import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
4
5
  import { assertRequired, compact, pick, sum } from '@aztec/foundation/collection';
5
6
  import type { Fr } from '@aztec/foundation/curves/bn254';
@@ -7,7 +8,6 @@ import { memoize } from '@aztec/foundation/decorators';
7
8
  import { createLogger } from '@aztec/foundation/log';
8
9
  import { DateProvider } from '@aztec/foundation/timer';
9
10
  import type { DataStoreConfig } from '@aztec/kv-store/config';
10
- import type { P2PClient } from '@aztec/p2p';
11
11
  import { PublicProcessorFactory } from '@aztec/simulator/server';
12
12
  import type { L2BlockSource } from '@aztec/stdlib/block';
13
13
  import type { Checkpoint } from '@aztec/stdlib/checkpoint';
@@ -17,6 +17,7 @@ import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers
17
17
  import {
18
18
  type EpochProverManager,
19
19
  EpochProvingJobTerminalState,
20
+ type ITxProvider,
20
21
  type ProverNodeApi,
21
22
  type Service,
22
23
  type WorldStateSyncStatus,
@@ -24,7 +25,6 @@ import {
24
25
  tryStop,
25
26
  } from '@aztec/stdlib/interfaces/server';
26
27
  import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
27
- import type { P2PClientType } from '@aztec/stdlib/p2p';
28
28
  import type { Tx } from '@aztec/stdlib/tx';
29
29
  import {
30
30
  Attributes,
@@ -55,7 +55,6 @@ type DataStoreOptions = Pick<DataStoreConfig, 'dataDirectory'> & Pick<ChainConfi
55
55
  */
56
56
  export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable {
57
57
  private log = createLogger('prover-node');
58
- private dateProvider = new DateProvider();
59
58
 
60
59
  private jobs: Map<string, EpochProvingJob> = new Map();
61
60
  private config: ProverNodeOptions;
@@ -73,17 +72,19 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
73
72
  protected readonly l1ToL2MessageSource: L1ToL2MessageSource,
74
73
  protected readonly contractDataSource: ContractDataSource,
75
74
  protected readonly worldState: WorldStateSynchronizer,
76
- protected readonly p2pClient: Pick<P2PClient<P2PClientType.Prover>, 'getTxProvider'> & Partial<Service>,
75
+ protected readonly p2pClient: { getTxProvider(): ITxProvider } & Partial<Service>,
77
76
  protected readonly epochsMonitor: EpochMonitor,
78
77
  protected readonly rollupContract: RollupContract,
79
78
  protected readonly l1Metrics: L1Metrics,
80
79
  config: Partial<ProverNodeOptions> = {},
81
80
  protected readonly telemetryClient: TelemetryClient = getTelemetryClient(),
81
+ private delayer?: Delayer,
82
+ private readonly dateProvider: DateProvider = new DateProvider(),
82
83
  ) {
83
84
  this.config = {
84
85
  proverNodePollingIntervalMs: 1_000,
85
86
  proverNodeMaxPendingJobs: 100,
86
- proverNodeMaxParallelBlocksPerEpoch: 32,
87
+ proverNodeMaxParallelBlocksPerEpoch: 0,
87
88
  txGatheringIntervalMs: 1_000,
88
89
  txGatheringBatchSize: 10,
89
90
  txGatheringMaxParallelRequestsPerNode: 100,
@@ -111,6 +112,11 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
111
112
  return this.p2pClient;
112
113
  }
113
114
 
115
+ /** Returns the shared tx delayer for prover L1 txs, if enabled. Test-only. */
116
+ public getDelayer(): Delayer | undefined {
117
+ return this.delayer;
118
+ }
119
+
114
120
  /**
115
121
  * Handles an epoch being completed by starting a proof for it if there are no active jobs for it.
116
122
  * @param epochNumber - The epoch number that was just completed.
@@ -155,17 +161,15 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
155
161
 
156
162
  /**
157
163
  * Stops the prover node and all its dependencies.
164
+ * Resources not owned by this node (shared with the parent aztec-node) are skipped.
158
165
  */
159
166
  async stop() {
160
167
  this.log.info('Stopping ProverNode');
161
168
  await this.epochsMonitor.stop();
162
169
  await this.prover.stop();
163
- await tryStop(this.p2pClient);
164
- await tryStop(this.l2BlockSource);
165
170
  await tryStop(this.publisherFactory);
166
171
  this.publisher?.interrupt();
167
172
  await Promise.all(Array.from(this.jobs.values()).map(job => job.stop()));
168
- await this.worldState.stop();
169
173
  this.rewardsMetrics.stop();
170
174
  this.l1Metrics.stop();
171
175
  await this.telemetryClient.stop();
@@ -288,6 +292,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
288
292
  this.contractDataSource,
289
293
  this.dateProvider,
290
294
  this.telemetryClient,
295
+ this.log.getBindings(),
291
296
  );
292
297
 
293
298
  // Set deadline for this job to run. It will abort if it takes too long.
@@ -311,7 +316,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
311
316
  const l1ToL2Messages = await this.gatherMessages(epochNumber, checkpoints);
312
317
  const [firstBlock] = checkpoints[0].blocks;
313
318
  const previousBlockHeader = await this.gatherPreviousBlockHeader(epochNumber, firstBlock.number - 1);
314
- const [lastPublishedCheckpoint] = await this.l2BlockSource.getPublishedCheckpoints(checkpoints.at(-1)!.number, 1);
319
+ const [lastPublishedCheckpoint] = await this.l2BlockSource.getCheckpoints(checkpoints.at(-1)!.number, 1);
315
320
  const attestations = lastPublishedCheckpoint?.attestations ?? [];
316
321
 
317
322
  return { checkpoints, txs, l1ToL2Messages, epochNumber, previousBlockHeader, attestations };
@@ -384,6 +389,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
384
389
  this.jobMetrics,
385
390
  deadline,
386
391
  { parallelBlockLimit, skipSubmitProof: proverNodeDisableProofPublish, ...opts },
392
+ this.log.getBindings(),
387
393
  );
388
394
  }
389
395
 
@@ -1,19 +1,21 @@
1
1
  import type { RollupContract } from '@aztec/ethereum/contracts';
2
2
  import type { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
3
3
  import type { PublisherManager } from '@aztec/ethereum/publisher-manager';
4
- import type { PublisherConfig, TxSenderConfig } from '@aztec/sequencer-client';
4
+ import type { LoggerBindings } from '@aztec/foundation/log';
5
+ import type { ProverPublisherConfig, ProverTxSenderConfig } from '@aztec/sequencer-client';
5
6
  import type { TelemetryClient } from '@aztec/telemetry-client';
6
7
 
7
8
  import { ProverNodePublisher } from './prover-node-publisher.js';
8
9
 
9
10
  export class ProverPublisherFactory {
10
11
  constructor(
11
- private config: TxSenderConfig & PublisherConfig,
12
+ private config: ProverTxSenderConfig & ProverPublisherConfig,
12
13
  private deps: {
13
14
  rollupContract: RollupContract;
14
15
  publisherManager: PublisherManager<L1TxUtils>;
15
16
  telemetry?: TelemetryClient;
16
17
  },
18
+ private bindings?: LoggerBindings,
17
19
  ) {}
18
20
 
19
21
  public async start() {
@@ -30,10 +32,14 @@ export class ProverPublisherFactory {
30
32
  */
31
33
  public async create(): Promise<ProverNodePublisher> {
32
34
  const l1Publisher = await this.deps.publisherManager.getAvailablePublisher();
33
- return new ProverNodePublisher(this.config, {
34
- rollupContract: this.deps.rollupContract,
35
- l1TxUtils: l1Publisher,
36
- telemetry: this.deps.telemetry,
37
- });
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
+ );
38
44
  }
39
45
  }