@aztec/pxe 0.76.4 → 0.77.0-testnet-ignition.21

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 (113) hide show
  1. package/dest/bin/index.js +4 -6
  2. package/dest/config/index.d.ts +2 -2
  3. package/dest/config/index.d.ts.map +1 -1
  4. package/dest/config/index.js +20 -23
  5. package/dest/config/package_info.js +4 -2
  6. package/dest/contract_data_oracle/index.d.ts +10 -10
  7. package/dest/contract_data_oracle/index.d.ts.map +1 -1
  8. package/dest/contract_data_oracle/index.js +74 -89
  9. package/dest/contract_data_oracle/private_functions_tree.d.ts +5 -4
  10. package/dest/contract_data_oracle/private_functions_tree.d.ts.map +1 -1
  11. package/dest/contract_data_oracle/private_functions_tree.js +47 -51
  12. package/dest/database/contracts/contract_artifact_db.d.ts +2 -2
  13. package/dest/database/contracts/contract_artifact_db.d.ts.map +1 -1
  14. package/dest/database/contracts/contract_artifact_db.js +3 -2
  15. package/dest/database/contracts/contract_instance_db.d.ts +2 -1
  16. package/dest/database/contracts/contract_instance_db.d.ts.map +1 -1
  17. package/dest/database/contracts/contract_instance_db.js +3 -2
  18. package/dest/database/index.js +0 -1
  19. package/dest/database/kv_pxe_database.d.ts +9 -5
  20. package/dest/database/kv_pxe_database.d.ts.map +1 -1
  21. package/dest/database/kv_pxe_database.js +244 -257
  22. package/dest/database/note_dao.d.ts +13 -10
  23. package/dest/database/note_dao.d.ts.map +1 -1
  24. package/dest/database/note_dao.js +35 -48
  25. package/dest/database/outgoing_note_dao.d.ts +6 -3
  26. package/dest/database/outgoing_note_dao.d.ts.map +1 -1
  27. package/dest/database/outgoing_note_dao.js +25 -37
  28. package/dest/database/pxe_database.d.ts +12 -8
  29. package/dest/database/pxe_database.d.ts.map +1 -1
  30. package/dest/database/pxe_database.js +4 -2
  31. package/dest/database/pxe_database_test_suite.d.ts +1 -1
  32. package/dest/database/pxe_database_test_suite.d.ts.map +1 -1
  33. package/dest/database/pxe_database_test_suite.js +286 -147
  34. package/dest/index.d.ts +1 -6
  35. package/dest/index.d.ts.map +1 -1
  36. package/dest/index.js +1 -7
  37. package/dest/kernel_oracle/index.d.ts +20 -10
  38. package/dest/kernel_oracle/index.d.ts.map +1 -1
  39. package/dest/kernel_oracle/index.js +32 -9
  40. package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts +3 -3
  41. package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
  42. package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.js +71 -67
  43. package/dest/kernel_prover/hints/index.js +0 -1
  44. package/dest/kernel_prover/index.js +0 -1
  45. package/dest/kernel_prover/kernel_prover.d.ts +6 -6
  46. package/dest/kernel_prover/kernel_prover.d.ts.map +1 -1
  47. package/dest/kernel_prover/kernel_prover.js +98 -81
  48. package/dest/kernel_prover/proving_data_oracle.d.ts +15 -7
  49. package/dest/kernel_prover/proving_data_oracle.d.ts.map +1 -1
  50. package/dest/kernel_prover/proving_data_oracle.js +4 -2
  51. package/dest/note_decryption_utils/add_public_values_to_payload.d.ts +3 -2
  52. package/dest/note_decryption_utils/add_public_values_to_payload.d.ts.map +1 -1
  53. package/dest/note_decryption_utils/add_public_values_to_payload.js +11 -12
  54. package/dest/pxe_http/index.js +0 -1
  55. package/dest/pxe_http/pxe_http_server.d.ts +1 -1
  56. package/dest/pxe_http/pxe_http_server.d.ts.map +1 -1
  57. package/dest/pxe_http/pxe_http_server.js +9 -7
  58. package/dest/pxe_service/error_enriching.d.ts +3 -3
  59. package/dest/pxe_service/error_enriching.d.ts.map +1 -1
  60. package/dest/pxe_service/error_enriching.js +14 -17
  61. package/dest/pxe_service/index.d.ts +0 -1
  62. package/dest/pxe_service/index.d.ts.map +1 -1
  63. package/dest/pxe_service/index.js +0 -2
  64. package/dest/pxe_service/pxe_service.d.ts +21 -12
  65. package/dest/pxe_service/pxe_service.d.ts.map +1 -1
  66. package/dest/pxe_service/pxe_service.js +279 -333
  67. package/dest/pxe_service/test/pxe_test_suite.d.ts +1 -1
  68. package/dest/pxe_service/test/pxe_test_suite.d.ts.map +1 -1
  69. package/dest/pxe_service/test/pxe_test_suite.js +44 -28
  70. package/dest/simulator/index.d.ts +3 -3
  71. package/dest/simulator/index.d.ts.map +1 -1
  72. package/dest/simulator/index.js +1 -3
  73. package/dest/simulator_oracle/index.d.ts +18 -6
  74. package/dest/simulator_oracle/index.d.ts.map +1 -1
  75. package/dest/simulator_oracle/index.js +307 -235
  76. package/dest/simulator_oracle/tagging_utils.d.ts +2 -1
  77. package/dest/simulator_oracle/tagging_utils.d.ts.map +1 -1
  78. package/dest/simulator_oracle/tagging_utils.js +5 -7
  79. package/dest/synchronizer/index.js +0 -1
  80. package/dest/synchronizer/synchronizer.d.ts +7 -4
  81. package/dest/synchronizer/synchronizer.d.ts.map +1 -1
  82. package/dest/synchronizer/synchronizer.js +64 -43
  83. package/dest/utils/create_pxe_service.d.ts +2 -2
  84. package/dest/utils/create_pxe_service.d.ts.map +1 -1
  85. package/dest/utils/create_pxe_service.js +13 -11
  86. package/package.json +18 -19
  87. package/src/bin/index.ts +1 -1
  88. package/src/config/index.ts +3 -3
  89. package/src/contract_data_oracle/index.ts +20 -20
  90. package/src/contract_data_oracle/private_functions_tree.ts +6 -7
  91. package/src/database/contracts/contract_artifact_db.ts +2 -2
  92. package/src/database/contracts/contract_instance_db.ts +2 -1
  93. package/src/database/kv_pxe_database.ts +33 -32
  94. package/src/database/note_dao.ts +11 -8
  95. package/src/database/outgoing_note_dao.ts +7 -4
  96. package/src/database/pxe_database.ts +13 -15
  97. package/src/database/pxe_database_test_suite.ts +8 -11
  98. package/src/index.ts +1 -7
  99. package/src/kernel_oracle/index.ts +55 -22
  100. package/src/kernel_prover/hints/build_private_kernel_reset_private_inputs.ts +14 -11
  101. package/src/kernel_prover/kernel_prover.ts +89 -69
  102. package/src/kernel_prover/proving_data_oracle.ts +20 -20
  103. package/src/note_decryption_utils/add_public_values_to_payload.ts +5 -4
  104. package/src/pxe_http/pxe_http_server.ts +1 -1
  105. package/src/pxe_service/error_enriching.ts +6 -6
  106. package/src/pxe_service/index.ts +0 -1
  107. package/src/pxe_service/pxe_service.ts +121 -224
  108. package/src/pxe_service/test/pxe_test_suite.ts +6 -3
  109. package/src/simulator/index.ts +3 -3
  110. package/src/simulator_oracle/index.ts +77 -47
  111. package/src/simulator_oracle/tagging_utils.ts +2 -1
  112. package/src/synchronizer/synchronizer.ts +31 -12
  113. package/src/utils/create_pxe_service.ts +16 -4
@@ -1,45 +1,47 @@
1
+ import { CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, VK_TREE_HEIGHT } from '@aztec/constants';
2
+ import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
3
+ import { Fr } from '@aztec/foundation/fields';
4
+ import { createLogger } from '@aztec/foundation/log';
5
+ import { assertLength } from '@aztec/foundation/serialize';
6
+ import { pushTestData } from '@aztec/foundation/testing';
7
+ import { Timer } from '@aztec/foundation/timer';
8
+ import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
9
+ import { getProtocolContractLeafAndMembershipWitness, protocolContractTreeRoot } from '@aztec/protocol-contracts';
10
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
11
+ import { computeContractAddressFromInstance } from '@aztec/stdlib/contract';
12
+ import { hashVK } from '@aztec/stdlib/hash';
13
+ import type { PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
1
14
  import {
2
- type PrivateCallExecutionResult,
3
- type PrivateExecutionResult,
4
- type PrivateKernelProver,
5
- type PrivateKernelSimulateOutput,
6
- collectEnqueuedPublicFunctionCalls,
7
- collectNoteHashLeafIndexMap,
8
- collectNoteHashNullifierCounterMap,
9
- collectPublicTeardownFunctionCall,
10
- getFinalMinRevertibleSideEffectCounter,
11
- } from '@aztec/circuit-types';
12
- import {
13
- CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS,
14
- ClientIvcProof,
15
- Fr,
16
15
  PrivateCallData,
17
16
  PrivateKernelCircuitPublicInputs,
18
17
  PrivateKernelData,
19
18
  PrivateKernelInitCircuitPrivateInputs,
20
19
  PrivateKernelInnerCircuitPrivateInputs,
20
+ type PrivateKernelSimulateOutput,
21
21
  PrivateKernelTailCircuitPrivateInputs,
22
22
  type PrivateKernelTailCircuitPublicInputs,
23
- type PrivateLog,
23
+ PrivateVerificationKeyHints,
24
24
  type ScopedPrivateLogData,
25
- type TxRequest,
26
- VK_TREE_HEIGHT,
27
- VerificationKeyAsFields,
28
- } from '@aztec/circuits.js';
29
- import { hashVK } from '@aztec/circuits.js/hash';
30
- import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
31
- import { createLogger } from '@aztec/foundation/log';
32
- import { assertLength } from '@aztec/foundation/serialize';
33
- import { pushTestData } from '@aztec/foundation/testing';
34
- import { Timer } from '@aztec/foundation/timer';
35
- import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vks';
36
- import { getProtocolContractLeafAndMembershipWitness, protocolContractTreeRoot } from '@aztec/protocol-contracts';
25
+ } from '@aztec/stdlib/kernel';
26
+ import type { PrivateLog } from '@aztec/stdlib/logs';
27
+ import { ClientIvcProof } from '@aztec/stdlib/proofs';
28
+ import {
29
+ type PrivateCallExecutionResult,
30
+ type PrivateExecutionResult,
31
+ TxRequest,
32
+ collectEnqueuedPublicFunctionCalls,
33
+ collectNoteHashLeafIndexMap,
34
+ collectNoteHashNullifierCounterMap,
35
+ collectPublicTeardownFunctionCall,
36
+ getFinalMinRevertibleSideEffectCounter,
37
+ } from '@aztec/stdlib/tx';
38
+ import { VerificationKeyAsFields } from '@aztec/stdlib/vks';
37
39
 
38
- import { type WitnessMap } from '@noir-lang/types';
40
+ import type { WitnessMap } from '@noir-lang/types';
39
41
  import { strict as assert } from 'assert';
40
42
 
41
43
  import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
42
- import { type ProvingDataOracle } from './proving_data_oracle.js';
44
+ import type { ProvingDataOracle } from './proving_data_oracle.js';
43
45
 
44
46
  // TODO(#10592): Temporary workaround to check that the private logs are correctly split into non-revertible set and revertible set.
45
47
  // This should be done in TailToPublicOutputValidator in private kernel tail.
@@ -87,8 +89,8 @@ const NULL_PROVE_OUTPUT: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicI
87
89
 
88
90
  export type ProvingConfig = {
89
91
  simulate: boolean;
92
+ skipFeeEnforcement: boolean;
90
93
  profile: boolean;
91
- dryRun: boolean;
92
94
  };
93
95
 
94
96
  /**
@@ -115,20 +117,20 @@ export class KernelProver {
115
117
  * @param txRequest - The authenticated transaction request object.
116
118
  * @param executionResult - The execution result object containing nested executions and preimages.
117
119
  * @param profile - Set true to profile the gate count for each circuit
118
- * @param dryRun - Set true to skip the IVC proof generation (only simulation is run). Useful for profiling gate count without proof gen.
119
120
  * @returns A Promise that resolves to a KernelProverOutput object containing proof, public inputs, and output notes.
120
121
  * TODO(#7368) this should be refactored to not recreate the ACIR bytecode now that it operates on a program stack
121
122
  */
122
123
  async prove(
123
124
  txRequest: TxRequest,
124
125
  executionResult: PrivateExecutionResult,
125
- { simulate, profile, dryRun }: ProvingConfig = { simulate: false, profile: false, dryRun: false },
126
+ { simulate, skipFeeEnforcement, profile }: ProvingConfig = {
127
+ simulate: false,
128
+ skipFeeEnforcement: false,
129
+ profile: false,
130
+ },
126
131
  ): Promise<PrivateKernelSimulateOutput<PrivateKernelTailCircuitPublicInputs>> {
127
- if (simulate && profile) {
128
- throw new Error('Cannot simulate and profile at the same time');
129
- }
130
-
131
- simulate = simulate || this.fakeProofs;
132
+ const skipProofGeneration = this.fakeProofs || simulate;
133
+ const generateWitnesses = !skipProofGeneration || profile;
132
134
 
133
135
  const timer = new Timer();
134
136
 
@@ -144,7 +146,7 @@ export class KernelProver {
144
146
  const gateCount = (await this.proofCreator.computeGateCountForCircuit(bytecode, circuitName)) as number;
145
147
  gateCounts.push({ circuitName, gateCount });
146
148
 
147
- this.log.info(`Tx ${txRequest.hash()}: bb gates for ${circuitName} - ${gateCount}`);
149
+ this.log.debug(`Gate count for ${circuitName} - ${gateCount}`);
148
150
  };
149
151
 
150
152
  const noteHashLeafIndexMap = collectNoteHashLeafIndexMap(executionResult);
@@ -167,9 +169,9 @@ export class KernelProver {
167
169
  );
168
170
  while (resetBuilder.needsReset()) {
169
171
  const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
170
- output = simulate
171
- ? await this.proofCreator.simulateReset(privateInputs)
172
- : await this.proofCreator.generateResetOutput(privateInputs);
172
+ output = generateWitnesses
173
+ ? await this.proofCreator.generateResetOutput(privateInputs)
174
+ : await this.proofCreator.simulateReset(privateInputs);
173
175
  // TODO(#7368) consider refactoring this redundant bytecode pushing
174
176
  acirs.push(output.bytecode);
175
177
  witnessStack.push(output.outputWitness);
@@ -220,9 +222,9 @@ export class KernelProver {
220
222
 
221
223
  pushTestData('private-kernel-inputs-init', proofInput);
222
224
 
223
- output = simulate
224
- ? await this.proofCreator.simulateInit(proofInput)
225
- : await this.proofCreator.generateInitOutput(proofInput);
225
+ output = generateWitnesses
226
+ ? await this.proofCreator.generateInitOutput(proofInput)
227
+ : await this.proofCreator.simulateInit(proofInput);
226
228
 
227
229
  acirs.push(output.bytecode);
228
230
  witnessStack.push(output.outputWitness);
@@ -241,9 +243,9 @@ export class KernelProver {
241
243
 
242
244
  pushTestData('private-kernel-inputs-inner', proofInput);
243
245
 
244
- output = simulate
245
- ? await this.proofCreator.simulateInner(proofInput)
246
- : await this.proofCreator.generateInnerOutput(proofInput);
246
+ output = generateWitnesses
247
+ ? await this.proofCreator.generateInnerOutput(proofInput)
248
+ : await this.proofCreator.simulateInner(proofInput);
247
249
 
248
250
  acirs.push(output.bytecode);
249
251
  witnessStack.push(output.outputWitness);
@@ -263,9 +265,9 @@ export class KernelProver {
263
265
  );
264
266
  while (resetBuilder.needsReset()) {
265
267
  const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
266
- output = simulate
267
- ? await this.proofCreator.simulateReset(privateInputs)
268
- : await this.proofCreator.generateResetOutput(privateInputs);
268
+ output = generateWitnesses
269
+ ? await this.proofCreator.generateResetOutput(privateInputs)
270
+ : await this.proofCreator.simulateReset(privateInputs);
269
271
 
270
272
  acirs.push(output.bytecode);
271
273
  witnessStack.push(output.outputWitness);
@@ -281,6 +283,12 @@ export class KernelProver {
281
283
  );
282
284
  }
283
285
 
286
+ if (output.publicInputs.feePayer.isZero() && skipFeeEnforcement) {
287
+ if (!skipProofGeneration) {
288
+ throw new Error('Fee payment must be enforced when creating real proof.');
289
+ }
290
+ output.publicInputs.feePayer = new AztecAddress(Fr.MAX_FIELD_VALUE);
291
+ }
284
292
  // Private tail.
285
293
  const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey);
286
294
  const previousKernelData = new PrivateKernelData(
@@ -298,9 +306,9 @@ export class KernelProver {
298
306
 
299
307
  pushTestData('private-kernel-inputs-ordering', privateInputs);
300
308
 
301
- const tailOutput = simulate
302
- ? await this.proofCreator.simulateTail(privateInputs)
303
- : await this.proofCreator.generateTailOutput(privateInputs);
309
+ const tailOutput = generateWitnesses
310
+ ? await this.proofCreator.generateTailOutput(privateInputs)
311
+ : await this.proofCreator.simulateTail(privateInputs);
304
312
  if (tailOutput.publicInputs.forPublic) {
305
313
  const privateLogs = privateInputs.previousKernel.publicInputs.end.privateLogs;
306
314
  const nonRevertiblePrivateLogs = tailOutput.publicInputs.forPublic.nonRevertibleAccumulatedData.privateLogs;
@@ -315,12 +323,12 @@ export class KernelProver {
315
323
  tailOutput.profileResult = { gateCounts };
316
324
  }
317
325
 
318
- if (!simulate) {
326
+ if (generateWitnesses) {
319
327
  this.log.info(`Private kernel witness generation took ${timer.ms()}ms`);
320
328
  }
321
329
 
322
330
  // TODO(#7368) how do we 'bincode' encode these inputs?
323
- if (!dryRun && !simulate) {
331
+ if (!skipProofGeneration) {
324
332
  const ivcProof = await this.proofCreator.createClientIvcProof(acirs, witnessStack);
325
333
  tailOutput.clientIvcProof = ivcProof;
326
334
  } else {
@@ -336,34 +344,46 @@ export class KernelProver {
336
344
  const vkAsFields = await vkAsFieldsMegaHonk(vkAsBuffer);
337
345
  const vk = new VerificationKeyAsFields(vkAsFields, await hashVK(vkAsFields));
338
346
 
347
+ const { currentContractClassId, publicKeys, saltedInitializationHash } =
348
+ await this.oracle.getContractAddressPreimage(contractAddress);
339
349
  const functionLeafMembershipWitness = await this.oracle.getFunctionMembershipWitness(
340
- contractAddress,
350
+ currentContractClassId,
341
351
  functionSelector,
342
352
  );
343
- const { contractClassId, publicKeys, saltedInitializationHash } = await this.oracle.getContractAddressPreimage(
344
- contractAddress,
345
- );
353
+
346
354
  const { artifactHash: contractClassArtifactHash, publicBytecodeCommitment: contractClassPublicBytecodeCommitment } =
347
- await this.oracle.getContractClassIdPreimage(contractClassId);
355
+ await this.oracle.getContractClassIdPreimage(currentContractClassId);
348
356
 
349
357
  // TODO(#262): Use real acir hash
350
358
  // const acirHash = keccak256(Buffer.from(bytecode, 'hex'));
351
359
  const acirHash = Fr.fromBuffer(Buffer.alloc(32, 0));
352
360
 
361
+ // This will be the address computed in the kernel by the executed class. We need to provide non membership of it in the protocol contract tree.
362
+ // This would only be equal to contractAddress if the currentClassId is equal to the original class id (no update happened).
363
+ const computedAddress = await computeContractAddressFromInstance({
364
+ originalContractClassId: currentContractClassId,
365
+ saltedInitializationHash,
366
+ publicKeys,
367
+ });
368
+
353
369
  const { lowLeaf: protocolContractLeaf, witness: protocolContractMembershipWitness } =
354
- await getProtocolContractLeafAndMembershipWitness(contractAddress);
370
+ await getProtocolContractLeafAndMembershipWitness(contractAddress, computedAddress);
355
371
 
372
+ const updatedClassIdHints = await this.oracle.getUpdatedClassIdHints(contractAddress);
356
373
  return PrivateCallData.from({
357
374
  publicInputs,
358
375
  vk,
359
- publicKeys,
360
- contractClassArtifactHash,
361
- contractClassPublicBytecodeCommitment,
362
- saltedInitializationHash,
363
- functionLeafMembershipWitness,
364
- protocolContractMembershipWitness,
365
- protocolContractLeaf,
366
- acirHash,
376
+ verificationKeyHints: PrivateVerificationKeyHints.from({
377
+ publicKeys,
378
+ contractClassArtifactHash,
379
+ contractClassPublicBytecodeCommitment,
380
+ saltedInitializationHash,
381
+ functionLeafMembershipWitness,
382
+ protocolContractMembershipWitness,
383
+ protocolContractLeaf,
384
+ acirHash,
385
+ updatedClassIdHints,
386
+ }),
367
387
  });
368
388
  }
369
389
 
@@ -1,17 +1,12 @@
1
- import { type NullifierMembershipWitness } from '@aztec/circuit-types';
2
- import {
3
- type FUNCTION_TREE_HEIGHT,
4
- type Fr,
5
- type FunctionSelector,
6
- type GrumpkinScalar,
7
- type MembershipWitness,
8
- type NOTE_HASH_TREE_HEIGHT,
9
- type Point,
10
- type PublicKeys,
11
- type VK_TREE_HEIGHT,
12
- type VerificationKeyAsFields,
13
- } from '@aztec/circuits.js';
14
- import { type AztecAddress } from '@aztec/foundation/aztec-address';
1
+ import type { FUNCTION_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT, VK_TREE_HEIGHT } from '@aztec/constants';
2
+ import type { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
3
+ import type { MembershipWitness } from '@aztec/foundation/trees';
4
+ import type { FunctionSelector } from '@aztec/stdlib/abi';
5
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
6
+ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
7
+ import type { PublicKeys } from '@aztec/stdlib/keys';
8
+ import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
9
+ import type { VerificationKeyAsFields } from '@aztec/stdlib/vks';
15
10
 
16
11
  /**
17
12
  * Provides functionality to fetch membership witnesses for verification keys,
@@ -19,9 +14,12 @@ import { type AztecAddress } from '@aztec/foundation/aztec-address';
19
14
  */
20
15
  export interface ProvingDataOracle {
21
16
  /** Retrieves the preimage of a contract address from the registered contract instances db. */
22
- getContractAddressPreimage(
23
- address: AztecAddress,
24
- ): Promise<{ saltedInitializationHash: Fr; publicKeys: PublicKeys; contractClassId: Fr }>;
17
+ getContractAddressPreimage(address: AztecAddress): Promise<{
18
+ saltedInitializationHash: Fr;
19
+ publicKeys: PublicKeys;
20
+ currentContractClassId: Fr;
21
+ originalContractClassId: Fr;
22
+ }>;
25
23
 
26
24
  /** Retrieves the preimage of a contract class id from the contract classes db. */
27
25
  getContractClassIdPreimage(
@@ -29,16 +27,16 @@ export interface ProvingDataOracle {
29
27
  ): Promise<{ artifactHash: Fr; publicBytecodeCommitment: Fr; privateFunctionsRoot: Fr }>;
30
28
 
31
29
  /**
32
- * Retrieve the function membership witness for the given contract address and function selector.
30
+ * Retrieve the function membership witness for the given contract class and function selector.
33
31
  * The function membership witness represents a proof that the function belongs to the specified contract.
34
32
  * Throws an error if the contract address or function selector is unknown.
35
33
  *
36
- * @param contractAddress - The contract address.
34
+ * @param contractClassId - The id of the class.
37
35
  * @param selector - The function selector.
38
36
  * @returns A promise that resolves with the MembershipWitness instance for the specified contract's function.
39
37
  */
40
38
  getFunctionMembershipWitness(
41
- contractAddress: AztecAddress,
39
+ contractClassId: Fr,
42
40
  selector: FunctionSelector,
43
41
  ): Promise<MembershipWitness<typeof FUNCTION_TREE_HEIGHT>>;
44
42
 
@@ -80,4 +78,6 @@ export interface ProvingDataOracle {
80
78
  getMasterSecretKey(masterPublicKey: Point): Promise<GrumpkinScalar>;
81
79
 
82
80
  getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
81
+
82
+ getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
83
83
  }
@@ -1,7 +1,8 @@
1
- import { type L1NotePayload, Note } from '@aztec/circuit-types';
2
1
  import { ContractNotFoundError } from '@aztec/simulator/client';
2
+ import type { L1NotePayload } from '@aztec/stdlib/logs';
3
+ import { Note } from '@aztec/stdlib/note';
3
4
 
4
- import { type PxeDatabase } from '../database/pxe_database.js';
5
+ import type { PxeDatabase } from '../database/pxe_database.js';
5
6
 
6
7
  /**
7
8
  * Merges privately and publicly delivered note values.
@@ -24,10 +25,10 @@ export async function getOrderedNoteItems(
24
25
  );
25
26
  }
26
27
 
27
- const artifact = await db.getContractArtifact(instance.contractClassId);
28
+ const artifact = await db.getContractArtifact(instance.currentContractClassId);
28
29
  if (!artifact) {
29
30
  throw new Error(
30
- `Could not find artifact for contract class ${instance.contractClassId.toString()}. This should never happen here as the partial notes flow should be triggered only for non-deferred notes.`,
31
+ `Could not find artifact for contract class ${instance.currentContractClassId.toString()}. This should never happen here as the partial notes flow should be triggered only for non-deferred notes.`,
31
32
  );
32
33
  }
33
34
 
@@ -1,5 +1,5 @@
1
- import { type PXE, PXESchema } from '@aztec/circuit-types';
2
1
  import { createNamespacedSafeJsonRpcServer, createSafeJsonRpcServer } from '@aztec/foundation/json-rpc/server';
2
+ import { type PXE, PXESchema } from '@aztec/stdlib/interfaces/client';
3
3
 
4
4
  import http from 'http';
5
5
 
@@ -1,12 +1,12 @@
1
- import { type SimulationError, isNoirCallStackUnresolved } from '@aztec/circuit-types';
2
- import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/circuits.js/constants';
3
- import { FunctionSelector } from '@aztec/foundation/abi';
4
- import { AztecAddress } from '@aztec/foundation/aztec-address';
1
+ import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants';
5
2
  import { Fr } from '@aztec/foundation/fields';
6
- import { type Logger } from '@aztec/foundation/log';
3
+ import type { Logger } from '@aztec/foundation/log';
7
4
  import { resolveAssertionMessageFromRevertData, resolveOpcodeLocations } from '@aztec/simulator/client';
5
+ import { FunctionSelector } from '@aztec/stdlib/abi';
6
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
7
+ import { type SimulationError, isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
8
8
 
9
- import { type ContractDataOracle, type PxeDatabase } from '../index.js';
9
+ import type { ContractDataOracle, PxeDatabase } from '../index.js';
10
10
 
11
11
  /**
12
12
  * Adds contract and function names to a simulation error, if they
@@ -1,3 +1,2 @@
1
1
  export * from './pxe_service.js';
2
2
  export { enrichPublicSimulationError } from './error_enriching.js';
3
- export { pxeTestSuite } from './test/pxe_test_suite.js';