@aztec/stdlib 0.0.1-commit.a5db02d → 0.0.1-commit.aa0c64f

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 (158) hide show
  1. package/dest/abi/abi.d.ts +8 -1
  2. package/dest/abi/abi.d.ts.map +1 -1
  3. package/dest/abi/contract_artifact.d.ts +1 -14
  4. package/dest/abi/contract_artifact.d.ts.map +1 -1
  5. package/dest/abi/contract_artifact.js +26 -25
  6. package/dest/avm/avm_proving_request.d.ts +70 -70
  7. package/dest/avm/index.d.ts +1 -6
  8. package/dest/avm/index.d.ts.map +1 -1
  9. package/dest/avm/index.js +0 -5
  10. package/dest/contract/contract_class.d.ts +1 -1
  11. package/dest/contract/contract_class.d.ts.map +1 -1
  12. package/dest/contract/contract_class.js +3 -2
  13. package/dest/contract/index.d.ts +1 -2
  14. package/dest/contract/index.d.ts.map +1 -1
  15. package/dest/contract/index.js +0 -1
  16. package/dest/interfaces/block-builder.d.ts +7 -2
  17. package/dest/interfaces/block-builder.d.ts.map +1 -1
  18. package/dest/interfaces/merkle_tree_operations.d.ts +8 -3
  19. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  20. package/dest/interfaces/private_kernel_prover.d.ts +64 -3
  21. package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
  22. package/dest/interfaces/proving-job.d.ts +1 -1
  23. package/dest/interfaces/server.d.ts +1 -2
  24. package/dest/interfaces/server.d.ts.map +1 -1
  25. package/dest/interfaces/server.js +0 -1
  26. package/dest/kernel/hints/index.d.ts +1 -2
  27. package/dest/kernel/hints/index.d.ts.map +1 -1
  28. package/dest/kernel/hints/index.js +0 -1
  29. package/dest/kernel/index.d.ts +5 -1
  30. package/dest/kernel/index.d.ts.map +1 -1
  31. package/dest/kernel/index.js +4 -0
  32. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +1 -9
  33. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  34. package/dest/kernel/private_kernel_circuit_public_inputs.js +3 -7
  35. package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts +24 -0
  36. package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts.map +1 -0
  37. package/dest/kernel/private_kernel_init_4_circuit_private_inputs.js +37 -0
  38. package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts +25 -0
  39. package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts.map +1 -0
  40. package/dest/kernel/private_kernel_init_5_circuit_private_inputs.js +39 -0
  41. package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts +18 -0
  42. package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts.map +1 -0
  43. package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.js +27 -0
  44. package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts +19 -0
  45. package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts.map +1 -0
  46. package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.js +29 -0
  47. package/dest/kernel/private_kernel_prover_output.d.ts +4 -1
  48. package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
  49. package/dest/kernel/private_kernel_prover_output.js +4 -1
  50. package/dest/kernel/private_kernel_simulated_output.d.ts +1 -7
  51. package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
  52. package/dest/kernel/private_kernel_simulated_output.js +2 -1
  53. package/dest/kernel/utils/index.d.ts +1 -2
  54. package/dest/kernel/utils/index.d.ts.map +1 -1
  55. package/dest/kernel/utils/index.js +0 -1
  56. package/dest/logs/index.d.ts +3 -1
  57. package/dest/logs/index.d.ts.map +1 -1
  58. package/dest/logs/index.js +2 -0
  59. package/dest/logs/message_context.d.ts +17 -0
  60. package/dest/logs/message_context.d.ts.map +1 -0
  61. package/dest/logs/message_context.js +9 -0
  62. package/dest/logs/pending_tagged_log.d.ts +11 -0
  63. package/dest/logs/pending_tagged_log.d.ts.map +1 -0
  64. package/dest/logs/pending_tagged_log.js +4 -0
  65. package/dest/noir/index.d.ts +3 -3
  66. package/dest/noir/index.d.ts.map +1 -1
  67. package/dest/p2p/index.d.ts +1 -2
  68. package/dest/p2p/index.d.ts.map +1 -1
  69. package/dest/p2p/index.js +0 -1
  70. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -1
  71. package/dest/stats/stats.d.ts +2 -2
  72. package/dest/stats/stats.d.ts.map +1 -1
  73. package/dest/tests/factories.d.ts +1 -27
  74. package/dest/tests/factories.d.ts.map +1 -1
  75. package/dest/tests/factories.js +0 -30
  76. package/dest/tx/index.d.ts +1 -2
  77. package/dest/tx/index.d.ts.map +1 -1
  78. package/dest/tx/index.js +0 -1
  79. package/dest/tx/profiling.d.ts +1 -1
  80. package/dest/tx/profiling.d.ts.map +1 -1
  81. package/dest/tx/profiling.js +2 -0
  82. package/dest/world-state/world_state_revision.d.ts +1 -18
  83. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  84. package/dest/world-state/world_state_revision.js +0 -20
  85. package/package.json +8 -8
  86. package/src/abi/abi.ts +8 -0
  87. package/src/abi/contract_artifact.ts +33 -28
  88. package/src/avm/index.ts +0 -5
  89. package/src/contract/contract_class.ts +3 -2
  90. package/src/contract/index.ts +0 -1
  91. package/src/interfaces/block-builder.ts +6 -1
  92. package/src/interfaces/merkle_tree_operations.ts +8 -2
  93. package/src/interfaces/private_kernel_prover.ts +94 -1
  94. package/src/interfaces/server.ts +0 -1
  95. package/src/kernel/hints/index.ts +0 -1
  96. package/src/kernel/index.ts +4 -0
  97. package/src/kernel/private_kernel_circuit_public_inputs.ts +0 -7
  98. package/src/kernel/private_kernel_init_4_circuit_private_inputs.ts +52 -0
  99. package/src/kernel/private_kernel_init_5_circuit_private_inputs.ts +55 -0
  100. package/src/kernel/private_kernel_inner_4_circuit_private_inputs.ts +39 -0
  101. package/src/kernel/private_kernel_inner_5_circuit_private_inputs.ts +42 -0
  102. package/src/kernel/private_kernel_prover_output.ts +4 -0
  103. package/src/kernel/private_kernel_simulated_output.ts +0 -7
  104. package/src/kernel/utils/index.ts +0 -1
  105. package/src/logs/index.ts +2 -0
  106. package/src/logs/message_context.ts +18 -0
  107. package/src/logs/pending_tagged_log.ts +12 -0
  108. package/src/noir/index.ts +2 -1
  109. package/src/p2p/index.ts +0 -1
  110. package/src/stats/stats.ts +4 -0
  111. package/src/tests/factories.ts +0 -38
  112. package/src/tx/index.ts +0 -1
  113. package/src/tx/profiling.ts +2 -0
  114. package/src/world-state/world_state_revision.ts +0 -33
  115. package/dest/avm/contract_storage_read.d.ts +0 -58
  116. package/dest/avm/contract_storage_read.d.ts.map +0 -1
  117. package/dest/avm/contract_storage_read.js +0 -65
  118. package/dest/avm/contract_storage_update_request.d.ts +0 -65
  119. package/dest/avm/contract_storage_update_request.d.ts.map +0 -1
  120. package/dest/avm/contract_storage_update_request.js +0 -80
  121. package/dest/avm/public_call_stack_item_compressed.d.ts +0 -43
  122. package/dest/avm/public_call_stack_item_compressed.d.ts.map +0 -1
  123. package/dest/avm/public_call_stack_item_compressed.js +0 -70
  124. package/dest/avm/public_data_update_request.d.ts +0 -62
  125. package/dest/avm/public_data_update_request.d.ts.map +0 -1
  126. package/dest/avm/public_data_update_request.js +0 -67
  127. package/dest/avm/public_inner_call_request.d.ts +0 -50
  128. package/dest/avm/public_inner_call_request.d.ts.map +0 -1
  129. package/dest/avm/public_inner_call_request.js +0 -74
  130. package/dest/contract/deployment_info.d.ts +0 -24
  131. package/dest/contract/deployment_info.d.ts.map +0 -1
  132. package/dest/contract/deployment_info.js +0 -3
  133. package/dest/interfaces/prover-coordination.d.ts +0 -15
  134. package/dest/interfaces/prover-coordination.d.ts.map +0 -1
  135. package/dest/interfaces/prover-coordination.js +0 -1
  136. package/dest/kernel/hints/tree_leaf_read_request.d.ts +0 -14
  137. package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +0 -1
  138. package/dest/kernel/hints/tree_leaf_read_request.js +0 -33
  139. package/dest/kernel/utils/optional_number.d.ts +0 -31
  140. package/dest/kernel/utils/optional_number.d.ts.map +0 -1
  141. package/dest/kernel/utils/optional_number.js +0 -42
  142. package/dest/p2p/interface.d.ts +0 -5
  143. package/dest/p2p/interface.d.ts.map +0 -1
  144. package/dest/p2p/interface.js +0 -1
  145. package/dest/tx/validator/empty_validator.d.ts +0 -5
  146. package/dest/tx/validator/empty_validator.d.ts.map +0 -1
  147. package/dest/tx/validator/empty_validator.js +0 -7
  148. package/src/avm/contract_storage_read.ts +0 -77
  149. package/src/avm/contract_storage_update_request.ts +0 -93
  150. package/src/avm/public_call_stack_item_compressed.ts +0 -113
  151. package/src/avm/public_data_update_request.ts +0 -106
  152. package/src/avm/public_inner_call_request.ts +0 -85
  153. package/src/contract/deployment_info.ts +0 -25
  154. package/src/interfaces/prover-coordination.ts +0 -17
  155. package/src/kernel/hints/tree_leaf_read_request.ts +0 -35
  156. package/src/kernel/utils/optional_number.ts +0 -50
  157. package/src/p2p/interface.ts +0 -4
  158. package/src/tx/validator/empty_validator.ts +0 -7
@@ -5,9 +5,13 @@ import type {
5
5
  PrivateKernelCircuitPublicInputs,
6
6
  PrivateKernelInit2CircuitPrivateInputs,
7
7
  PrivateKernelInit3CircuitPrivateInputs,
8
+ PrivateKernelInit4CircuitPrivateInputs,
9
+ PrivateKernelInit5CircuitPrivateInputs,
8
10
  PrivateKernelInitCircuitPrivateInputs,
9
11
  PrivateKernelInner2CircuitPrivateInputs,
10
12
  PrivateKernelInner3CircuitPrivateInputs,
13
+ PrivateKernelInner4CircuitPrivateInputs,
14
+ PrivateKernelInner5CircuitPrivateInputs,
11
15
  PrivateKernelInnerCircuitPrivateInputs,
12
16
  PrivateKernelResetCircuitPrivateInputs,
13
17
  PrivateKernelResetTailCircuitPrivateInputs,
@@ -83,6 +87,48 @@ export interface PrivateKernelProver {
83
87
  privateKernelInputsInit3: PrivateKernelInit3CircuitPrivateInputs,
84
88
  ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
85
89
 
90
+ /**
91
+ * Creates a proof output for a batched first iteration that processes four app calls in a single
92
+ * private kernel circuit.
93
+ *
94
+ * @param privateKernelInputsInit4 - The batched private data structure for the initial iteration.
95
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
96
+ */
97
+ generateInit4Output(
98
+ privateKernelInputsInit4: PrivateKernelInit4CircuitPrivateInputs,
99
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
100
+
101
+ /**
102
+ * Executes the batched first kernel iteration (four app calls) without generating a proof.
103
+ *
104
+ * @param privateKernelInputsInit4 - The batched private data structure for the initial iteration.
105
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
106
+ */
107
+ simulateInit4(
108
+ privateKernelInputsInit4: PrivateKernelInit4CircuitPrivateInputs,
109
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
110
+
111
+ /**
112
+ * Creates a proof output for a batched first iteration that processes five app calls in a single
113
+ * private kernel circuit.
114
+ *
115
+ * @param privateKernelInputsInit5 - The batched private data structure for the initial iteration.
116
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
117
+ */
118
+ generateInit5Output(
119
+ privateKernelInputsInit5: PrivateKernelInit5CircuitPrivateInputs,
120
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
121
+
122
+ /**
123
+ * Executes the batched first kernel iteration (five app calls) without generating a proof.
124
+ *
125
+ * @param privateKernelInputsInit5 - The batched private data structure for the initial iteration.
126
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
127
+ */
128
+ simulateInit5(
129
+ privateKernelInputsInit5: PrivateKernelInit5CircuitPrivateInputs,
130
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
131
+
86
132
  /**
87
133
  * Creates a proof output for a given previous kernel data and private call data for an inner iteration.
88
134
  *
@@ -145,6 +191,48 @@ export interface PrivateKernelProver {
145
191
  privateKernelInputsInner3: PrivateKernelInner3CircuitPrivateInputs,
146
192
  ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
147
193
 
194
+ /**
195
+ * Creates a proof output for a batched inner iteration that processes four app calls in a single
196
+ * private kernel circuit.
197
+ *
198
+ * @param privateKernelInputsInner4 - The batched private data structure for the inner iteration.
199
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
200
+ */
201
+ generateInner4Output(
202
+ privateKernelInputsInner4: PrivateKernelInner4CircuitPrivateInputs,
203
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
204
+
205
+ /**
206
+ * Executes the batched inner kernel iteration (four app calls) without generating a proof.
207
+ *
208
+ * @param privateKernelInputsInner4 - The batched private data structure for the inner iteration.
209
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
210
+ */
211
+ simulateInner4(
212
+ privateKernelInputsInner4: PrivateKernelInner4CircuitPrivateInputs,
213
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
214
+
215
+ /**
216
+ * Creates a proof output for a batched inner iteration that processes five app calls in a single
217
+ * private kernel circuit.
218
+ *
219
+ * @param privateKernelInputsInner5 - The batched private data structure for the inner iteration.
220
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
221
+ */
222
+ generateInner5Output(
223
+ privateKernelInputsInner5: PrivateKernelInner5CircuitPrivateInputs,
224
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
225
+
226
+ /**
227
+ * Executes the batched inner kernel iteration (five app calls) without generating a proof.
228
+ *
229
+ * @param privateKernelInputsInner5 - The batched private data structure for the inner iteration.
230
+ * @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
231
+ */
232
+ simulateInner5(
233
+ privateKernelInputsInner5: PrivateKernelInner5CircuitPrivateInputs,
234
+ ): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
235
+
148
236
  /**
149
237
  * Creates a proof output by resetting the arrays using the reset circuit.
150
238
  *
@@ -202,7 +290,12 @@ export interface PrivateKernelProver {
202
290
  * Compute the gate count for a given circuit.
203
291
  * @param bytecode - The circuit bytecode in gzipped bincode format
204
292
  * @param circuitName - The name of the circuit
293
+ * @param circuitKind - The circuit kind expected by the Chonk backend
205
294
  * @returns A Promise resolving to the gate count
206
295
  */
207
- computeGateCountForCircuit(bytecode: Buffer, circuitName: string): Promise<number>;
296
+ computeGateCountForCircuit(
297
+ bytecode: Buffer,
298
+ circuitName: string,
299
+ circuitKind: PrivateExecutionStep['kind'],
300
+ ): Promise<number>;
208
301
  }
@@ -17,7 +17,6 @@ export * from './processed-tx-handler.js';
17
17
  export * from './prover-agent.js';
18
18
  export * from './prover-broker.js';
19
19
  export * from './prover-client.js';
20
- export * from './prover-coordination.js';
21
20
  export * from './prover-node.js';
22
21
  export * from './proving-job-source.js';
23
22
  export * from './proving-job.js';
@@ -12,4 +12,3 @@ export * from './key_validation_request.js';
12
12
  export * from './scoped_key_validation_request_and_separator.js';
13
13
  export * from './transient_data_squashing_hint.js';
14
14
  export * from './private_kernel_reset_hints.js';
15
- export * from './tree_leaf_read_request.js';
@@ -9,9 +9,13 @@ export * from './private_kernel_data.js';
9
9
  export * from './private_kernel_init_circuit_private_inputs.js';
10
10
  export * from './private_kernel_init_2_circuit_private_inputs.js';
11
11
  export * from './private_kernel_init_3_circuit_private_inputs.js';
12
+ export * from './private_kernel_init_4_circuit_private_inputs.js';
13
+ export * from './private_kernel_init_5_circuit_private_inputs.js';
12
14
  export * from './private_kernel_inner_circuit_private_inputs.js';
13
15
  export * from './private_kernel_inner_2_circuit_private_inputs.js';
14
16
  export * from './private_kernel_inner_3_circuit_private_inputs.js';
17
+ export * from './private_kernel_inner_4_circuit_private_inputs.js';
18
+ export * from './private_kernel_inner_5_circuit_private_inputs.js';
15
19
  export * from './private_kernel_reset_circuit_private_inputs.js';
16
20
  export * from './private_kernel_reset_dimensions.js';
17
21
  export * from './private_kernel_reset_tail_circuit_private_inputs.js';
@@ -46,10 +46,6 @@ export class PrivateKernelCircuitPublicInputs {
46
46
  * Wether this is a private only tx or not
47
47
  */
48
48
  public isPrivateOnly: boolean,
49
- /**
50
- * The nullifier that will be used for nonce generation
51
- */
52
- public claimedFirstNullifier: Fr,
53
49
  /**
54
50
  * A claim to the final min revertible side effect counter of a tx.
55
51
  */
@@ -74,7 +70,6 @@ export class PrivateKernelCircuitPublicInputs {
74
70
  this.feePayer,
75
71
  bigintToUInt64BE(this.expirationTimestamp),
76
72
  this.isPrivateOnly,
77
- this.claimedFirstNullifier,
78
73
  this.claimedRevertibleCounter,
79
74
  );
80
75
  }
@@ -95,7 +90,6 @@ export class PrivateKernelCircuitPublicInputs {
95
90
  reader.readObject(AztecAddress),
96
91
  reader.readUInt64(),
97
92
  reader.readBoolean(),
98
- reader.readObject(Fr),
99
93
  reader.readNumber(),
100
94
  );
101
95
  }
@@ -110,7 +104,6 @@ export class PrivateKernelCircuitPublicInputs {
110
104
  AztecAddress.ZERO,
111
105
  0n,
112
106
  false,
113
- Fr.zero(),
114
107
  0,
115
108
  );
116
109
  }
@@ -0,0 +1,52 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
+
4
+ import { ProtocolContracts } from '../tx/protocol_contracts.js';
5
+ import { TxRequest } from '../tx/tx_request.js';
6
+ import { PrivateCallData } from './private_call_data.js';
7
+
8
+ /**
9
+ * Input to the batched private kernel init circuit, which processes the first four app calls of a
10
+ * transaction in a single iteration.
11
+ */
12
+ export class PrivateKernelInit4CircuitPrivateInputs {
13
+ constructor(
14
+ public txRequest: TxRequest,
15
+ public vkTreeRoot: Fr,
16
+ public protocolContracts: ProtocolContracts,
17
+ public privateCall0: PrivateCallData,
18
+ public privateCall1: PrivateCallData,
19
+ public privateCall2: PrivateCallData,
20
+ public privateCall3: PrivateCallData,
21
+ public isPrivateOnly: boolean,
22
+ public revertibleCounterHint: number,
23
+ ) {}
24
+
25
+ toBuffer() {
26
+ return serializeToBuffer(
27
+ this.txRequest,
28
+ this.vkTreeRoot,
29
+ this.protocolContracts,
30
+ this.privateCall0,
31
+ this.privateCall1,
32
+ this.privateCall2,
33
+ this.privateCall3,
34
+ this.revertibleCounterHint,
35
+ );
36
+ }
37
+
38
+ static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelInit4CircuitPrivateInputs {
39
+ const reader = BufferReader.asReader(buffer);
40
+ return new PrivateKernelInit4CircuitPrivateInputs(
41
+ reader.readObject(TxRequest),
42
+ Fr.fromBuffer(reader),
43
+ reader.readObject(ProtocolContracts),
44
+ reader.readObject(PrivateCallData),
45
+ reader.readObject(PrivateCallData),
46
+ reader.readObject(PrivateCallData),
47
+ reader.readObject(PrivateCallData),
48
+ reader.readBoolean(),
49
+ reader.readNumber(),
50
+ );
51
+ }
52
+ }
@@ -0,0 +1,55 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
+
4
+ import { ProtocolContracts } from '../tx/protocol_contracts.js';
5
+ import { TxRequest } from '../tx/tx_request.js';
6
+ import { PrivateCallData } from './private_call_data.js';
7
+
8
+ /**
9
+ * Input to the batched private kernel init circuit, which processes the first five app calls of a
10
+ * transaction in a single iteration.
11
+ */
12
+ export class PrivateKernelInit5CircuitPrivateInputs {
13
+ constructor(
14
+ public txRequest: TxRequest,
15
+ public vkTreeRoot: Fr,
16
+ public protocolContracts: ProtocolContracts,
17
+ public privateCall0: PrivateCallData,
18
+ public privateCall1: PrivateCallData,
19
+ public privateCall2: PrivateCallData,
20
+ public privateCall3: PrivateCallData,
21
+ public privateCall4: PrivateCallData,
22
+ public isPrivateOnly: boolean,
23
+ public revertibleCounterHint: number,
24
+ ) {}
25
+
26
+ toBuffer() {
27
+ return serializeToBuffer(
28
+ this.txRequest,
29
+ this.vkTreeRoot,
30
+ this.protocolContracts,
31
+ this.privateCall0,
32
+ this.privateCall1,
33
+ this.privateCall2,
34
+ this.privateCall3,
35
+ this.privateCall4,
36
+ this.revertibleCounterHint,
37
+ );
38
+ }
39
+
40
+ static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelInit5CircuitPrivateInputs {
41
+ const reader = BufferReader.asReader(buffer);
42
+ return new PrivateKernelInit5CircuitPrivateInputs(
43
+ reader.readObject(TxRequest),
44
+ Fr.fromBuffer(reader),
45
+ reader.readObject(ProtocolContracts),
46
+ reader.readObject(PrivateCallData),
47
+ reader.readObject(PrivateCallData),
48
+ reader.readObject(PrivateCallData),
49
+ reader.readObject(PrivateCallData),
50
+ reader.readObject(PrivateCallData),
51
+ reader.readBoolean(),
52
+ reader.readNumber(),
53
+ );
54
+ }
55
+ }
@@ -0,0 +1,39 @@
1
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
2
+
3
+ import { PrivateCallData } from './private_call_data.js';
4
+ import { PrivateKernelData } from './private_kernel_data.js';
5
+
6
+ /**
7
+ * Input to the batched private kernel inner circuit, which processes four app calls in a single
8
+ * iteration following a previous kernel.
9
+ */
10
+ export class PrivateKernelInner4CircuitPrivateInputs {
11
+ constructor(
12
+ public previousKernel: PrivateKernelData,
13
+ public privateCall0: PrivateCallData,
14
+ public privateCall1: PrivateCallData,
15
+ public privateCall2: PrivateCallData,
16
+ public privateCall3: PrivateCallData,
17
+ ) {}
18
+
19
+ toBuffer() {
20
+ return serializeToBuffer(
21
+ this.previousKernel,
22
+ this.privateCall0,
23
+ this.privateCall1,
24
+ this.privateCall2,
25
+ this.privateCall3,
26
+ );
27
+ }
28
+
29
+ static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelInner4CircuitPrivateInputs {
30
+ const reader = BufferReader.asReader(buffer);
31
+ return new PrivateKernelInner4CircuitPrivateInputs(
32
+ reader.readObject(PrivateKernelData),
33
+ reader.readObject(PrivateCallData),
34
+ reader.readObject(PrivateCallData),
35
+ reader.readObject(PrivateCallData),
36
+ reader.readObject(PrivateCallData),
37
+ );
38
+ }
39
+ }
@@ -0,0 +1,42 @@
1
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
2
+
3
+ import { PrivateCallData } from './private_call_data.js';
4
+ import { PrivateKernelData } from './private_kernel_data.js';
5
+
6
+ /**
7
+ * Input to the batched private kernel inner circuit, which processes five app calls in a single
8
+ * iteration following a previous kernel.
9
+ */
10
+ export class PrivateKernelInner5CircuitPrivateInputs {
11
+ constructor(
12
+ public previousKernel: PrivateKernelData,
13
+ public privateCall0: PrivateCallData,
14
+ public privateCall1: PrivateCallData,
15
+ public privateCall2: PrivateCallData,
16
+ public privateCall3: PrivateCallData,
17
+ public privateCall4: PrivateCallData,
18
+ ) {}
19
+
20
+ toBuffer() {
21
+ return serializeToBuffer(
22
+ this.previousKernel,
23
+ this.privateCall0,
24
+ this.privateCall1,
25
+ this.privateCall2,
26
+ this.privateCall3,
27
+ this.privateCall4,
28
+ );
29
+ }
30
+
31
+ static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelInner5CircuitPrivateInputs {
32
+ const reader = BufferReader.asReader(buffer);
33
+ return new PrivateKernelInner5CircuitPrivateInputs(
34
+ reader.readObject(PrivateKernelData),
35
+ reader.readObject(PrivateCallData),
36
+ reader.readObject(PrivateCallData),
37
+ reader.readObject(PrivateCallData),
38
+ reader.readObject(PrivateCallData),
39
+ reader.readObject(PrivateCallData),
40
+ );
41
+ }
42
+ }
@@ -1,3 +1,4 @@
1
+ import { CircuitKind } from '@aztec/bb.js';
1
2
  import { bufferSchema, mapSchema } from '@aztec/foundation/schemas';
2
3
  import type { WitnessMap } from '@aztec/noir-acvm_js';
3
4
  import { serializeWitness } from '@aztec/noir-noirc_abi';
@@ -15,6 +16,7 @@ export const PrivateExecutionStepSchema = z.object({
15
16
  bytecode: bufferSchema,
16
17
  witness: mapSchema(z.number(), z.string()),
17
18
  vk: bufferSchema,
19
+ kind: z.nativeEnum(CircuitKind),
18
20
  timings: z.object({
19
21
  witgen: z.number(),
20
22
  gateCount: z.number().optional(),
@@ -31,6 +33,7 @@ export interface PrivateExecutionStep {
31
33
  witness: WitnessMap;
32
34
  /* TODO(https://github.com/AztecProtocol/barretenberg/issues/1328) this should get its own proper class. */
33
35
  vk: Buffer;
36
+ kind: CircuitKind;
34
37
  timings: {
35
38
  witgen: number;
36
39
  gateCount?: number;
@@ -64,6 +67,7 @@ export function serializePrivateExecutionSteps(steps: PrivateExecutionStep[]) {
64
67
  witness: serializeWitness(step.witness),
65
68
  vk: step.vk,
66
69
  functionName: step.functionName,
70
+ kind: step.kind,
67
71
  };
68
72
  };
69
73
  return new Encoder({ useRecords: false }).pack(steps.map(stepToStruct));
@@ -17,10 +17,3 @@ export interface PrivateKernelSimulateOutput<
17
17
  verificationKey: VerificationKeyData;
18
18
  bytecode: Buffer;
19
19
  }
20
-
21
- /**
22
- * Represents the output of the circuit simulation process for init and inner private kernel circuit.
23
- */
24
- export type AppCircuitSimulateOutput = {
25
- verificationKey: VerificationKeyData;
26
- };
@@ -1,3 +1,2 @@
1
1
  export * from './interfaces.js';
2
- export * from './optional_number.js';
3
2
  export * from './order_and_comparison.js';
package/src/logs/index.ts CHANGED
@@ -5,11 +5,13 @@ export * from './tagging_index_range.js';
5
5
  export * from './contract_class_log.js';
6
6
  export * from './public_log.js';
7
7
  export * from './private_log.js';
8
+ export * from './pending_tagged_log.js';
8
9
  export * from './log_result.js';
9
10
  export * from './log_cursor.js';
10
11
  export * from './logs_query.js';
11
12
  export * from './query_all_logs_by_tags.js';
12
13
  export * from './shared_secret_derivation.js';
14
+ export * from './message_context.js';
13
15
  export * from './debug_log.js';
14
16
  export * from './debug_log_store.js';
15
17
  export * from './tag.js';
@@ -0,0 +1,18 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+
3
+ import type { TxHash } from '../tx/tx_hash.js';
4
+
5
+ /**
6
+ * Additional information needed to process a message.
7
+ *
8
+ * All messages exist in the context of a transaction, and information about that transaction is typically required
9
+ * in order to perform validation, store results, etc. For example, messages containing notes require knowledge of note
10
+ * hashes and the first nullifier in order to find the note's nonce.
11
+ *
12
+ * A TS version of `message_context.nr`.
13
+ */
14
+ export type MessageContext = {
15
+ txHash: TxHash;
16
+ uniqueNoteHashesInTx: Fr[];
17
+ firstNullifierInTx: Fr;
18
+ };
@@ -0,0 +1,12 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+
3
+ import type { MessageContext } from './message_context.js';
4
+
5
+ /**
6
+ * Represents a pending tagged log as it is stored in the pending tagged log array to which the fetchTaggedLogs oracle
7
+ * inserts found private logs. A TS version of `pending_tagged_log.nr`.
8
+ */
9
+ export type PendingTaggedLog = {
10
+ log: Fr[];
11
+ context: MessageContext;
12
+ };
package/src/noir/index.ts CHANGED
@@ -2,6 +2,7 @@ import type {
2
2
  ABIParameter,
3
3
  ABIParameterVisibility,
4
4
  AbiErrorType,
5
+ AbiNamedValue,
5
6
  AbiType,
6
7
  AbiValue,
7
8
  DebugFileMap,
@@ -73,7 +74,7 @@ export interface NoirCompiledContract {
73
74
  /** The events of the contract */
74
75
  outputs: {
75
76
  structs: Record<string, AbiType[]>;
76
- globals: Record<string, AbiValue[]>;
77
+ globals: Record<string, (AbiNamedValue | AbiValue)[]>;
77
78
  };
78
79
  /** The map of file ID to the source code and path of the file. */
79
80
  file_map: DebugFileMap;
package/src/p2p/index.ts CHANGED
@@ -4,7 +4,6 @@ export * from './checkpoint_attestation.js';
4
4
  export * from './checkpoint_proposal.js';
5
5
  export * from './consensus_payload.js';
6
6
  export * from './gossipable.js';
7
- export * from './interface.js';
8
7
  export * from './signature_utils.js';
9
8
  export * from './signed_txs.js';
10
9
  export * from './topic_type.js';
@@ -86,9 +86,13 @@ export type ClientCircuitName =
86
86
  | 'private-kernel-init'
87
87
  | 'private-kernel-init-2'
88
88
  | 'private-kernel-init-3'
89
+ | 'private-kernel-init-4'
90
+ | 'private-kernel-init-5'
89
91
  | 'private-kernel-inner'
90
92
  | 'private-kernel-inner-2'
91
93
  | 'private-kernel-inner-3'
94
+ | 'private-kernel-inner-4'
95
+ | 'private-kernel-inner-5'
92
96
  | 'private-kernel-reset'
93
97
  | 'private-kernel-reset-tail'
94
98
  | 'private-kernel-reset-tail-to-public'
@@ -54,8 +54,6 @@ import type { Bufferable, Serializable, Tuple } from '@aztec/foundation/serializ
54
54
  import { MembershipWitness } from '@aztec/foundation/trees';
55
55
 
56
56
  import { FunctionSelector } from '../abi/function_selector.js';
57
- import { ContractStorageRead } from '../avm/contract_storage_read.js';
58
- import { ContractStorageUpdateRequest } from '../avm/contract_storage_update_request.js';
59
57
  import {
60
58
  AvmAccumulatedData,
61
59
  AvmAccumulatedDataArrayLengths,
@@ -82,7 +80,6 @@ import {
82
80
  AvmSequentialInsertHintPublicDataTree,
83
81
  AvmTxHint,
84
82
  } from '../avm/index.js';
85
- import { PublicDataRead } from '../avm/public_data_read.js';
86
83
  import { PublicDataWrite } from '../avm/public_data_write.js';
87
84
  import { AztecAddress } from '../aztec-address/index.js';
88
85
  import { BlockHash } from '../block/block_hash.js';
@@ -276,41 +273,6 @@ export function makePublicDataWrite(seed = 1) {
276
273
  return new PublicDataWrite(fr(seed), fr(seed + 1));
277
274
  }
278
275
 
279
- /**
280
- * Creates arbitrary public data read.
281
- * @param seed - The seed to use for generating the public data read.
282
- * @returns A public data read.
283
- */
284
- export function makePublicDataRead(seed = 1): PublicDataRead {
285
- return new PublicDataRead(fr(seed), fr(seed + 1), 0);
286
- }
287
-
288
- /**
289
- * Creates empty public data read.
290
- * @returns An empty public data read.
291
- */
292
- export function makeEmptyPublicDataRead(): PublicDataRead {
293
- return new PublicDataRead(fr(0), fr(0), 0);
294
- }
295
-
296
- /**
297
- * Creates arbitrary contract storage update request.
298
- * @param seed - The seed to use for generating the contract storage update request.
299
- * @returns A contract storage update request.
300
- */
301
- export function makeContractStorageUpdateRequest(seed = 1): ContractStorageUpdateRequest {
302
- return new ContractStorageUpdateRequest(fr(seed), fr(seed + 1), seed + 2);
303
- }
304
-
305
- /**
306
- * Creates arbitrary contract storage read.
307
- * @param seed - The seed to use for generating the contract storage read.
308
- * @returns A contract storage read.
309
- */
310
- export function makeContractStorageRead(seed = 1): ContractStorageRead {
311
- return new ContractStorageRead(fr(seed), fr(seed + 1), seed + 2);
312
- }
313
-
314
276
  function makeTxConstantData(seed = 1) {
315
277
  return new TxConstantData(
316
278
  makeBlockHeader(seed),
package/src/tx/index.ts CHANGED
@@ -21,7 +21,6 @@ export * from './tx_effect.js';
21
21
  export * from './public_simulation_output.js';
22
22
  export * from './tx_execution_request.js';
23
23
  export * from './validator/tx_validator.js';
24
- export * from './validator/empty_validator.js';
25
24
  export * from './validator/error_texts.js';
26
25
  export * from './capsule.js';
27
26
  export * from './fee_provider.js';
@@ -1,3 +1,4 @@
1
+ import { CircuitKind } from '@aztec/bb.js';
1
2
  import { Fr } from '@aztec/foundation/curves/bn254';
2
3
  import { type ZodFor, optional, schemas } from '@aztec/foundation/schemas';
3
4
 
@@ -125,6 +126,7 @@ export class TxProfileResult {
125
126
  bytecode: Buffer.from('random'),
126
127
  witness: new Map([[1, 'random']]),
127
128
  vk: Buffer.from('random'),
129
+ kind: CircuitKind.App,
128
130
  timings: {
129
131
  witgen: 1,
130
132
  gateCount: 1,
@@ -36,36 +36,3 @@ export class WorldStateRevision {
36
36
  );
37
37
  }
38
38
  }
39
-
40
- export class WorldStateRevisionWithHandle extends WorldStateRevision {
41
- constructor(
42
- forkId: number,
43
- blockNumber: number,
44
- includeUncommitted: boolean,
45
- public readonly handle: any,
46
- ) {
47
- super(forkId, blockNumber, includeUncommitted);
48
- }
49
-
50
- public toWorldStateRevision() {
51
- return new WorldStateRevision(this.forkId, this.blockNumber, this.includeUncommitted);
52
- }
53
-
54
- static fromWorldStateRevision(revision: WorldStateRevision, handle: any) {
55
- return new WorldStateRevisionWithHandle(revision.forkId, revision.blockNumber, revision.includeUncommitted, handle);
56
- }
57
-
58
- static override get schema() {
59
- return z
60
- .object({
61
- forkId: z.number(),
62
- blockNumber: z.number(),
63
- includeUncommitted: z.boolean(),
64
- handle: z.any(),
65
- })
66
- .transform(
67
- ({ forkId, blockNumber, includeUncommitted, handle }) =>
68
- new WorldStateRevisionWithHandle(forkId, blockNumber, includeUncommitted, handle),
69
- );
70
- }
71
- }