@aztec/prover-node 2.0.3 → 2.1.0-rc.2

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.
package/dest/config.d.ts CHANGED
@@ -16,6 +16,8 @@ export type SpecificProverNodeConfig = {
16
16
  proverNodePollingIntervalMs: number;
17
17
  proverNodeMaxParallelBlocksPerEpoch: number;
18
18
  proverNodeFailedEpochStore: string | undefined;
19
+ proverNodeDisableProofPublish?: boolean;
20
+ proverNodeEpochProvingDelayMs: number | undefined;
19
21
  txGatheringTimeoutMs: number;
20
22
  txGatheringIntervalMs: number;
21
23
  txGatheringBatchSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAA+C,MAAM,sBAAsB,CAAC;AACvH,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAGxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,sBAAsB,EAAgD,MAAM,6BAA6B,CAAC;AACxH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAGpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB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,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,QAAQ,GAAG,SAAS,CAMtF"}
package/dest/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { archiverConfigMappings } from '@aztec/archiver/config';
2
2
  import { genesisStateConfigMappings } from '@aztec/ethereum';
3
- import { getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
3
+ import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
4
4
  import { dataConfigMappings } from '@aztec/kv-store/config';
5
5
  import { ethPrivateKeySchema, keyStoreConfigMappings } from '@aztec/node-keystore';
6
6
  import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
@@ -30,6 +30,10 @@ const specificProverNodeConfigMappings = {
30
30
  description: 'File store where to upload node state when an epoch fails to be proven',
31
31
  defaultValue: undefined
32
32
  },
33
+ proverNodeEpochProvingDelayMs: {
34
+ description: 'Optional delay in milliseconds to wait before proving a new epoch',
35
+ defaultValue: undefined
36
+ },
33
37
  txGatheringIntervalMs: {
34
38
  env: 'PROVER_NODE_TX_GATHERING_INTERVAL_MS',
35
39
  description: 'How often to check that tx data is available',
@@ -49,6 +53,11 @@ const specificProverNodeConfigMappings = {
49
53
  env: 'PROVER_NODE_TX_GATHERING_TIMEOUT_MS',
50
54
  description: 'How long to wait for tx data to be available before giving up',
51
55
  ...numberConfigHelper(120_000)
56
+ },
57
+ proverNodeDisableProofPublish: {
58
+ env: 'PROVER_NODE_DISABLE_PROOF_PUBLISH',
59
+ description: 'Whether the prover node skips publishing proofs to L1',
60
+ ...booleanConfigHelper(false)
52
61
  }
53
62
  };
54
63
  export const proverNodeConfigMappings = {
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,iBAAiB,CAAC;AAEhE,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAA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AY,CAAC;CAC7B,CAAC;AAEF,gDAAgD;AAChD,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,gBAAgB,GAAG,eAAe,GAAG,cAAc,EAC/D,IAAI,GAAE,cAAmB,EACzB,OAAO,GAAE;IACP,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACvC,uBAsKP"}
package/dest/factory.js CHANGED
@@ -2,12 +2,13 @@ import { createArchiver } from '@aztec/archiver';
2
2
  import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
3
3
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
4
4
  import { EpochCache } from '@aztec/epoch-cache';
5
- import { PublisherManager, RollupContract, createEthereumChain, createL1TxUtilsFromEthSigner } from '@aztec/ethereum';
5
+ import { PublisherManager, RollupContract, createEthereumChain } from '@aztec/ethereum';
6
6
  import { pick } from '@aztec/foundation/collection';
7
7
  import { createLogger } from '@aztec/foundation/log';
8
8
  import { DateProvider } from '@aztec/foundation/timer';
9
9
  import { KeystoreManager, loadKeystores, mergeKeystores } from '@aztec/node-keystore';
10
10
  import { trySnapshotSync } from '@aztec/node-lib/actions';
11
+ import { createL1TxUtilsFromEthSignerWithStore } from '@aztec/node-lib/factories';
11
12
  import { NodeRpcTxSource, createP2PClient } from '@aztec/p2p';
12
13
  import { createProverClient } from '@aztec/prover-client';
13
14
  import { createAndStartProvingBroker } from '@aztec/prover-client/broker';
@@ -42,6 +43,7 @@ import { ProverPublisherFactory } from './prover-publisher-factory.js';
42
43
  keyStoreManager = new KeystoreManager(keyStore);
43
44
  }
44
45
  }
46
+ await keyStoreManager?.validateSigners();
45
47
  // Extract the prover signers from the key store and verify that we have one.
46
48
  const proverSigners = keyStoreManager?.createProverSigners();
47
49
  if (proverSigners === undefined) {
@@ -89,12 +91,17 @@ import { ProverPublisherFactory } from './prover-publisher-factory.js';
89
91
  const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
90
92
  const l1TxUtils = deps.l1TxUtils ? [
91
93
  deps.l1TxUtils
92
- ] : proverSigners.signers.map((signer)=>{
93
- return createL1TxUtilsFromEthSigner(publicClient, signer, log, dateProvider, config);
94
+ ] : await createL1TxUtilsFromEthSignerWithStore(publicClient, proverSigners.signers, {
95
+ ...config,
96
+ scope: 'prover'
97
+ }, {
98
+ telemetry,
99
+ logger: log.createChild('l1-tx-utils'),
100
+ dateProvider
94
101
  });
95
102
  const publisherFactory = deps.publisherFactory ?? new ProverPublisherFactory(config, {
96
103
  rollupContract,
97
- publisherManager: new PublisherManager(l1TxUtils),
104
+ publisherManager: new PublisherManager(l1TxUtils, config),
98
105
  telemetry
99
106
  });
100
107
  const proofVerifier = new QueuedIVCVerifier(config, config.realProofs ? await BBCircuitVerifier.new(config) : new TestCircuitVerifier());
@@ -105,10 +112,11 @@ import { ProverPublisherFactory } from './prover-publisher-factory.js';
105
112
  });
106
113
  await p2pClient.start();
107
114
  const proverNodeConfig = {
108
- ...pick(config, 'proverNodeMaxPendingJobs', 'proverNodeMaxParallelBlocksPerEpoch', 'proverNodePollingIntervalMs', 'txGatheringMaxParallelRequests', 'txGatheringIntervalMs', 'txGatheringTimeoutMs', 'proverNodeFailedEpochStore', 'dataDirectory', 'l1ChainId', 'rollupVersion')
115
+ ...pick(config, 'proverNodeMaxPendingJobs', 'proverNodeMaxParallelBlocksPerEpoch', 'proverNodePollingIntervalMs', 'proverNodeEpochProvingDelayMs', 'txGatheringMaxParallelRequests', 'txGatheringIntervalMs', 'txGatheringTimeoutMs', 'proverNodeFailedEpochStore', 'dataDirectory', 'l1ChainId', 'rollupVersion')
109
116
  };
110
117
  const epochMonitor = await EpochMonitor.create(archiver, {
111
- pollingIntervalMs: config.proverNodePollingIntervalMs
118
+ pollingIntervalMs: config.proverNodePollingIntervalMs,
119
+ provingDelayMs: config.proverNodeEpochProvingDelayMs
112
120
  }, telemetry);
113
121
  const l1Metrics = new L1Metrics(telemetry.getMeter('ProverNodeL1Metrics'), publicClient, l1TxUtils.map((utils)=>utils.getSenderAddress()));
114
122
  return new ProverNode(prover, publisherFactory, archiver, archiver, archiver, worldStateSynchronizer, p2pClient, epochMonitor, rollupContract, l1Metrics, proverNodeConfig, telemetry);
@@ -5,6 +5,11 @@ import { type Traceable, type Tracer } from '@aztec/telemetry-client';
5
5
  import type { ProverNodeJobMetrics } from '../metrics.js';
6
6
  import type { ProverNodePublisher } from '../prover-node-publisher.js';
7
7
  import { type EpochProvingJobData } from './epoch-proving-job-data.js';
8
+ export type EpochProvingJobOptions = {
9
+ parallelBlockLimit?: number;
10
+ skipEpochCheck?: boolean;
11
+ skipSubmitProof?: boolean;
12
+ };
8
13
  /**
9
14
  * Job that grabs a range of blocks from the unfinalized chain from L1, gets their txs given their hashes,
10
15
  * re-executes their public calls, generates a rollup proof, and submits it to L1. This job will update the
@@ -27,10 +32,7 @@ export declare class EpochProvingJob implements Traceable {
27
32
  private epochCheckPromise;
28
33
  private deadlineTimeoutHandler;
29
34
  readonly tracer: Tracer;
30
- constructor(data: EpochProvingJobData, dbProvider: Pick<ForkMerkleTreeOperations, 'fork'>, prover: EpochProver, publicProcessorFactory: PublicProcessorFactory, publisher: Pick<ProverNodePublisher, 'submitEpochProof'>, l2BlockSource: L2BlockSource | undefined, metrics: ProverNodeJobMetrics, deadline: Date | undefined, config: {
31
- parallelBlockLimit?: number;
32
- skipEpochCheck?: boolean;
33
- });
35
+ constructor(data: EpochProvingJobData, dbProvider: Pick<ForkMerkleTreeOperations, 'fork'>, prover: EpochProver, publicProcessorFactory: PublicProcessorFactory, publisher: Pick<ProverNodePublisher, 'submitEpochProof'>, l2BlockSource: L2BlockSource | undefined, metrics: ProverNodeJobMetrics, deadline: Date | undefined, config: EpochProvingJobOptions);
34
36
  getId(): string;
35
37
  getState(): EpochProvingJobState;
36
38
  getEpochNumber(): bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"epoch-proving-job.d.ts","sourceRoot":"","sources":["../../src/job/epoch-proving-job.ts"],"names":[],"mappings":"A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,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,MAAM,GAEjB;IAED,OAAO,KAAK,GAAG,GAEd;IAED,OAAO,KAAK,YAAY,GAEvB;IAED;;OAEG;IAIU,GAAG;IAiIhB;;;OAGG;YACW,UAAU;IAgBxB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IAML,IAAI,CAAC,KAAK,GAAE,4BAAwC;IASjE,OAAO,CAAC,oBAAoB;IAoB5B;;;OAGG;YACW,kBAAkB;IAiChC,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,iBAAiB;YAIX,UAAU;CAmBzB;AASD,OAAO,EAAE,KAAK,oBAAoB,EAAE,CAAC"}
@@ -154,6 +154,12 @@ import { validateEpochProvingJobData } from './epoch-proving-job-data.js';
154
154
  duration: timer.ms()
155
155
  });
156
156
  this.progressState('publishing-proof');
157
+ if (this.config.skipSubmitProof) {
158
+ this.log.info(`Proof publishing is disabled. Dropping valid proof for epoch ${epochNumber} (blocks ${fromBlock} to ${toBlock})`);
159
+ this.state = 'completed';
160
+ this.metrics.recordProvingJob(executionTime, timer.ms(), epochSizeBlocks, epochSizeTxs);
161
+ return;
162
+ }
157
163
  const success = await this.publisher.submitEpochProof({
158
164
  fromBlock,
159
165
  toBlock,
package/dest/metrics.js CHANGED
@@ -56,7 +56,7 @@ export class ProverNodeRewardsMetrics {
56
56
  this.prevEpoch = -1n;
57
57
  this.proofSubmissionEpochs = 0;
58
58
  this.observe = async (observer)=>{
59
- const epoch = await this.rollup.getEpochNumber();
59
+ const epoch = await this.rollup.getCurrentEpochNumber();
60
60
  if (epoch > this.proofSubmissionEpochs) {
61
61
  // look at the prev epoch so that we get an accurate value, after proof submission window has closed
62
62
  // For example, if proof submission window is 1 epoch, and we are in epoch 2, we should be looking at epoch 0.
@@ -26,9 +26,11 @@ export declare class EpochMonitor implements Traceable {
26
26
  private latestEpochNumber;
27
27
  constructor(l2BlockSource: L2BlockSource, l1Constants: Pick<L1RollupConstants, 'epochDuration'>, options: {
28
28
  pollingIntervalMs: number;
29
+ provingDelayMs?: number;
29
30
  }, telemetry?: TelemetryClient);
30
31
  static create(l2BlockSource: L2BlockSource, options: {
31
32
  pollingIntervalMs: number;
33
+ provingDelayMs?: number;
32
34
  }, telemetry?: TelemetryClient): Promise<EpochMonitor>;
33
35
  start(handler: EpochMonitorHandler): void;
34
36
  /** Exposed for testing */
@@ -1 +1 @@
1
- {"version":3,"file":"epoch-monitor.d.ts","sourceRoot":"","sources":["../../src/monitors/epoch-monitor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,6BAA6B,CAAC;AACrF,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IAClC,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAChE;AAED;;;;;;;;;;GAUG;AACH,qBAAa,YAAa,YAAW,SAAS;IAS1C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,OAAO;IAVjB,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,GAAG,CAA6C;IACxD,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,iBAAiB,CAAqB;gBAG3B,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,CAAC,EAC9D,OAAO,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAA;KAAE,EAC9C,SAAS,GAAE,eAAsC;WAM/B,MAAM,CACxB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE;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AiB,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,SAAS,GAAE,eAAsC,GAChD,OAAO,CAAC,YAAY,CAAC;IAKjB,KAAK,CAAC,OAAO,EAAE,mBAAmB;IAMzC,0BAA0B;IACnB,UAAU,CAAC,OAAO,EAAE,mBAAmB;IAIjC,IAAI;IAMJ,IAAI;YA6BH,qBAAqB;CAYpC"}
@@ -6,6 +6,7 @@ function _ts_decorate(decorators, target, key, desc) {
6
6
  }
7
7
  import { createLogger } from '@aztec/foundation/log';
8
8
  import { RunningPromise } from '@aztec/foundation/running-promise';
9
+ import { sleep } from '@aztec/foundation/sleep';
9
10
  import { getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
10
11
  import { getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
11
12
  /**
@@ -34,6 +35,9 @@ import { getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
34
35
  this.log = createLogger('prover-node:epoch-monitor');
35
36
  this.tracer = telemetry.getTracer('EpochMonitor');
36
37
  this.runningPromise = new RunningPromise(this.work.bind(this), this.log, this.options.pollingIntervalMs);
38
+ if (this.options.provingDelayMs) {
39
+ this.log.warn(`Prover node epoch monitor running with delay of ${this.options.provingDelayMs}ms`);
40
+ }
37
41
  }
38
42
  static async create(l2BlockSource, options, telemetry = getTelemetryClient()) {
39
43
  const l1Constants = await l2BlockSource.getL1Constants();
@@ -80,6 +84,10 @@ import { getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
80
84
  });
81
85
  return;
82
86
  }
87
+ if (this.options.provingDelayMs) {
88
+ this.log.debug(`Waiting ${this.options.provingDelayMs}ms before proving epoch ${epochToProve}`);
89
+ await sleep(this.options.provingDelayMs);
90
+ }
83
91
  this.log.debug(`Epoch ${epochToProve} is ready to be proven`);
84
92
  if (await this.handler?.handleEpochReadyToProve(epochToProve)) {
85
93
  this.latestEpochNumber = epochToProve;
@@ -1,6 +1,6 @@
1
1
  import { type BatchedBlob } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
- import { type L1TxUtils, type RollupContract, type ViemCommitteeAttestation } from '@aztec/ethereum';
3
+ import type { L1TxUtils, RollupContract, ViemCommitteeAttestation } from '@aztec/ethereum';
4
4
  import { EthAddress } from '@aztec/foundation/eth-address';
5
5
  import { Fr } from '@aztec/foundation/fields';
6
6
  import type { Tuple } from '@aztec/foundation/serialize';
@@ -20,8 +20,6 @@ export type L1SubmitEpochProofArgs = {
20
20
  proof: Proof;
21
21
  };
22
22
  export declare class ProverNodePublisher {
23
- private interruptibleSleep;
24
- private sleepTimeMs;
25
23
  private interrupted;
26
24
  private metrics;
27
25
  protected log: import("@aztec/foundation/log").Logger;
@@ -56,6 +54,5 @@ export declare class ProverNodePublisher {
56
54
  private sendSubmitEpochProofTx;
57
55
  private getEpochProofPublicInputsArgs;
58
56
  private getSubmitEpochProofArgs;
59
- protected sleepOrInterrupted(): Promise<void>;
60
57
  }
61
58
  //# sourceMappingURL=prover-node-publisher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prover-node-publisher.d.ts","sourceRoot":"","sources":["../src/prover-node-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,KAAK,SAAS,EACd,KAAK,cAAc,EAEnB,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAIzD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM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9B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAA6B;IAE5C,SAAS,CAAC,GAAG,yCAA+C;IAE5D,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAEzC,SAAgB,SAAS,EAAE,SAAS,CAAC;gBAGnC,MAAM,EAAE,cAAc,GAAG,eAAe,EACxC,IAAI,EAAE;QACJ,cAAc,EAAE,cAAc,CAAC;QAC/B,SAAS,EAAE,SAAS,CAAC;QACrB,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B;IAUI,iBAAiB;IAIxB;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;IAKP,gBAAgB;IAIV,gBAAgB,CAAC,IAAI,EAAE;QAClC,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,sBAAsB,CAAC;QACrC,KAAK,EAAE,KAAK,CAAC;QACb,iBAAiB,EAAE,WAAW,CAAC;QAC/B,YAAY,EAAE,wBAAwB,EAAE,CAAC;KAC1C,GAAG,OAAO,CAAC,OAAO,CAAC;YAiDN,4BAA4B;YA0D5B,sBAAsB;IAyCpC,OAAO,CAAC,6BAA6B;IAyBrC,OAAO,CAAC,uBAAuB;CAuBhC"}
@@ -1,28 +1,24 @@
1
1
  import { FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
- import { RollupContract as RollupContractClass } from '@aztec/ethereum';
4
3
  import { makeTuple } from '@aztec/foundation/array';
5
4
  import { areArraysEqual } from '@aztec/foundation/collection';
6
5
  import { EthAddress } from '@aztec/foundation/eth-address';
7
6
  import { Fr } from '@aztec/foundation/fields';
8
7
  import { createLogger } from '@aztec/foundation/log';
9
- import { InterruptibleSleep } from '@aztec/foundation/sleep';
10
8
  import { Timer } from '@aztec/foundation/timer';
11
9
  import { RollupAbi } from '@aztec/l1-artifacts';
10
+ import { CommitteeAttestation, CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
12
11
  import { getTelemetryClient } from '@aztec/telemetry-client';
13
12
  import { inspect } from 'util';
14
13
  import { encodeFunctionData } from 'viem';
15
14
  import { ProverNodePublisherMetrics } from './metrics.js';
16
15
  export class ProverNodePublisher {
17
- interruptibleSleep = new InterruptibleSleep();
18
- sleepTimeMs;
19
16
  interrupted = false;
20
17
  metrics;
21
18
  log = createLogger('prover-node:l1-tx-publisher');
22
19
  rollupContract;
23
20
  l1TxUtils;
24
21
  constructor(config, deps){
25
- this.sleepTimeMs = config?.l1PublishRetryIntervalMS ?? 60_000;
26
22
  const telemetry = deps.telemetry ?? getTelemetryClient();
27
23
  this.metrics = new ProverNodePublisherMetrics(telemetry, 'ProverNode');
28
24
  this.rollupContract = deps.rollupContract;
@@ -38,10 +34,11 @@ export class ProverNodePublisher {
38
34
  * A call to `restart` is required before you can continue publishing.
39
35
  */ interrupt() {
40
36
  this.interrupted = true;
41
- this.interruptibleSleep.interrupt();
37
+ this.l1TxUtils.interrupt();
42
38
  }
43
39
  /** Restarts the publisher after calling `interrupt`. */ restart() {
44
40
  this.interrupted = false;
41
+ this.l1TxUtils.restart();
45
42
  }
46
43
  getSenderAddress() {
47
44
  return this.l1TxUtils.getSenderAddress();
@@ -89,7 +86,6 @@ export class ProverNodePublisher {
89
86
  }
90
87
  this.metrics.recordFailedTx();
91
88
  this.log.error(`Rollup.submitEpochProof tx status failed ${txReceipt.transactionHash}`, undefined, ctx);
92
- await this.sleepOrInterrupted();
93
89
  }
94
90
  this.log.verbose('L2 block data syncing interrupted', ctx);
95
91
  return false;
@@ -187,12 +183,9 @@ export class ProverNodePublisher {
187
183
  end: argsArray[1],
188
184
  args: argsArray[2],
189
185
  fees: argsArray[3],
190
- attestations: RollupContractClass.packAttestations(args.attestations),
186
+ attestations: new CommitteeAttestationsAndSigners(args.attestations.map((a)=>CommitteeAttestation.fromViem(a))).getPackedAttestations(),
191
187
  blobInputs: argsArray[4],
192
188
  proof: proofHex
193
189
  };
194
190
  }
195
- async sleepOrInterrupted() {
196
- await this.interruptibleSleep.sleep(this.sleepTimeMs);
197
- }
198
191
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prover-node.d.ts","sourceRoot":"","sources":["../src/prover-node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAE5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAEL,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAExF,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACrF,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cAyBJ,qBAAqB,CAAC,GAAG,EAAE,eAAe;IAc1D;;OAEG;IACI,SAAS;IAIhB;;OAEG;IACI,OAAO,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,oBAAoB,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;cAUhF,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,oBAAoB,CAAA;KAAE,EAAE,CAAC;IAM5D,OAAO,CAAC,uBAAuB;YAQjB,gBAAgB;IAgC9B,OAAO,CAAC,cAAc;YAKR,eAAe;YAYf,YAAY;YAQZ,SAAS;YAeT,cAAc;YAWd,yBAAyB;IAcvC,sCAAsC;IACtC,SAAS,CAAC,uBAAuB,CAC/B,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,IAAI,GAAG,SAAS,EAC1B,sBAAsB,EAAE,sBAAsB,EAC9C,SAAS,EAAE,mBAAmB,EAC9B,IAAI,GAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAO;IAgBzC,sCAAsC;cACtB,eAAe;IAI/B,OAAO,CAAC,cAAc;CAcvB"}
@@ -63,6 +63,7 @@ import { ProverNodeJobMetrics, ProverNodeRewardsMetrics } from './metrics.js';
63
63
  txGatheringMaxParallelRequestsPerNode: 100,
64
64
  txGatheringTimeoutMs: 120_000,
65
65
  proverNodeFailedEpochStore: undefined,
66
+ proverNodeEpochProvingDelayMs: undefined,
66
67
  ...compact(config)
67
68
  };
68
69
  this.validateConfig();
@@ -109,6 +110,7 @@ import { ProverNodeJobMetrics, ProverNodeRewardsMetrics } from './metrics.js';
109
110
  * starts proving jobs for them.
110
111
  */ async start() {
111
112
  this.epochsMonitor.start(this);
113
+ await this.publisherFactory.start();
112
114
  this.publisher = await this.publisherFactory.create();
113
115
  await this.rewardsMetrics.start();
114
116
  this.l1Metrics.start();
@@ -122,6 +124,7 @@ import { ProverNodeJobMetrics, ProverNodeRewardsMetrics } from './metrics.js';
122
124
  await this.prover.stop();
123
125
  await tryStop(this.p2pClient);
124
126
  await tryStop(this.l2BlockSource);
127
+ await tryStop(this.publisherFactory);
125
128
  this.publisher?.interrupt();
126
129
  await Promise.all(Array.from(this.jobs.values()).map((job)=>job.stop()));
127
130
  await this.worldState.stop();
@@ -288,9 +291,10 @@ import { ProverNodeJobMetrics, ProverNodeRewardsMetrics } from './metrics.js';
288
291
  return header;
289
292
  }
290
293
  /** Extracted for testing purposes. */ doCreateEpochProvingJob(data, deadline, publicProcessorFactory, publisher, opts = {}) {
291
- const { proverNodeMaxParallelBlocksPerEpoch: parallelBlockLimit } = this.config;
294
+ const { proverNodeMaxParallelBlocksPerEpoch: parallelBlockLimit, proverNodeDisableProofPublish } = this.config;
292
295
  return new EpochProvingJob(data, this.worldState, this.prover.createEpochProver(), publicProcessorFactory, publisher, this.l2BlockSource, this.jobMetrics, deadline, {
293
296
  parallelBlockLimit,
297
+ skipSubmitProof: proverNodeDisableProofPublish,
294
298
  ...opts
295
299
  });
296
300
  }
@@ -10,6 +10,8 @@ export declare class ProverPublisherFactory {
10
10
  publisherManager: PublisherManager<L1TxUtils>;
11
11
  telemetry?: TelemetryClient;
12
12
  });
13
+ start(): Promise<void>;
14
+ stop(): void;
13
15
  /**
14
16
  * Creates a new Prover Publisher instance.
15
17
  * @returns A new ProverNodePublisher instance.
@@ -1 +1 @@
1
- {"version":3,"file":"prover-publisher-factory.d.ts","sourceRoot":"","sources":["../src/prover-publisher-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;gBADJ,MAAM,EAAE,cAAc,GAAG,eAAe,EACxC,IAAI,EAAE;QACZ,cAAc,EAAE,cAAc,CAAC;QAC/B,gBAAgB,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC9C,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B;IAEH;;;OAGG;IACU,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAQpD"}
1
+ {"version":3,"file":"prover-publisher-factory.d.ts","sourceRoot":"","sources":["../src/prover-publisher-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;gBADJ,MAAM,EAAE,cAAc,GAAG,eAAe,EACxC,IAAI,EAAE;QACZ,cAAc,EAAE,cAAc,CAAC;QAC/B,gBAAgB,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC9C,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B;IAGU,KAAK;IAIX,IAAI;IAIX;;;OAGG;IACU,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAQpD"}
@@ -6,6 +6,12 @@ export class ProverPublisherFactory {
6
6
  this.config = config;
7
7
  this.deps = deps;
8
8
  }
9
+ async start() {
10
+ await this.deps.publisherManager.loadState();
11
+ }
12
+ stop() {
13
+ this.deps.publisherManager.interrupt();
14
+ }
9
15
  /**
10
16
  * Creates a new Prover Publisher instance.
11
17
  * @returns A new ProverNodePublisher instance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/prover-node",
3
- "version": "2.0.3",
3
+ "version": "2.1.0-rc.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -56,27 +56,27 @@
56
56
  ]
57
57
  },
58
58
  "dependencies": {
59
- "@aztec/archiver": "2.0.3",
60
- "@aztec/bb-prover": "2.0.3",
61
- "@aztec/blob-lib": "2.0.3",
62
- "@aztec/blob-sink": "2.0.3",
63
- "@aztec/constants": "2.0.3",
64
- "@aztec/epoch-cache": "2.0.3",
65
- "@aztec/ethereum": "2.0.3",
66
- "@aztec/foundation": "2.0.3",
67
- "@aztec/kv-store": "2.0.3",
68
- "@aztec/l1-artifacts": "2.0.3",
69
- "@aztec/node-keystore": "2.0.3",
70
- "@aztec/node-lib": "2.0.3",
71
- "@aztec/noir-protocol-circuits-types": "2.0.3",
72
- "@aztec/p2p": "2.0.3",
73
- "@aztec/protocol-contracts": "2.0.3",
74
- "@aztec/prover-client": "2.0.3",
75
- "@aztec/sequencer-client": "2.0.3",
76
- "@aztec/simulator": "2.0.3",
77
- "@aztec/stdlib": "2.0.3",
78
- "@aztec/telemetry-client": "2.0.3",
79
- "@aztec/world-state": "2.0.3",
59
+ "@aztec/archiver": "2.1.0-rc.2",
60
+ "@aztec/bb-prover": "2.1.0-rc.2",
61
+ "@aztec/blob-lib": "2.1.0-rc.2",
62
+ "@aztec/blob-sink": "2.1.0-rc.2",
63
+ "@aztec/constants": "2.1.0-rc.2",
64
+ "@aztec/epoch-cache": "2.1.0-rc.2",
65
+ "@aztec/ethereum": "2.1.0-rc.2",
66
+ "@aztec/foundation": "2.1.0-rc.2",
67
+ "@aztec/kv-store": "2.1.0-rc.2",
68
+ "@aztec/l1-artifacts": "2.1.0-rc.2",
69
+ "@aztec/node-keystore": "2.1.0-rc.2",
70
+ "@aztec/node-lib": "2.1.0-rc.2",
71
+ "@aztec/noir-protocol-circuits-types": "2.1.0-rc.2",
72
+ "@aztec/p2p": "2.1.0-rc.2",
73
+ "@aztec/protocol-contracts": "2.1.0-rc.2",
74
+ "@aztec/prover-client": "2.1.0-rc.2",
75
+ "@aztec/sequencer-client": "2.1.0-rc.2",
76
+ "@aztec/simulator": "2.1.0-rc.2",
77
+ "@aztec/stdlib": "2.1.0-rc.2",
78
+ "@aztec/telemetry-client": "2.1.0-rc.2",
79
+ "@aztec/world-state": "2.1.0-rc.2",
80
80
  "source-map-support": "^0.5.21",
81
81
  "tslib": "^2.4.0",
82
82
  "viem": "2.23.7"
package/src/config.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
2
2
  import type { ACVMConfig, BBConfig } from '@aztec/bb-prover/config';
3
3
  import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum';
4
- import { type ConfigMappingsType, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
4
+ import {
5
+ type ConfigMappingsType,
6
+ booleanConfigHelper,
7
+ getConfigFromMappings,
8
+ numberConfigHelper,
9
+ } from '@aztec/foundation/config';
5
10
  import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
6
11
  import { type KeyStore, type KeyStoreConfig, ethPrivateKeySchema, keyStoreConfigMappings } from '@aztec/node-keystore';
7
12
  import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
@@ -38,6 +43,8 @@ export type SpecificProverNodeConfig = {
38
43
  proverNodePollingIntervalMs: number;
39
44
  proverNodeMaxParallelBlocksPerEpoch: number;
40
45
  proverNodeFailedEpochStore: string | undefined;
46
+ proverNodeDisableProofPublish?: boolean;
47
+ proverNodeEpochProvingDelayMs: number | undefined;
41
48
  txGatheringTimeoutMs: number;
42
49
  txGatheringIntervalMs: number;
43
50
  txGatheringBatchSize: number;
@@ -65,6 +72,10 @@ const specificProverNodeConfigMappings: ConfigMappingsType<SpecificProverNodeCon
65
72
  description: 'File store where to upload node state when an epoch fails to be proven',
66
73
  defaultValue: undefined,
67
74
  },
75
+ proverNodeEpochProvingDelayMs: {
76
+ description: 'Optional delay in milliseconds to wait before proving a new epoch',
77
+ defaultValue: undefined,
78
+ },
68
79
  txGatheringIntervalMs: {
69
80
  env: 'PROVER_NODE_TX_GATHERING_INTERVAL_MS',
70
81
  description: 'How often to check that tx data is available',
@@ -85,6 +96,11 @@ const specificProverNodeConfigMappings: ConfigMappingsType<SpecificProverNodeCon
85
96
  description: 'How long to wait for tx data to be available before giving up',
86
97
  ...numberConfigHelper(120_000),
87
98
  },
99
+ proverNodeDisableProofPublish: {
100
+ env: 'PROVER_NODE_DISABLE_PROOF_PUBLISH',
101
+ description: 'Whether the prover node skips publishing proofs to L1',
102
+ ...booleanConfigHelper(false),
103
+ },
88
104
  };
89
105
 
90
106
  export const proverNodeConfigMappings: ConfigMappingsType<ProverNodeConfig> = {
@@ -118,7 +134,7 @@ export function getProverNodeAgentConfigFromEnv(): ProverAgentConfig & BBConfig
118
134
  };
119
135
  }
120
136
 
121
- function createKeyStoreFromWeb3Signer(config: ProverNodeConfig) {
137
+ function createKeyStoreFromWeb3Signer(config: ProverNodeConfig): KeyStore | undefined {
122
138
  // If we don't have a valid prover Id then we can't build a valid key store with remote signers
123
139
  if (config.proverId === undefined) {
124
140
  return undefined;
@@ -144,7 +160,7 @@ function createKeyStoreFromWeb3Signer(config: ProverNodeConfig) {
144
160
  return keyStore;
145
161
  }
146
162
 
147
- function createKeyStoreFromPublisherKeys(config: ProverNodeConfig) {
163
+ function createKeyStoreFromPublisherKeys(config: ProverNodeConfig): KeyStore | undefined {
148
164
  // Extract the publisher keys from the provided config.
149
165
  const publisherKeys = config.publisherPrivateKeys
150
166
  ? config.publisherPrivateKeys.map(k => ethPrivateKeySchema.parse(k.getValue()))
@@ -174,7 +190,7 @@ function createKeyStoreFromPublisherKeys(config: ProverNodeConfig) {
174
190
  return keyStore;
175
191
  }
176
192
 
177
- export function createKeyStoreForProver(config: ProverNodeConfig) {
193
+ export function createKeyStoreForProver(config: ProverNodeConfig): KeyStore | undefined {
178
194
  if (config.web3SignerUrl !== undefined && config.web3SignerUrl.length > 0) {
179
195
  return createKeyStoreFromWeb3Signer(config);
180
196
  }
package/src/factory.ts CHANGED
@@ -2,20 +2,14 @@ import { type Archiver, createArchiver } from '@aztec/archiver';
2
2
  import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
3
3
  import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
4
4
  import { EpochCache } from '@aztec/epoch-cache';
5
- import {
6
- type EthSigner,
7
- L1TxUtils,
8
- PublisherManager,
9
- RollupContract,
10
- createEthereumChain,
11
- createL1TxUtilsFromEthSigner,
12
- } from '@aztec/ethereum';
5
+ import { L1TxUtils, PublisherManager, RollupContract, createEthereumChain } from '@aztec/ethereum';
13
6
  import { pick } from '@aztec/foundation/collection';
14
7
  import { type Logger, createLogger } from '@aztec/foundation/log';
15
8
  import { DateProvider } from '@aztec/foundation/timer';
16
9
  import type { DataStoreConfig } from '@aztec/kv-store/config';
17
10
  import { type KeyStoreConfig, KeystoreManager, loadKeystores, mergeKeystores } from '@aztec/node-keystore';
18
11
  import { trySnapshotSync } from '@aztec/node-lib/actions';
12
+ import { createL1TxUtilsFromEthSignerWithStore } from '@aztec/node-lib/factories';
19
13
  import { NodeRpcTxSource, createP2PClient } from '@aztec/p2p';
20
14
  import { type ProverClientConfig, createProverClient } from '@aztec/prover-client';
21
15
  import { createAndStartProvingBroker } from '@aztec/prover-client/broker';
@@ -73,6 +67,8 @@ export async function createProverNode(
73
67
  }
74
68
  }
75
69
 
70
+ await keyStoreManager?.validateSigners();
71
+
76
72
  // Extract the prover signers from the key store and verify that we have one.
77
73
  const proverSigners = keyStoreManager?.createProverSigners();
78
74
 
@@ -133,15 +129,18 @@ export async function createProverNode(
133
129
 
134
130
  const l1TxUtils = deps.l1TxUtils
135
131
  ? [deps.l1TxUtils]
136
- : proverSigners.signers.map((signer: EthSigner) => {
137
- return createL1TxUtilsFromEthSigner(publicClient, signer, log, dateProvider, config);
138
- });
132
+ : await createL1TxUtilsFromEthSignerWithStore(
133
+ publicClient,
134
+ proverSigners.signers,
135
+ { ...config, scope: 'prover' },
136
+ { telemetry, logger: log.createChild('l1-tx-utils'), dateProvider },
137
+ );
139
138
 
140
139
  const publisherFactory =
141
140
  deps.publisherFactory ??
142
141
  new ProverPublisherFactory(config, {
143
142
  rollupContract,
144
- publisherManager: new PublisherManager(l1TxUtils),
143
+ publisherManager: new PublisherManager(l1TxUtils, config),
145
144
  telemetry,
146
145
  });
147
146
 
@@ -175,6 +174,7 @@ export async function createProverNode(
175
174
  'proverNodeMaxPendingJobs',
176
175
  'proverNodeMaxParallelBlocksPerEpoch',
177
176
  'proverNodePollingIntervalMs',
177
+ 'proverNodeEpochProvingDelayMs',
178
178
  'txGatheringMaxParallelRequests',
179
179
  'txGatheringIntervalMs',
180
180
  'txGatheringTimeoutMs',
@@ -187,7 +187,7 @@ export async function createProverNode(
187
187
 
188
188
  const epochMonitor = await EpochMonitor.create(
189
189
  archiver,
190
- { pollingIntervalMs: config.proverNodePollingIntervalMs },
190
+ { pollingIntervalMs: config.proverNodePollingIntervalMs, provingDelayMs: config.proverNodeEpochProvingDelayMs },
191
191
  telemetry,
192
192
  );
193
193
 
@@ -24,6 +24,12 @@ import type { ProverNodeJobMetrics } from '../metrics.js';
24
24
  import type { ProverNodePublisher } from '../prover-node-publisher.js';
25
25
  import { type EpochProvingJobData, validateEpochProvingJobData } from './epoch-proving-job-data.js';
26
26
 
27
+ export type EpochProvingJobOptions = {
28
+ parallelBlockLimit?: number;
29
+ skipEpochCheck?: boolean;
30
+ skipSubmitProof?: boolean;
31
+ };
32
+
27
33
  /**
28
34
  * Job that grabs a range of blocks from the unfinalized chain from L1, gets their txs given their hashes,
29
35
  * re-executes their public calls, generates a rollup proof, and submits it to L1. This job will update the
@@ -49,7 +55,7 @@ export class EpochProvingJob implements Traceable {
49
55
  private l2BlockSource: L2BlockSource | undefined,
50
56
  private metrics: ProverNodeJobMetrics,
51
57
  private deadline: Date | undefined,
52
- private config: { parallelBlockLimit?: number; skipEpochCheck?: boolean },
58
+ private config: EpochProvingJobOptions,
53
59
  ) {
54
60
  validateEpochProvingJobData(data);
55
61
  this.uuid = crypto.randomUUID();
@@ -178,6 +184,15 @@ export class EpochProvingJob implements Traceable {
178
184
 
179
185
  this.progressState('publishing-proof');
180
186
 
187
+ if (this.config.skipSubmitProof) {
188
+ this.log.info(
189
+ `Proof publishing is disabled. Dropping valid proof for epoch ${epochNumber} (blocks ${fromBlock} to ${toBlock})`,
190
+ );
191
+ this.state = 'completed';
192
+ this.metrics.recordProvingJob(executionTime, timer.ms(), epochSizeBlocks, epochSizeTxs);
193
+ return;
194
+ }
195
+
181
196
  const success = await this.publisher.submitEpochProof({
182
197
  fromBlock,
183
198
  toBlock,
package/src/metrics.ts CHANGED
@@ -91,7 +91,7 @@ export class ProverNodeRewardsMetrics {
91
91
  }
92
92
 
93
93
  private observe = async (observer: BatchObservableResult): Promise<void> => {
94
- const epoch = await this.rollup.getEpochNumber();
94
+ const epoch = await this.rollup.getCurrentEpochNumber();
95
95
 
96
96
  if (epoch > this.proofSubmissionEpochs) {
97
97
  // look at the prev epoch so that we get an accurate value, after proof submission window has closed
@@ -1,5 +1,6 @@
1
1
  import { createLogger } from '@aztec/foundation/log';
2
2
  import { RunningPromise } from '@aztec/foundation/running-promise';
3
+ import { sleep } from '@aztec/foundation/sleep';
3
4
  import type { L2BlockSource } from '@aztec/stdlib/block';
4
5
  import { type L1RollupConstants, getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
5
6
  import {
@@ -36,16 +37,19 @@ export class EpochMonitor implements Traceable {
36
37
  constructor(
37
38
  private readonly l2BlockSource: L2BlockSource,
38
39
  private readonly l1Constants: Pick<L1RollupConstants, 'epochDuration'>,
39
- private options: { pollingIntervalMs: number },
40
+ private options: { pollingIntervalMs: number; provingDelayMs?: number },
40
41
  telemetry: TelemetryClient = getTelemetryClient(),
41
42
  ) {
42
43
  this.tracer = telemetry.getTracer('EpochMonitor');
43
44
  this.runningPromise = new RunningPromise(this.work.bind(this), this.log, this.options.pollingIntervalMs);
45
+ if (this.options.provingDelayMs) {
46
+ this.log.warn(`Prover node epoch monitor running with delay of ${this.options.provingDelayMs}ms`);
47
+ }
44
48
  }
45
49
 
46
50
  public static async create(
47
51
  l2BlockSource: L2BlockSource,
48
- options: { pollingIntervalMs: number },
52
+ options: { pollingIntervalMs: number; provingDelayMs?: number },
49
53
  telemetry: TelemetryClient = getTelemetryClient(),
50
54
  ): Promise<EpochMonitor> {
51
55
  const l1Constants = await l2BlockSource.getL1Constants();
@@ -87,6 +91,11 @@ export class EpochMonitor implements Traceable {
87
91
  return;
88
92
  }
89
93
 
94
+ if (this.options.provingDelayMs) {
95
+ this.log.debug(`Waiting ${this.options.provingDelayMs}ms before proving epoch ${epochToProve}`);
96
+ await sleep(this.options.provingDelayMs);
97
+ }
98
+
90
99
  this.log.debug(`Epoch ${epochToProve} is ready to be proven`);
91
100
  if (await this.handler?.handleEpochReadyToProve(epochToProve)) {
92
101
  this.latestEpochNumber = epochToProve;
@@ -1,21 +1,16 @@
1
1
  import { type BatchedBlob, FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
- import {
4
- type L1TxUtils,
5
- type RollupContract,
6
- RollupContract as RollupContractClass,
7
- type ViemCommitteeAttestation,
8
- } from '@aztec/ethereum';
3
+ import type { L1TxUtils, RollupContract, ViemCommitteeAttestation } from '@aztec/ethereum';
9
4
  import { makeTuple } from '@aztec/foundation/array';
10
5
  import { areArraysEqual } from '@aztec/foundation/collection';
11
6
  import { EthAddress } from '@aztec/foundation/eth-address';
12
7
  import { Fr } from '@aztec/foundation/fields';
13
8
  import { createLogger } from '@aztec/foundation/log';
14
9
  import type { Tuple } from '@aztec/foundation/serialize';
15
- import { InterruptibleSleep } from '@aztec/foundation/sleep';
16
10
  import { Timer } from '@aztec/foundation/timer';
17
11
  import { RollupAbi } from '@aztec/l1-artifacts';
18
12
  import type { PublisherConfig, TxSenderConfig } from '@aztec/sequencer-client';
13
+ import { CommitteeAttestation, CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
19
14
  import type { Proof } from '@aztec/stdlib/proofs';
20
15
  import type { FeeRecipient, RootRollupPublicInputs } from '@aztec/stdlib/rollup';
21
16
  import type { L1PublishProofStats } from '@aztec/stdlib/stats';
@@ -39,8 +34,6 @@ export type L1SubmitEpochProofArgs = {
39
34
  };
40
35
 
41
36
  export class ProverNodePublisher {
42
- private interruptibleSleep = new InterruptibleSleep();
43
- private sleepTimeMs: number;
44
37
  private interrupted = false;
45
38
  private metrics: ProverNodePublisherMetrics;
46
39
 
@@ -58,8 +51,6 @@ export class ProverNodePublisher {
58
51
  telemetry?: TelemetryClient;
59
52
  },
60
53
  ) {
61
- this.sleepTimeMs = config?.l1PublishRetryIntervalMS ?? 60_000;
62
-
63
54
  const telemetry = deps.telemetry ?? getTelemetryClient();
64
55
 
65
56
  this.metrics = new ProverNodePublisherMetrics(telemetry, 'ProverNode');
@@ -80,12 +71,13 @@ export class ProverNodePublisher {
80
71
  */
81
72
  public interrupt() {
82
73
  this.interrupted = true;
83
- this.interruptibleSleep.interrupt();
74
+ this.l1TxUtils.interrupt();
84
75
  }
85
76
 
86
77
  /** Restarts the publisher after calling `interrupt`. */
87
78
  public restart() {
88
79
  this.interrupted = false;
80
+ this.l1TxUtils.restart();
89
81
  }
90
82
 
91
83
  public getSenderAddress() {
@@ -143,7 +135,6 @@ export class ProverNodePublisher {
143
135
 
144
136
  this.metrics.recordFailedTx();
145
137
  this.log.error(`Rollup.submitEpochProof tx status failed ${txReceipt.transactionHash}`, undefined, ctx);
146
- await this.sleepOrInterrupted();
147
138
  }
148
139
 
149
140
  this.log.verbose('L2 block data syncing interrupted', ctx);
@@ -290,13 +281,11 @@ export class ProverNodePublisher {
290
281
  end: argsArray[1],
291
282
  args: argsArray[2],
292
283
  fees: argsArray[3],
293
- attestations: RollupContractClass.packAttestations(args.attestations),
284
+ attestations: new CommitteeAttestationsAndSigners(
285
+ args.attestations.map(a => CommitteeAttestation.fromViem(a)),
286
+ ).getPackedAttestations(),
294
287
  blobInputs: argsArray[4],
295
288
  proof: proofHex,
296
289
  };
297
290
  }
298
-
299
- protected async sleepOrInterrupted() {
300
- await this.interruptibleSleep.sleep(this.sleepTimeMs);
301
- }
302
291
  }
@@ -87,6 +87,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
87
87
  txGatheringMaxParallelRequestsPerNode: 100,
88
88
  txGatheringTimeoutMs: 120_000,
89
89
  proverNodeFailedEpochStore: undefined,
90
+ proverNodeEpochProvingDelayMs: undefined,
90
91
  ...compact(config),
91
92
  };
92
93
 
@@ -143,6 +144,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
143
144
  */
144
145
  async start() {
145
146
  this.epochsMonitor.start(this);
147
+ await this.publisherFactory.start();
146
148
  this.publisher = await this.publisherFactory.create();
147
149
  await this.rewardsMetrics.start();
148
150
  this.l1Metrics.start();
@@ -158,6 +160,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
158
160
  await this.prover.stop();
159
161
  await tryStop(this.p2pClient);
160
162
  await tryStop(this.l2BlockSource);
163
+ await tryStop(this.publisherFactory);
161
164
  this.publisher?.interrupt();
162
165
  await Promise.all(Array.from(this.jobs.values()).map(job => job.stop()));
163
166
  await this.worldState.stop();
@@ -366,7 +369,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
366
369
  publisher: ProverNodePublisher,
367
370
  opts: { skipEpochCheck?: boolean } = {},
368
371
  ) {
369
- const { proverNodeMaxParallelBlocksPerEpoch: parallelBlockLimit } = this.config;
372
+ const { proverNodeMaxParallelBlocksPerEpoch: parallelBlockLimit, proverNodeDisableProofPublish } = this.config;
370
373
  return new EpochProvingJob(
371
374
  data,
372
375
  this.worldState,
@@ -376,7 +379,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
376
379
  this.l2BlockSource,
377
380
  this.jobMetrics,
378
381
  deadline,
379
- { parallelBlockLimit, ...opts },
382
+ { parallelBlockLimit, skipSubmitProof: proverNodeDisableProofPublish, ...opts },
380
383
  );
381
384
  }
382
385
 
@@ -13,6 +13,15 @@ export class ProverPublisherFactory {
13
13
  telemetry?: TelemetryClient;
14
14
  },
15
15
  ) {}
16
+
17
+ public async start() {
18
+ await this.deps.publisherManager.loadState();
19
+ }
20
+
21
+ public stop() {
22
+ this.deps.publisherManager.interrupt();
23
+ }
24
+
16
25
  /**
17
26
  * Creates a new Prover Publisher instance.
18
27
  * @returns A new ProverNodePublisher instance.