@aztec/prover-client 3.0.0-nightly.20250908 → 3.0.0-nightly.20250911

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 (28) hide show
  1. package/dest/orchestrator/block-building-helpers.d.ts +8 -4
  2. package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
  3. package/dest/orchestrator/block-building-helpers.js +22 -3
  4. package/dest/orchestrator/epoch-proving-state.d.ts +3 -2
  5. package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
  6. package/dest/orchestrator/orchestrator.d.ts +1 -1
  7. package/dest/orchestrator/orchestrator.d.ts.map +1 -1
  8. package/dest/orchestrator/orchestrator.js +24 -19
  9. package/dest/orchestrator/tx-proving-state.d.ts +7 -6
  10. package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
  11. package/dest/orchestrator/tx-proving-state.js +19 -20
  12. package/dest/proving_broker/broker_prover_facade.d.ts +4 -3
  13. package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
  14. package/dest/proving_broker/broker_prover_facade.js +3 -3
  15. package/dest/proving_broker/proving_broker.js +2 -2
  16. package/dest/proving_broker/proving_job_controller.js +4 -4
  17. package/dest/test/mock_prover.d.ts +6 -5
  18. package/dest/test/mock_prover.d.ts.map +1 -1
  19. package/dest/test/mock_prover.js +5 -5
  20. package/package.json +15 -15
  21. package/src/orchestrator/block-building-helpers.ts +35 -3
  22. package/src/orchestrator/epoch-proving-state.ts +11 -3
  23. package/src/orchestrator/orchestrator.ts +46 -24
  24. package/src/orchestrator/tx-proving-state.ts +36 -37
  25. package/src/proving_broker/broker_prover_facade.ts +22 -16
  26. package/src/proving_broker/proving_broker.ts +2 -2
  27. package/src/proving_broker/proving_job_controller.ts +4 -4
  28. package/src/test/mock_prover.ts +22 -8
@@ -1,8 +1,8 @@
1
- import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH, TUBE_PROOF_LENGTH } from '@aztec/constants';
1
+ import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '@aztec/constants';
2
2
  import { times } from '@aztec/foundation/collection';
3
3
  import { makeProofAndVerificationKey, makePublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
4
4
  import { makeEmptyRecursiveProof, makeRecursiveProof } from '@aztec/stdlib/proofs';
5
- import { makeBaseOrMergeRollupPublicInputs, makeBlockRootOrBlockMergeRollupPublicInputs, makeParityPublicInputs, makeRootRollupPublicInputs } from '@aztec/stdlib/testing';
5
+ import { makeBaseOrMergeRollupPublicInputs, makeBlockRootOrBlockMergeRollupPublicInputs, makeParityPublicInputs, makePrivateToPublicKernelCircuitPublicInputs, makeRootRollupPublicInputs } from '@aztec/stdlib/testing';
6
6
  import { VerificationKeyData } from '@aztec/stdlib/vks';
7
7
  import { InlineProofStore } from '../proving_broker/proof_store/index.js';
8
8
  import { ProvingAgent } from '../proving_broker/proving_agent.js';
@@ -52,6 +52,9 @@ export class MockProver {
52
52
  getRootParityProof(_inputs, _signal, _epochNumber) {
53
53
  return Promise.resolve(makePublicInputsAndRecursiveProof(makeParityPublicInputs(), makeRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH), VerificationKeyData.makeFakeHonk()));
54
54
  }
55
+ getPublicTubeProof(_inputs, _signal, _epochNumber) {
56
+ return Promise.resolve(makePublicInputsAndRecursiveProof(makePrivateToPublicKernelCircuitPublicInputs(), makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()));
57
+ }
55
58
  getPrivateBaseRollupProof(_baseRollupInput, _signal, _epochNumber) {
56
59
  return Promise.resolve(makePublicInputsAndRecursiveProof(makeBaseOrMergeRollupPublicInputs(), makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()));
57
60
  }
@@ -79,7 +82,4 @@ export class MockProver {
79
82
  getRootRollupProof(_input, _signal, _epochNumber) {
80
83
  return Promise.resolve(makePublicInputsAndRecursiveProof(makeRootRollupPublicInputs(), makeRecursiveProof(RECURSIVE_PROOF_LENGTH), VerificationKeyData.makeFakeHonk()));
81
84
  }
82
- getTubeProof() {
83
- return Promise.resolve(makeProofAndVerificationKey(makeRecursiveProof(TUBE_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()));
84
- }
85
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/prover-client",
3
- "version": "3.0.0-nightly.20250908",
3
+ "version": "3.0.0-nightly.20250911",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -68,19 +68,19 @@
68
68
  ]
69
69
  },
70
70
  "dependencies": {
71
- "@aztec/bb-prover": "3.0.0-nightly.20250908",
72
- "@aztec/blob-lib": "3.0.0-nightly.20250908",
73
- "@aztec/constants": "3.0.0-nightly.20250908",
74
- "@aztec/ethereum": "3.0.0-nightly.20250908",
75
- "@aztec/foundation": "3.0.0-nightly.20250908",
76
- "@aztec/kv-store": "3.0.0-nightly.20250908",
77
- "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250908",
78
- "@aztec/noir-types": "3.0.0-nightly.20250908",
79
- "@aztec/protocol-contracts": "3.0.0-nightly.20250908",
80
- "@aztec/simulator": "3.0.0-nightly.20250908",
81
- "@aztec/stdlib": "3.0.0-nightly.20250908",
82
- "@aztec/telemetry-client": "3.0.0-nightly.20250908",
83
- "@aztec/world-state": "3.0.0-nightly.20250908",
71
+ "@aztec/bb-prover": "3.0.0-nightly.20250911",
72
+ "@aztec/blob-lib": "3.0.0-nightly.20250911",
73
+ "@aztec/constants": "3.0.0-nightly.20250911",
74
+ "@aztec/ethereum": "3.0.0-nightly.20250911",
75
+ "@aztec/foundation": "3.0.0-nightly.20250911",
76
+ "@aztec/kv-store": "3.0.0-nightly.20250911",
77
+ "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250911",
78
+ "@aztec/noir-types": "3.0.0-nightly.20250911",
79
+ "@aztec/protocol-contracts": "3.0.0-nightly.20250911",
80
+ "@aztec/simulator": "3.0.0-nightly.20250911",
81
+ "@aztec/stdlib": "3.0.0-nightly.20250911",
82
+ "@aztec/telemetry-client": "3.0.0-nightly.20250911",
83
+ "@aztec/world-state": "3.0.0-nightly.20250911",
84
84
  "@google-cloud/storage": "^7.15.0",
85
85
  "@iarna/toml": "^2.2.5",
86
86
  "commander": "^12.1.0",
@@ -90,7 +90,7 @@
90
90
  "zod": "^3.23.8"
91
91
  },
92
92
  "devDependencies": {
93
- "@aztec/noir-contracts.js": "3.0.0-nightly.20250908",
93
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20250911",
94
94
  "@jest/globals": "^30.0.0",
95
95
  "@types/jest": "^30.0.0",
96
96
  "@types/node": "^22.15.17",
@@ -1,6 +1,7 @@
1
1
  import { BatchedBlobAccumulator, Blob, type SpongeBlob } from '@aztec/blob-lib';
2
2
  import {
3
3
  ARCHIVE_HEIGHT,
4
+ CIVC_PROOF_LENGTH,
4
5
  MAX_CONTRACT_CLASS_LOGS_PER_TX,
5
6
  MAX_NOTE_HASHES_PER_TX,
6
7
  MAX_NULLIFIERS_PER_TX,
@@ -16,16 +17,18 @@ import { makeTuple } from '@aztec/foundation/array';
16
17
  import { padArrayEnd } from '@aztec/foundation/collection';
17
18
  import { sha256ToField, sha256Trunc } from '@aztec/foundation/crypto';
18
19
  import { BLS12Point, Fr } from '@aztec/foundation/fields';
19
- import { type Tuple, assertLength, toFriendlyJSON } from '@aztec/foundation/serialize';
20
+ import { type Bufferable, type Tuple, assertLength, toFriendlyJSON } from '@aztec/foundation/serialize';
20
21
  import { MembershipWitness, MerkleTreeCalculator, computeUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
21
- import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
22
+ import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
23
+ import { getVKIndex, getVKSiblingPath, getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
22
24
  import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
23
25
  import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
24
26
  import { PublicDataHint } from '@aztec/stdlib/avm';
25
27
  import { Body } from '@aztec/stdlib/block';
26
- import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
28
+ import type { MerkleTreeWriteOperations, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
27
29
  import { ContractClassLogFields } from '@aztec/stdlib/logs';
28
30
  import type { ParityPublicInputs } from '@aztec/stdlib/parity';
31
+ import { Proof, ProofData, RecursiveProof } from '@aztec/stdlib/proofs';
29
32
  import {
30
33
  type BaseOrMergeRollupPublicInputs,
31
34
  BlockConstantData,
@@ -33,6 +36,7 @@ import {
33
36
  PrivateBaseRollupHints,
34
37
  PrivateBaseStateDiffHints,
35
38
  PublicBaseRollupHints,
39
+ PublicTubePrivateInputs,
36
40
  } from '@aztec/stdlib/rollup';
37
41
  import {
38
42
  AppendOnlyTreeSnapshot,
@@ -49,8 +53,10 @@ import {
49
53
  PartialStateReference,
50
54
  type ProcessedTx,
51
55
  StateReference,
56
+ Tx,
52
57
  TxEffect,
53
58
  } from '@aztec/stdlib/tx';
59
+ import { VkData } from '@aztec/stdlib/vks';
54
60
  import { Attributes, type Span, runInSpan } from '@aztec/telemetry-client';
55
61
  import type { MerkleTreeReadOperations } from '@aztec/world-state';
56
62
 
@@ -246,6 +252,23 @@ export async function getPublicDataHint(db: MerkleTreeWriteOperations, leafSlot:
246
252
  return new PublicDataHint(new Fr(leafSlot), value, membershipWitness, leafPreimage);
247
253
  }
248
254
 
255
+ export function getCivcProofFromTx(tx: Tx | ProcessedTx) {
256
+ const proofFields = tx.clientIvcProof.proof;
257
+ const numPublicInputs = proofFields.length - CIVC_PROOF_LENGTH;
258
+ const binaryProof = new Proof(Buffer.concat(proofFields.map(field => field.toBuffer())), numPublicInputs);
259
+ const proofFieldsWithoutPublicInputs = proofFields.slice(numPublicInputs);
260
+ return new RecursiveProof(proofFieldsWithoutPublicInputs, binaryProof, true, CIVC_PROOF_LENGTH);
261
+ }
262
+
263
+ export function getPublicTubePrivateInputsFromTx(tx: Tx | ProcessedTx) {
264
+ const proofData = new ProofData(
265
+ tx.data.toPrivateToPublicKernelCircuitPublicInputs(),
266
+ getCivcProofFromTx(tx),
267
+ getVkData('HidingKernelToPublic'),
268
+ );
269
+ return new PublicTubePrivateInputs(proofData);
270
+ }
271
+
249
272
  export const buildBlobHints = runInSpan(
250
273
  'BlockBuilderHelpers',
251
274
  'buildBlobHints',
@@ -555,3 +578,12 @@ export function validateTx(tx: ProcessedTx) {
555
578
  throw new Error(`Empty public data tree in tx: ${toFriendlyJSON(tx)}`);
556
579
  }
557
580
  }
581
+
582
+ export function toProofData<T extends Bufferable, PROOF_LENGTH extends number>(
583
+ { inputs, proof, verificationKey }: PublicInputsAndRecursiveProof<T, PROOF_LENGTH>,
584
+ vkIndex?: number,
585
+ ) {
586
+ const leafIndex = vkIndex || getVKIndex(verificationKey.keyAsFields);
587
+ const vkData = new VkData(verificationKey, leafIndex, getVKSiblingPath(leafIndex));
588
+ return new ProofData(inputs, proof, vkData);
589
+ }
@@ -3,14 +3,14 @@ import type {
3
3
  ARCHIVE_HEIGHT,
4
4
  L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH,
5
5
  NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
6
- TUBE_PROOF_LENGTH,
7
6
  } from '@aztec/constants';
8
7
  import type { EthAddress } from '@aztec/foundation/eth-address';
9
8
  import type { Fr } from '@aztec/foundation/fields';
10
9
  import type { Tuple } from '@aztec/foundation/serialize';
11
10
  import { type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees';
12
11
  import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
13
- import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
12
+ import type { PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
13
+ import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
14
14
  import type { Proof } from '@aztec/stdlib/proofs';
15
15
  import {
16
16
  BlockMergeRollupInputs,
@@ -54,7 +54,15 @@ export class EpochProvingState {
54
54
  private provingStateLifecycle = PROVING_STATE_LIFECYCLE.PROVING_STATE_CREATED;
55
55
 
56
56
  // Map from tx hash to tube proof promise. Used when kickstarting tube proofs before tx processing.
57
- public readonly cachedTubeProofs = new Map<string, Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>>>();
57
+ public readonly cachedTubeProofs = new Map<
58
+ string,
59
+ Promise<
60
+ PublicInputsAndRecursiveProof<
61
+ PrivateToPublicKernelCircuitPublicInputs,
62
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
63
+ >
64
+ >
65
+ >();
58
66
 
59
67
  public blocks: (BlockProvingState | undefined)[] = [];
60
68
 
@@ -2,9 +2,9 @@ import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec
2
2
  import {
3
3
  L1_TO_L2_MSG_SUBTREE_HEIGHT,
4
4
  L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH,
5
+ NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
5
6
  NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
6
7
  NUM_BASE_PARITY_PER_ROOT_PARITY,
7
- type TUBE_PROOF_LENGTH,
8
8
  } from '@aztec/constants';
9
9
  import { padArrayEnd, times } from '@aztec/foundation/collection';
10
10
  import { AbortError } from '@aztec/foundation/error';
@@ -22,16 +22,17 @@ import type {
22
22
  EpochProver,
23
23
  ForkMerkleTreeOperations,
24
24
  MerkleTreeWriteOperations,
25
- ProofAndVerificationKey,
25
+ PublicInputsAndRecursiveProof,
26
26
  ServerCircuitProver,
27
27
  } from '@aztec/stdlib/interfaces/server';
28
+ import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
28
29
  import { BaseParityInputs } from '@aztec/stdlib/parity';
29
30
  import {
30
31
  type BaseRollupHints,
31
32
  EmptyBlockRootRollupInputs,
32
33
  PrivateBaseRollupInputs,
34
+ PublicTubePrivateInputs,
33
35
  SingleTxBlockRootRollupInputs,
34
- TubeInputs,
35
36
  } from '@aztec/stdlib/rollup';
36
37
  import type { CircuitName } from '@aztec/stdlib/stats';
37
38
  import { type AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
@@ -50,6 +51,7 @@ import { inspect } from 'util';
50
51
  import {
51
52
  buildHeaderAndBodyFromTxs,
52
53
  getLastSiblingPath,
54
+ getPublicTubePrivateInputsFromTx,
53
55
  getRootTreeSiblingPath,
54
56
  getSubtreeSiblingPath,
55
57
  getTreeSnapshot,
@@ -230,10 +232,13 @@ export class ProvingOrchestrator implements EpochProver {
230
232
  const [hints, treeSnapshots] = await this.prepareTransaction(tx, provingState);
231
233
  const txProvingState = new TxProvingState(tx, hints, treeSnapshots);
232
234
  const txIndex = provingState.addNewTx(txProvingState);
233
- this.getOrEnqueueTube(provingState, txIndex);
234
235
  if (txProvingState.requireAvmProof) {
236
+ this.getOrEnqueueTube(provingState, txIndex);
235
237
  logger.debug(`Enqueueing public VM for tx ${txIndex}`);
236
238
  this.enqueueVM(provingState, txIndex);
239
+ } else {
240
+ logger.debug(`Enqueueing base rollup for private-only tx ${txIndex}`);
241
+ this.enqueueBaseRollup(provingState, txIndex);
237
242
  }
238
243
  } catch (err: any) {
239
244
  throw new Error(`Error adding transaction ${tx.hash.toString()} to block ${blockNumber}: ${err.message}`, {
@@ -252,12 +257,21 @@ export class ProvingOrchestrator implements EpochProver {
252
257
  if (!this.provingState?.verifyState()) {
253
258
  throw new Error(`Invalid proving state, call startNewEpoch before starting tube circuits`);
254
259
  }
255
- for (const tx of txs) {
260
+ const publicTxs = txs.filter(tx => tx.data.forPublic);
261
+ for (const tx of publicTxs) {
256
262
  const txHash = tx.getTxHash().toString();
257
- const tubeInputs = new TubeInputs(!!tx.data.forPublic, tx.clientIvcProof);
258
- const tubeProof = promiseWithResolvers<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>>();
263
+ const privateInputs = getPublicTubePrivateInputsFromTx(tx);
264
+ const tubeProof =
265
+ promiseWithResolvers<
266
+ PublicInputsAndRecursiveProof<
267
+ PrivateToPublicKernelCircuitPublicInputs,
268
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
269
+ >
270
+ >();
259
271
  logger.debug(`Starting tube circuit for tx ${txHash}`);
260
- this.doEnqueueTube(txHash, tubeInputs, proof => tubeProof.resolve(proof));
272
+ this.doEnqueueTube(txHash, privateInputs, proof => {
273
+ tubeProof.resolve(proof);
274
+ });
261
275
  this.provingState?.cachedTubeProofs.set(txHash, tubeProof.promise);
262
276
  }
263
277
  return Promise.resolve();
@@ -519,8 +533,6 @@ export class ProvingOrchestrator implements EpochProver {
519
533
 
520
534
  const db = this.dbs.get(provingState.blockNumber)!;
521
535
 
522
- // We build the base rollup inputs using a mock proof and verification key.
523
- // These will be overwritten later once we have proven the tube circuit and any public kernels
524
536
  const [ms, hints] = await elapsed(
525
537
  insertSideEffectsAndBuildBaseRollupHints(
526
538
  tx,
@@ -593,8 +605,8 @@ export class ProvingOrchestrator implements EpochProver {
593
605
  );
594
606
  }
595
607
 
596
- // Enqueues the tube circuit for a given transaction index, or reuses the one already enqueued
597
- // Once completed, will enqueue the next circuit, either a public kernel or the base rollup
608
+ // Enqueues the public tube circuit for a given transaction index, or reuses the one already enqueued.
609
+ // Once completed, will enqueue the the public tx base rollup.
598
610
  private getOrEnqueueTube(provingState: BlockProvingState, txIndex: number) {
599
611
  if (!provingState.verifyState()) {
600
612
  logger.debug('Not running tube circuit, state invalid');
@@ -603,12 +615,17 @@ export class ProvingOrchestrator implements EpochProver {
603
615
 
604
616
  const txProvingState = provingState.getTxProvingState(txIndex);
605
617
  const txHash = txProvingState.processedTx.hash.toString();
606
-
607
- const handleResult = (result: ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>) => {
618
+ NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH;
619
+ const handleResult = (
620
+ result: PublicInputsAndRecursiveProof<
621
+ PrivateToPublicKernelCircuitPublicInputs,
622
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
623
+ >,
624
+ ) => {
608
625
  logger.debug(`Got tube proof for tx index: ${txIndex}`, { txHash });
609
- txProvingState.setTubeProof(result);
626
+ txProvingState.setPublicTubeProof(result);
610
627
  this.provingState?.cachedTubeProofs.delete(txHash);
611
- this.checkAndEnqueueNextTxCircuit(provingState, txIndex);
628
+ this.checkAndEnqueueBaseRollup(provingState, txIndex);
612
629
  };
613
630
 
614
631
  if (this.provingState?.cachedTubeProofs.has(txHash)) {
@@ -618,13 +635,18 @@ export class ProvingOrchestrator implements EpochProver {
618
635
  }
619
636
 
620
637
  logger.debug(`Enqueuing tube circuit for tx index: ${txIndex}`);
621
- this.doEnqueueTube(txHash, txProvingState.getTubeInputs(), handleResult);
638
+ this.doEnqueueTube(txHash, txProvingState.getPublicTubePrivateInputs(), handleResult);
622
639
  }
623
640
 
624
641
  private doEnqueueTube(
625
642
  txHash: string,
626
- inputs: TubeInputs,
627
- handler: (result: ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>) => void,
643
+ inputs: PublicTubePrivateInputs,
644
+ handler: (
645
+ result: PublicInputsAndRecursiveProof<
646
+ PrivateToPublicKernelCircuitPublicInputs,
647
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
648
+ >,
649
+ ) => void,
628
650
  provingState: EpochProvingState | BlockProvingState = this.provingState!,
629
651
  ) {
630
652
  if (!provingState?.verifyState()) {
@@ -636,12 +658,12 @@ export class ProvingOrchestrator implements EpochProver {
636
658
  provingState,
637
659
  wrapCallbackInSpan(
638
660
  this.tracer,
639
- 'ProvingOrchestrator.prover.getTubeProof',
661
+ 'ProvingOrchestrator.prover.getPublicTubeProof',
640
662
  {
641
663
  [Attributes.TX_HASH]: txHash,
642
- [Attributes.PROTOCOL_CIRCUIT_NAME]: 'tube-circuit' satisfies CircuitName,
664
+ [Attributes.PROTOCOL_CIRCUIT_NAME]: 'public-tube' satisfies CircuitName,
643
665
  },
644
- signal => this.prover.getTubeProof(inputs, signal, this.provingState!.epochNumber),
666
+ signal => this.prover.getPublicTubeProof(inputs, signal, this.provingState!.epochNumber),
645
667
  ),
646
668
  handler,
647
669
  );
@@ -1012,11 +1034,11 @@ export class ProvingOrchestrator implements EpochProver {
1012
1034
  this.deferredProving(provingState, doAvmProving, proofAndVk => {
1013
1035
  logger.debug(`Proven VM for tx index: ${txIndex}`);
1014
1036
  txProvingState.setAvmProof(proofAndVk);
1015
- this.checkAndEnqueueNextTxCircuit(provingState, txIndex);
1037
+ this.checkAndEnqueueBaseRollup(provingState, txIndex);
1016
1038
  });
1017
1039
  }
1018
1040
 
1019
- private checkAndEnqueueNextTxCircuit(provingState: BlockProvingState, txIndex: number) {
1041
+ private checkAndEnqueueBaseRollup(provingState: BlockProvingState, txIndex: number) {
1020
1042
  const txProvingState = provingState.getTxProvingState(txIndex);
1021
1043
  if (!txProvingState.ready()) {
1022
1044
  return;
@@ -1,36 +1,39 @@
1
1
  import {
2
2
  AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
3
3
  AVM_VK_INDEX,
4
- PRIVATE_TUBE_VK_INDEX,
5
- PUBLIC_TUBE_VK_INDEX,
6
- type TUBE_PROOF_LENGTH,
4
+ NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
7
5
  } from '@aztec/constants';
6
+ import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
8
7
  import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
9
8
  import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
10
- import type { ProofAndVerificationKey } from '@aztec/stdlib/interfaces/server';
9
+ import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
10
+ import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
11
+ import { ProofData } from '@aztec/stdlib/proofs';
11
12
  import {
12
13
  AvmProofData,
13
14
  type BaseRollupHints,
14
15
  PrivateBaseRollupHints,
15
16
  PrivateBaseRollupInputs,
16
- PrivateTubeData,
17
17
  PublicBaseRollupHints,
18
18
  PublicBaseRollupInputs,
19
- PublicTubeData,
20
- TubeInputs,
21
19
  } from '@aztec/stdlib/rollup';
22
20
  import type { CircuitName } from '@aztec/stdlib/stats';
23
21
  import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
24
22
  import type { ProcessedTx } from '@aztec/stdlib/tx';
25
23
  import { VerificationKeyData, VkData } from '@aztec/stdlib/vks';
26
24
 
25
+ import { getCivcProofFromTx, getPublicTubePrivateInputsFromTx, toProofData } from './block-building-helpers.js';
26
+
27
27
  /**
28
28
  * Helper class to manage the proving cycle of a transaction
29
29
  * This includes the public VMs and the public kernels
30
30
  * Also stores the inputs to the base rollup for this transaction and the tree snapshots
31
31
  */
32
32
  export class TxProvingState {
33
- private tube?: ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>;
33
+ private publicTube?: PublicInputsAndRecursiveProof<
34
+ PrivateToPublicKernelCircuitPublicInputs,
35
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
36
+ >;
34
37
  private avm?: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>;
35
38
 
36
39
  constructor(
@@ -44,17 +47,17 @@ export class TxProvingState {
44
47
  }
45
48
 
46
49
  public ready() {
47
- return !!this.tube && (!this.requireAvmProof || !!this.avm);
48
- }
49
-
50
- public getTubeInputs() {
51
- return new TubeInputs(!!this.processedTx.data.forPublic, this.processedTx.clientIvcProof);
50
+ return !this.requireAvmProof || (!!this.avm && !!this.publicTube);
52
51
  }
53
52
 
54
53
  public getAvmInputs(): AvmCircuitInputs {
55
54
  return this.processedTx.avmProvingRequest!.inputs;
56
55
  }
57
56
 
57
+ public getPublicTubePrivateInputs() {
58
+ return getPublicTubePrivateInputsFromTx(this.processedTx);
59
+ }
60
+
58
61
  public getBaseRollupTypeAndInputs() {
59
62
  if (this.requireAvmProof) {
60
63
  return {
@@ -69,8 +72,13 @@ export class TxProvingState {
69
72
  }
70
73
  }
71
74
 
72
- public setTubeProof(tubeProofAndVk: ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>) {
73
- this.tube = tubeProofAndVk;
75
+ public setPublicTubeProof(
76
+ publicTubeProofAndVk: PublicInputsAndRecursiveProof<
77
+ PrivateToPublicKernelCircuitPublicInputs,
78
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
79
+ >,
80
+ ) {
81
+ this.publicTube = publicTubeProofAndVk;
74
82
  }
75
83
 
76
84
  public setAvmProof(avmProofAndVk: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>) {
@@ -78,39 +86,34 @@ export class TxProvingState {
78
86
  }
79
87
 
80
88
  #getPrivateBaseInputs() {
81
- if (!this.tube) {
82
- throw new Error('Tx not ready for proving base rollup.');
89
+ if (!(this.baseRollupHints instanceof PrivateBaseRollupHints)) {
90
+ throw new Error('Mismatched base rollup hints, expected private base rollup hints');
83
91
  }
84
92
 
85
- const vkData = this.#getVkData(this.tube!.verificationKey, PRIVATE_TUBE_VK_INDEX);
86
- const tubeData = new PrivateTubeData(
93
+ const privateTailProofData = new ProofData(
87
94
  this.processedTx.data.toPrivateToRollupKernelCircuitPublicInputs(),
88
- this.tube.proof,
89
- vkData,
95
+ getCivcProofFromTx(this.processedTx),
96
+ getVkData('HidingKernelToRollup'),
90
97
  );
91
98
 
92
- if (!(this.baseRollupHints instanceof PrivateBaseRollupHints)) {
93
- throw new Error('Mismatched base rollup hints, expected private base rollup hints');
94
- }
95
- return new PrivateBaseRollupInputs(tubeData, this.baseRollupHints);
99
+ return new PrivateBaseRollupInputs(privateTailProofData, this.baseRollupHints);
96
100
  }
97
101
 
98
102
  #getPublicBaseInputs() {
99
103
  if (!this.processedTx.avmProvingRequest) {
100
104
  throw new Error('Should create private base rollup for a tx not requiring avm proof.');
101
105
  }
102
- if (!this.tube) {
103
- throw new Error('Tx not ready for proving base rollup: tube proof undefined');
106
+ if (!this.publicTube) {
107
+ throw new Error('Tx not ready for proving base rollup: public tube proof undefined');
104
108
  }
105
109
  if (!this.avm) {
106
110
  throw new Error('Tx not ready for proving base rollup: avm proof undefined');
107
111
  }
112
+ if (!(this.baseRollupHints instanceof PublicBaseRollupHints)) {
113
+ throw new Error('Mismatched base rollup hints, expected public base rollup hints');
114
+ }
108
115
 
109
- const tubeData = new PublicTubeData(
110
- this.processedTx.data.toPrivateToPublicKernelCircuitPublicInputs(),
111
- this.tube.proof,
112
- this.#getVkData(this.tube!.verificationKey, PUBLIC_TUBE_VK_INDEX),
113
- );
116
+ const publicTubeProofData = toProofData(this.publicTube);
114
117
 
115
118
  const avmProofData = new AvmProofData(
116
119
  this.processedTx.avmProvingRequest.inputs.publicInputs,
@@ -118,11 +121,7 @@ export class TxProvingState {
118
121
  this.#getVkData(this.avm!.verificationKey, AVM_VK_INDEX),
119
122
  );
120
123
 
121
- if (!(this.baseRollupHints instanceof PublicBaseRollupHints)) {
122
- throw new Error('Mismatched base rollup hints, expected public base rollup hints');
123
- }
124
-
125
- return new PublicBaseRollupInputs(tubeData, avmProofData, this.baseRollupHints);
124
+ return new PublicBaseRollupInputs(publicTubeProofData, avmProofData, this.baseRollupHints);
126
125
  }
127
126
 
128
127
  #getVkData(verificationKey: VerificationKeyData, vkIndex: number) {
@@ -3,7 +3,6 @@ import type {
3
3
  NESTED_RECURSIVE_PROOF_LENGTH,
4
4
  NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
5
5
  RECURSIVE_PROOF_LENGTH,
6
- TUBE_PROOF_LENGTH,
7
6
  } from '@aztec/constants';
8
7
  import { sha256 } from '@aztec/foundation/crypto';
9
8
  import { Fr } from '@aztec/foundation/fields';
@@ -23,6 +22,7 @@ import {
23
22
  type ServerCircuitProver,
24
23
  makeProvingJobId,
25
24
  } from '@aztec/stdlib/interfaces/server';
25
+ import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
26
26
  import type { BaseParityInputs, ParityPublicInputs, RootParityInputs } from '@aztec/stdlib/parity';
27
27
  import { ProvingRequestType } from '@aztec/stdlib/proofs';
28
28
  import type {
@@ -35,10 +35,10 @@ import type {
35
35
  PaddingBlockRootRollupInputs,
36
36
  PrivateBaseRollupInputs,
37
37
  PublicBaseRollupInputs,
38
+ PublicTubePrivateInputs,
38
39
  RootRollupInputs,
39
40
  RootRollupPublicInputs,
40
41
  SingleTxBlockRootRollupInputs,
41
- TubeInputs,
42
42
  } from '@aztec/stdlib/rollup';
43
43
 
44
44
  import { InlineProofStore, type ProofStore } from './proof_store/index.js';
@@ -520,6 +520,26 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
520
520
  signal,
521
521
  );
522
522
  }
523
+
524
+ getPublicTubeProof(
525
+ inputs: PublicTubePrivateInputs,
526
+ signal?: AbortSignal,
527
+ epochNumber?: number,
528
+ ): Promise<
529
+ PublicInputsAndRecursiveProof<
530
+ PrivateToPublicKernelCircuitPublicInputs,
531
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
532
+ >
533
+ > {
534
+ return this.enqueueJob(
535
+ this.generateId(ProvingRequestType.PUBLIC_TUBE, inputs, epochNumber),
536
+ ProvingRequestType.PUBLIC_TUBE,
537
+ inputs,
538
+ epochNumber,
539
+ signal,
540
+ );
541
+ }
542
+
523
543
  getPrivateBaseRollupProof(
524
544
  baseRollupInput: PrivateBaseRollupInputs,
525
545
  signal?: AbortSignal,
@@ -580,20 +600,6 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
580
600
  );
581
601
  }
582
602
 
583
- getTubeProof(
584
- tubeInput: TubeInputs,
585
- signal?: AbortSignal,
586
- epochNumber?: number,
587
- ): Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>> {
588
- return this.enqueueJob(
589
- this.generateId(ProvingRequestType.TUBE_PROOF, tubeInput, epochNumber),
590
- ProvingRequestType.TUBE_PROOF,
591
- tubeInput,
592
- epochNumber,
593
- signal,
594
- );
595
- }
596
-
597
603
  private generateId(type: ProvingRequestType, inputs: { toBuffer(): Buffer }, epochNumber = 0) {
598
604
  const inputsHash = sha256(inputs.toBuffer());
599
605
  return makeProvingJobId(epochNumber, type, inputsHash.toString('hex'));
@@ -44,7 +44,7 @@ type EnqueuedProvingJob = Pick<ProvingJob, 'id' | 'epochNumber'>;
44
44
  export class ProvingBroker implements ProvingJobProducer, ProvingJobConsumer, Traceable {
45
45
  private queues: ProvingQueues = {
46
46
  [ProvingRequestType.PUBLIC_VM]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
47
- [ProvingRequestType.TUBE_PROOF]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
47
+ [ProvingRequestType.PUBLIC_TUBE]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
48
48
 
49
49
  [ProvingRequestType.PRIVATE_BASE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
50
50
  [ProvingRequestType.PUBLIC_BASE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
@@ -681,7 +681,7 @@ export const PROOF_TYPES_IN_PRIORITY_ORDER: ProvingRequestType[] = [
681
681
  ProvingRequestType.PUBLIC_BASE_ROLLUP,
682
682
  ProvingRequestType.PRIVATE_BASE_ROLLUP,
683
683
  ProvingRequestType.PUBLIC_VM,
684
- ProvingRequestType.TUBE_PROOF,
684
+ ProvingRequestType.PUBLIC_TUBE,
685
685
  ProvingRequestType.ROOT_PARITY,
686
686
  ProvingRequestType.BASE_PARITY,
687
687
  ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP,
@@ -128,6 +128,10 @@ export class ProvingJobController {
128
128
  return await this.circuitProver.getAvmProof(inputs, undefined, signal, this.epochNumber);
129
129
  }
130
130
 
131
+ case ProvingRequestType.PUBLIC_TUBE: {
132
+ return await this.circuitProver.getPublicTubeProof(inputs, signal, this.epochNumber);
133
+ }
134
+
131
135
  case ProvingRequestType.PRIVATE_BASE_ROLLUP: {
132
136
  return await this.circuitProver.getPrivateBaseRollupProof(inputs, signal, this.epochNumber);
133
137
  }
@@ -172,10 +176,6 @@ export class ProvingJobController {
172
176
  return await this.circuitProver.getRootParityProof(inputs, signal, this.epochNumber);
173
177
  }
174
178
 
175
- case ProvingRequestType.TUBE_PROOF: {
176
- return await this.circuitProver.getTubeProof(inputs, signal, this.epochNumber);
177
- }
178
-
179
179
  default: {
180
180
  const _exhaustive: never = type;
181
181
  return Promise.reject(new Error(`Invalid proof request type: ${type}`));