@aztec/prover-client 1.0.0-nightly.20250619 → 1.0.0-nightly.20250621

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.
@@ -28,7 +28,7 @@ async function main() {
28
28
  const input = await proofStore.getProofInput(uri);
29
29
  logger.info(`Found inputs for ${ProvingRequestType[input.type]}`);
30
30
  writeProofInputs(input, outDir);
31
- console.log((await jsonParseWithSchema(jsonStringify(input), ProvingJobInputs)).inputs);
31
+ console.log(jsonParseWithSchema(jsonStringify(input), ProvingJobInputs).inputs);
32
32
  }
33
33
  // This mimics the behavior of bb-prover/src/bb/execute.ts
34
34
  function writeProofInputs(input, outDir) {
@@ -32,6 +32,8 @@ export declare const buildHeaderAndBodyFromTxs: (txs: ProcessedTx[], globalVaria
32
32
  header: BlockHeader;
33
33
  body: Body;
34
34
  }>;
35
+ /** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */
36
+ export declare function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Promise<Fr>;
35
37
  export declare function getBlobsHashFromBlobs(inputs: Blob[]): Fr;
36
38
  export declare function getEmptyBlockBlobsHash(): Promise<Fr>;
37
39
  export declare function validateBlockRootOutput(blockRootOutput: BlockRootOrBlockMergePublicInputs, blockHeader: BlockHeader, db: MerkleTreeReadOperations): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"block-building-helpers.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-building-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAiBhF,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,KAAK,KAAK,EAAgC,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAqD,MAAM,yBAAyB,CAAC;AAI/G,OAAO,EAAE,cAAc,EA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ildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'build
156
156
  const body = new Body(txEffects);
157
157
  const numTxs = body.txEffects.length;
158
158
  const outHash = numTxs === 0 ? Fr.ZERO : numTxs === 1 ? new Fr(body.txEffects[0].txOutHash()) : new Fr(computeUnbalancedMerkleRoot(body.txEffects.map((tx)=>tx.txOutHash()), TxEffect.empty().txOutHash()));
159
- l1ToL2Messages = padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
160
- const hasher = (left, right)=>Promise.resolve(sha256Trunc(Buffer.concat([
161
- left,
162
- right
163
- ])));
164
- const parityHeight = Math.ceil(Math.log2(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
165
- const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
166
- const parityShaRoot = new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map((msg)=>msg.toBuffer())));
159
+ const parityShaRoot = await computeInHashFromL1ToL2Messages(l1ToL2Messages);
167
160
  const blobsHash = getBlobsHashFromBlobs(await Blob.getBlobsPerBlock(body.toBlobFields()));
168
161
  const contentCommitment = new ContentCommitment(blobsHash, parityShaRoot, outHash);
169
162
  const fees = body.txEffects.reduce((acc, tx)=>acc.add(tx.transactionFee), Fr.ZERO);
@@ -174,6 +167,16 @@ export const buildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'build
174
167
  body
175
168
  };
176
169
  });
170
+ /** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */ export async function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages) {
171
+ const l1ToL2Messages = padArrayEnd(unpaddedL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
172
+ const hasher = (left, right)=>Promise.resolve(sha256Trunc(Buffer.concat([
173
+ left,
174
+ right
175
+ ])));
176
+ const parityHeight = Math.ceil(Math.log2(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
177
+ const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
178
+ return new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map((msg)=>msg.toBuffer())));
179
+ }
177
180
  export function getBlobsHashFromBlobs(inputs) {
178
181
  return sha256ToField(inputs.map((b)=>b.getEthVersionedBlobHash()));
179
182
  }
@@ -31,9 +31,9 @@ class SingleEpochDatabase {
31
31
  }
32
32
  async *allProvingJobs() {
33
33
  for await (const jobStr of this.jobs.valuesAsync()){
34
- const job = await jsonParseWithSchema(jobStr, ProvingJob);
34
+ const job = jsonParseWithSchema(jobStr, ProvingJob);
35
35
  const resultStr = await this.jobResults.getAsync(job.id);
36
- const result = resultStr ? await jsonParseWithSchema(resultStr, ProvingJobSettledResult) : undefined;
36
+ const result = resultStr ? jsonParseWithSchema(resultStr, ProvingJobSettledResult) : undefined;
37
37
  yield [
38
38
  job,
39
39
  result
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/prover-client",
3
- "version": "1.0.0-nightly.20250619",
3
+ "version": "1.0.0-nightly.20250621",
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": "1.0.0-nightly.20250619",
72
- "@aztec/blob-lib": "1.0.0-nightly.20250619",
73
- "@aztec/constants": "1.0.0-nightly.20250619",
74
- "@aztec/ethereum": "1.0.0-nightly.20250619",
75
- "@aztec/foundation": "1.0.0-nightly.20250619",
76
- "@aztec/kv-store": "1.0.0-nightly.20250619",
77
- "@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250619",
78
- "@aztec/noir-types": "1.0.0-nightly.20250619",
79
- "@aztec/protocol-contracts": "1.0.0-nightly.20250619",
80
- "@aztec/simulator": "1.0.0-nightly.20250619",
81
- "@aztec/stdlib": "1.0.0-nightly.20250619",
82
- "@aztec/telemetry-client": "1.0.0-nightly.20250619",
83
- "@aztec/world-state": "1.0.0-nightly.20250619",
71
+ "@aztec/bb-prover": "1.0.0-nightly.20250621",
72
+ "@aztec/blob-lib": "1.0.0-nightly.20250621",
73
+ "@aztec/constants": "1.0.0-nightly.20250621",
74
+ "@aztec/ethereum": "1.0.0-nightly.20250621",
75
+ "@aztec/foundation": "1.0.0-nightly.20250621",
76
+ "@aztec/kv-store": "1.0.0-nightly.20250621",
77
+ "@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250621",
78
+ "@aztec/noir-types": "1.0.0-nightly.20250621",
79
+ "@aztec/protocol-contracts": "1.0.0-nightly.20250621",
80
+ "@aztec/simulator": "1.0.0-nightly.20250621",
81
+ "@aztec/stdlib": "1.0.0-nightly.20250621",
82
+ "@aztec/telemetry-client": "1.0.0-nightly.20250621",
83
+ "@aztec/world-state": "1.0.0-nightly.20250621",
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": "1.0.0-nightly.20250619",
93
+ "@aztec/noir-contracts.js": "1.0.0-nightly.20250621",
94
94
  "@jest/globals": "^30.0.0",
95
95
  "@types/jest": "^30.0.0",
96
96
  "@types/node": "^22.15.17",
@@ -36,7 +36,7 @@ async function main() {
36
36
  logger.info(`Found inputs for ${ProvingRequestType[input.type]}`);
37
37
  writeProofInputs(input, outDir);
38
38
 
39
- console.log((await jsonParseWithSchema(jsonStringify(input), ProvingJobInputs)).inputs);
39
+ console.log(jsonParseWithSchema(jsonStringify(input), ProvingJobInputs).inputs);
40
40
  }
41
41
 
42
42
  // This mimics the behavior of bb-prover/src/bb/execute.ts
@@ -351,16 +351,7 @@ export const buildHeaderAndBodyFromTxs = runInSpan(
351
351
  ),
352
352
  );
353
353
 
354
- l1ToL2Messages = padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
355
- const hasher = (left: Buffer, right: Buffer) =>
356
- Promise.resolve(sha256Trunc(Buffer.concat([left, right])) as Buffer<ArrayBuffer>);
357
- const parityHeight = Math.ceil(Math.log2(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
358
- const parityCalculator = await MerkleTreeCalculator.create(
359
- parityHeight,
360
- Fr.ZERO.toBuffer() as Buffer<ArrayBuffer>,
361
- hasher,
362
- );
363
- const parityShaRoot = new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map(msg => msg.toBuffer())));
354
+ const parityShaRoot = await computeInHashFromL1ToL2Messages(l1ToL2Messages);
364
355
  const blobsHash = getBlobsHashFromBlobs(await Blob.getBlobsPerBlock(body.toBlobFields()));
365
356
 
366
357
  const contentCommitment = new ContentCommitment(blobsHash, parityShaRoot, outHash);
@@ -374,6 +365,16 @@ export const buildHeaderAndBodyFromTxs = runInSpan(
374
365
  },
375
366
  );
376
367
 
368
+ /** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */
369
+ export async function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Promise<Fr> {
370
+ const l1ToL2Messages = padArrayEnd(unpaddedL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
371
+ const hasher = (left: Buffer, right: Buffer) =>
372
+ Promise.resolve(sha256Trunc(Buffer.concat([left, right])) as Buffer<ArrayBuffer>);
373
+ const parityHeight = Math.ceil(Math.log2(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
374
+ const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
375
+ return new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map(msg => msg.toBuffer())));
376
+ }
377
+
377
378
  export function getBlobsHashFromBlobs(inputs: Blob[]): Fr {
378
379
  return sha256ToField(inputs.map(b => b.getEthVersionedBlobHash()));
379
380
  }
@@ -52,7 +52,7 @@ export class InlineProofStore implements ProofStore {
52
52
  return (PREFIX + SEPARATOR + encoded) as ProofUri;
53
53
  }
54
54
 
55
- private decode<T>(uri: ProofUri, schema: ZodFor<T>): Promise<T> {
55
+ private decode<T>(uri: ProofUri, schema: ZodFor<T>): T {
56
56
  const [prefix, data] = uri.split(SEPARATOR);
57
57
  if (prefix !== PREFIX) {
58
58
  throw new Error('Invalid proof input URI: ' + prefix);
@@ -46,9 +46,9 @@ class SingleEpochDatabase {
46
46
 
47
47
  async *allProvingJobs(): AsyncIterableIterator<[ProvingJob, ProvingJobSettledResult | undefined]> {
48
48
  for await (const jobStr of this.jobs.valuesAsync()) {
49
- const job = await jsonParseWithSchema(jobStr, ProvingJob);
49
+ const job = jsonParseWithSchema(jobStr, ProvingJob);
50
50
  const resultStr = await this.jobResults.getAsync(job.id);
51
- const result = resultStr ? await jsonParseWithSchema(resultStr, ProvingJobSettledResult) : undefined;
51
+ const result = resultStr ? jsonParseWithSchema(resultStr, ProvingJobSettledResult) : undefined;
52
52
  yield [job, result];
53
53
  }
54
54
  }