@aztec/simulator 0.56.0 → 0.57.0

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 (156) hide show
  1. package/dest/acvm/oracle/oracle.d.ts +2 -5
  2. package/dest/acvm/oracle/oracle.d.ts.map +1 -1
  3. package/dest/acvm/oracle/oracle.js +6 -37
  4. package/dest/acvm/oracle/typed_oracle.d.ts +3 -6
  5. package/dest/acvm/oracle/typed_oracle.d.ts.map +1 -1
  6. package/dest/acvm/oracle/typed_oracle.js +1 -10
  7. package/dest/avm/avm_execution_environment.d.ts +2 -3
  8. package/dest/avm/avm_execution_environment.d.ts.map +1 -1
  9. package/dest/avm/avm_execution_environment.js +3 -4
  10. package/dest/avm/avm_gas.d.ts.map +1 -1
  11. package/dest/avm/avm_gas.js +1 -2
  12. package/dest/avm/avm_memory_types.d.ts +3 -2
  13. package/dest/avm/avm_memory_types.d.ts.map +1 -1
  14. package/dest/avm/avm_memory_types.js +3 -3
  15. package/dest/avm/errors.d.ts +1 -1
  16. package/dest/avm/errors.d.ts.map +1 -1
  17. package/dest/avm/errors.js +12 -3
  18. package/dest/avm/fixtures/index.d.ts.map +1 -1
  19. package/dest/avm/fixtures/index.js +3 -3
  20. package/dest/avm/journal/journal.d.ts +2 -1
  21. package/dest/avm/journal/journal.d.ts.map +1 -1
  22. package/dest/avm/journal/journal.js +7 -6
  23. package/dest/avm/opcodes/accrued_substate.d.ts.map +1 -1
  24. package/dest/avm/opcodes/accrued_substate.js +37 -30
  25. package/dest/avm/opcodes/addressing_mode.d.ts +3 -2
  26. package/dest/avm/opcodes/addressing_mode.d.ts.map +1 -1
  27. package/dest/avm/opcodes/addressing_mode.js +25 -21
  28. package/dest/avm/opcodes/arithmetic.d.ts.map +1 -1
  29. package/dest/avm/opcodes/arithmetic.js +6 -5
  30. package/dest/avm/opcodes/bitwise.d.ts.map +1 -1
  31. package/dest/avm/opcodes/bitwise.js +11 -9
  32. package/dest/avm/opcodes/commitment.d.ts.map +1 -1
  33. package/dest/avm/opcodes/commitment.js +6 -5
  34. package/dest/avm/opcodes/comparators.d.ts.map +1 -1
  35. package/dest/avm/opcodes/comparators.js +6 -5
  36. package/dest/avm/opcodes/contract.d.ts.map +1 -1
  37. package/dest/avm/opcodes/contract.js +6 -5
  38. package/dest/avm/opcodes/control_flow.js +6 -6
  39. package/dest/avm/opcodes/conversion.d.ts.map +1 -1
  40. package/dest/avm/opcodes/conversion.js +7 -6
  41. package/dest/avm/opcodes/ec_add.d.ts.map +1 -1
  42. package/dest/avm/opcodes/ec_add.js +8 -7
  43. package/dest/avm/opcodes/environment_getters.d.ts.map +1 -1
  44. package/dest/avm/opcodes/environment_getters.js +6 -5
  45. package/dest/avm/opcodes/external_calls.d.ts.map +1 -1
  46. package/dest/avm/opcodes/external_calls.js +27 -16
  47. package/dest/avm/opcodes/hashing.d.ts +1 -3
  48. package/dest/avm/opcodes/hashing.d.ts.map +1 -1
  49. package/dest/avm/opcodes/hashing.js +31 -40
  50. package/dest/avm/opcodes/instruction.d.ts +2 -6
  51. package/dest/avm/opcodes/instruction.d.ts.map +1 -1
  52. package/dest/avm/opcodes/instruction.js +3 -9
  53. package/dest/avm/opcodes/memory.d.ts +0 -12
  54. package/dest/avm/opcodes/memory.d.ts.map +1 -1
  55. package/dest/avm/opcodes/memory.js +21 -51
  56. package/dest/avm/opcodes/misc.d.ts.map +1 -1
  57. package/dest/avm/opcodes/misc.js +6 -5
  58. package/dest/avm/opcodes/multi_scalar_mul.d.ts.map +1 -1
  59. package/dest/avm/opcodes/multi_scalar_mul.js +12 -12
  60. package/dest/avm/opcodes/storage.d.ts.map +1 -1
  61. package/dest/avm/opcodes/storage.js +11 -9
  62. package/dest/avm/serialization/bytecode_serialization.d.ts.map +1 -1
  63. package/dest/avm/serialization/bytecode_serialization.js +2 -3
  64. package/dest/avm/serialization/instruction_serialization.d.ts +32 -34
  65. package/dest/avm/serialization/instruction_serialization.d.ts.map +1 -1
  66. package/dest/avm/serialization/instruction_serialization.js +33 -36
  67. package/dest/client/client_execution_context.d.ts +6 -30
  68. package/dest/client/client_execution_context.d.ts.map +1 -1
  69. package/dest/client/client_execution_context.js +31 -53
  70. package/dest/client/index.d.ts +0 -1
  71. package/dest/client/index.d.ts.map +1 -1
  72. package/dest/client/index.js +1 -2
  73. package/dest/client/private_execution.d.ts +2 -2
  74. package/dest/client/private_execution.d.ts.map +1 -1
  75. package/dest/client/private_execution.js +5 -19
  76. package/dest/client/simulator.d.ts +2 -3
  77. package/dest/client/simulator.d.ts.map +1 -1
  78. package/dest/client/simulator.js +1 -1
  79. package/dest/common/debug_fn_name.d.ts +4 -0
  80. package/dest/common/debug_fn_name.d.ts.map +1 -0
  81. package/dest/common/debug_fn_name.js +15 -0
  82. package/dest/common/index.d.ts +0 -1
  83. package/dest/common/index.d.ts.map +1 -1
  84. package/dest/common/index.js +1 -2
  85. package/dest/public/enqueued_call_simulator.d.ts.map +1 -1
  86. package/dest/public/enqueued_call_simulator.js +3 -4
  87. package/dest/public/execution.d.ts +8 -1
  88. package/dest/public/execution.d.ts.map +1 -1
  89. package/dest/public/execution.js +13 -1
  90. package/dest/public/executor.d.ts +2 -3
  91. package/dest/public/executor.d.ts.map +1 -1
  92. package/dest/public/executor.js +8 -8
  93. package/dest/public/hints_builder.d.ts.map +1 -1
  94. package/dest/public/hints_builder.js +2 -2
  95. package/dest/public/public_processor.d.ts +1 -0
  96. package/dest/public/public_processor.d.ts.map +1 -1
  97. package/dest/public/public_processor.js +5 -2
  98. package/dest/public/side_effect_errors.d.ts +4 -0
  99. package/dest/public/side_effect_errors.d.ts.map +1 -0
  100. package/dest/public/side_effect_errors.js +7 -0
  101. package/dest/public/side_effect_trace.d.ts +2 -2
  102. package/dest/public/side_effect_trace.d.ts.map +1 -1
  103. package/dest/public/side_effect_trace.js +53 -28
  104. package/dest/public/side_effect_trace_interface.d.ts +1 -1
  105. package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
  106. package/package.json +12 -9
  107. package/src/acvm/oracle/oracle.ts +7 -85
  108. package/src/acvm/oracle/typed_oracle.ts +2 -31
  109. package/src/avm/avm_execution_environment.ts +1 -3
  110. package/src/avm/avm_gas.ts +0 -1
  111. package/src/avm/avm_memory_types.ts +10 -5
  112. package/src/avm/errors.ts +11 -3
  113. package/src/avm/fixtures/index.ts +1 -2
  114. package/src/avm/journal/journal.ts +11 -6
  115. package/src/avm/opcodes/accrued_substate.ts +36 -44
  116. package/src/avm/opcodes/addressing_mode.ts +27 -24
  117. package/src/avm/opcodes/arithmetic.ts +5 -7
  118. package/src/avm/opcodes/bitwise.ts +10 -11
  119. package/src/avm/opcodes/commitment.ts +6 -7
  120. package/src/avm/opcodes/comparators.ts +5 -7
  121. package/src/avm/opcodes/contract.ts +5 -7
  122. package/src/avm/opcodes/control_flow.ts +5 -5
  123. package/src/avm/opcodes/conversion.ts +6 -8
  124. package/src/avm/opcodes/ec_add.ts +14 -16
  125. package/src/avm/opcodes/environment_getters.ts +5 -4
  126. package/src/avm/opcodes/external_calls.ts +27 -20
  127. package/src/avm/opcodes/hashing.ts +30 -55
  128. package/src/avm/opcodes/instruction.ts +3 -10
  129. package/src/avm/opcodes/memory.ts +20 -64
  130. package/src/avm/opcodes/misc.ts +5 -7
  131. package/src/avm/opcodes/multi_scalar_mul.ts +11 -14
  132. package/src/avm/opcodes/storage.ts +10 -8
  133. package/src/avm/serialization/bytecode_serialization.ts +0 -2
  134. package/src/avm/serialization/instruction_serialization.ts +0 -3
  135. package/src/client/client_execution_context.ts +40 -96
  136. package/src/client/index.ts +0 -1
  137. package/src/client/private_execution.ts +9 -9
  138. package/src/client/simulator.ts +2 -3
  139. package/src/common/debug_fn_name.ts +22 -0
  140. package/src/common/index.ts +0 -1
  141. package/src/public/enqueued_call_simulator.ts +2 -3
  142. package/src/public/execution.ts +13 -2
  143. package/src/public/executor.ts +6 -12
  144. package/src/public/hints_builder.ts +7 -9
  145. package/src/public/public_processor.ts +5 -1
  146. package/src/public/side_effect_errors.ts +6 -0
  147. package/src/public/side_effect_trace.ts +72 -27
  148. package/src/public/side_effect_trace_interface.ts +2 -2
  149. package/dest/client/execution_result.d.ts +0 -104
  150. package/dest/client/execution_result.d.ts.map +0 -1
  151. package/dest/client/execution_result.js +0 -136
  152. package/dest/common/return_values.d.ts +0 -11
  153. package/dest/common/return_values.d.ts.map +0 -1
  154. package/dest/common/return_values.js +0 -13
  155. package/src/client/execution_result.ts +0 -228
  156. package/src/common/return_values.ts +0 -18
@@ -12,6 +12,16 @@ import {
12
12
  Gas,
13
13
  L2ToL1Message,
14
14
  LogHash,
15
+ MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX,
16
+ MAX_L2_TO_L1_MSGS_PER_TX,
17
+ MAX_NOTE_HASHES_PER_TX,
18
+ MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
19
+ MAX_NULLIFIERS_PER_TX,
20
+ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX,
21
+ MAX_NULLIFIER_READ_REQUESTS_PER_TX,
22
+ MAX_PUBLIC_DATA_READS_PER_TX,
23
+ MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
24
+ MAX_UNENCRYPTED_LOGS_PER_TX,
15
25
  NoteHash,
16
26
  Nullifier,
17
27
  type PublicInnerCallRequest,
@@ -26,6 +36,7 @@ import { type AvmContractCallResult } from '../avm/avm_contract_call_result.js';
26
36
  import { type AvmExecutionEnvironment } from '../avm/avm_execution_environment.js';
27
37
  import { createSimulationError } from '../common/errors.js';
28
38
  import { type PublicExecutionResult, resultToPublicCallRequest } from './execution.js';
39
+ import { SideEffectLimitReachedError } from './side_effect_errors.js';
29
40
  import { type PublicSideEffectTraceInterface } from './side_effect_trace_interface.js';
30
41
 
31
42
  export type TracedContractInstance = { exists: boolean } & ContractInstanceWithAddress;
@@ -55,8 +66,6 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
55
66
 
56
67
  private publicCallRequests: PublicInnerCallRequest[] = [];
57
68
 
58
- private gotContractInstances: ContractInstanceWithAddress[] = [];
59
-
60
69
  private nestedExecutions: PublicExecutionResult[] = [];
61
70
 
62
71
  private avmCircuitHints: AvmExecutionHints;
@@ -81,10 +90,13 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
81
90
  this.sideEffectCounter++;
82
91
  }
83
92
 
93
+ // TODO(dbanks12): checks against tx-wide limit need access to parent trace's length
94
+
84
95
  public tracePublicStorageRead(storageAddress: Fr, slot: Fr, value: Fr, _exists: boolean, _cached: boolean) {
85
- // TODO(4805): check if some threshold is reached for max storage reads
86
- // (need access to parent length, or trace needs to be initialized with parent's contents)
87
96
  // NOTE: exists and cached are unused for now but may be used for optimizations or kernel hints later
97
+ if (this.contractStorageReads.length >= MAX_PUBLIC_DATA_READS_PER_TX) {
98
+ throw new SideEffectLimitReachedError('contract storage read', MAX_PUBLIC_DATA_READS_PER_TX);
99
+ }
88
100
  this.contractStorageReads.push(
89
101
  new ContractStorageRead(slot, value, this.sideEffectCounter, AztecAddress.fromField(storageAddress)),
90
102
  );
@@ -96,8 +108,9 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
96
108
  }
97
109
 
98
110
  public tracePublicStorageWrite(storageAddress: Fr, slot: Fr, value: Fr) {
99
- // TODO(4805): check if some threshold is reached for max storage writes
100
- // (need access to parent length, or trace needs to be initialized with parent's contents)
111
+ if (this.contractStorageUpdateRequests.length >= MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX) {
112
+ throw new SideEffectLimitReachedError('contract storage write', MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX);
113
+ }
101
114
  this.contractStorageUpdateRequests.push(
102
115
  new ContractStorageUpdateRequest(slot, value, this.sideEffectCounter, storageAddress),
103
116
  );
@@ -107,32 +120,32 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
107
120
 
108
121
  // TODO(8287): _exists can be removed once we have the vm properly handling the equality check
109
122
  public traceNoteHashCheck(_storageAddress: Fr, noteHash: Fr, leafIndex: Fr, exists: boolean) {
110
- // TODO(4805): check if some threshold is reached for max note hash checks
111
123
  // NOTE: storageAddress is unused but will be important when an AVM circuit processes an entire enqueued call
112
- // TODO(dbanks12): leafIndex is unused for now but later must be used by kernel to constrain that the kernel
113
- // is in fact checking the leaf indicated by the user
124
+ if (this.noteHashReadRequests.length >= MAX_NOTE_HASH_READ_REQUESTS_PER_TX) {
125
+ throw new SideEffectLimitReachedError('note hash read request', MAX_NOTE_HASH_READ_REQUESTS_PER_TX);
126
+ }
114
127
  this.noteHashReadRequests.push(new TreeLeafReadRequest(noteHash, leafIndex));
115
128
  this.avmCircuitHints.noteHashExists.items.push(
116
129
  new AvmKeyValueHint(/*key=*/ new Fr(leafIndex), /*value=*/ exists ? Fr.ONE : Fr.ZERO),
117
130
  );
131
+ // NOTE: counter does not increment for note hash checks (because it doesn't rely on pending note hashes)
118
132
  }
119
133
 
120
134
  public traceNewNoteHash(_storageAddress: Fr, noteHash: Fr) {
121
- // TODO(4805): check if some threshold is reached for max new note hash
122
- // NOTE: storageAddress is unused but will be important when an AVM circuit processes an entire enqueued call
123
- // TODO(dbanks12): non-existent note hashes should emit a read request of the note hash that actually
124
- // IS there, and the AVM circuit should accept THAT noteHash as a hint. The circuit will then compare
125
- // the noteHash against the one provided by the user code to determine what to return to the user (exists or not),
126
- // and will then propagate the actually-present noteHash to its public inputs.
135
+ if (this.noteHashes.length >= MAX_NOTE_HASHES_PER_TX) {
136
+ throw new SideEffectLimitReachedError('note hash', MAX_NOTE_HASHES_PER_TX);
137
+ }
127
138
  this.noteHashes.push(new NoteHash(noteHash, this.sideEffectCounter));
128
139
  this.logger.debug(`NEW_NOTE_HASH cnt: ${this.sideEffectCounter}`);
129
140
  this.incrementSideEffectCounter();
130
141
  }
131
142
 
132
143
  public traceNullifierCheck(_storageAddress: Fr, nullifier: Fr, _leafIndex: Fr, exists: boolean, _isPending: boolean) {
133
- // TODO(4805): check if some threshold is reached for max new nullifier
134
144
  // NOTE: storageAddress is unused but will be important when an AVM circuit processes an entire enqueued call
135
145
  // NOTE: isPending and leafIndex are unused for now but may be used for optimizations or kernel hints later
146
+
147
+ this.enforceLimitOnNullifierChecks();
148
+
136
149
  const readRequest = new ReadRequest(nullifier, this.sideEffectCounter);
137
150
  if (exists) {
138
151
  this.nullifierReadRequests.push(readRequest);
@@ -147,8 +160,10 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
147
160
  }
148
161
 
149
162
  public traceNewNullifier(_storageAddress: Fr, nullifier: Fr) {
150
- // TODO(4805): check if some threshold is reached for max new nullifier
151
163
  // NOTE: storageAddress is unused but will be important when an AVM circuit processes an entire enqueued call
164
+ if (this.nullifiers.length >= MAX_NULLIFIERS_PER_TX) {
165
+ throw new SideEffectLimitReachedError('nullifier', MAX_NULLIFIERS_PER_TX);
166
+ }
152
167
  this.nullifiers.push(new Nullifier(nullifier, this.sideEffectCounter, /*noteHash=*/ Fr.ZERO));
153
168
  this.logger.debug(`NEW_NULLIFIER cnt: ${this.sideEffectCounter}`);
154
169
  this.incrementSideEffectCounter();
@@ -156,18 +171,21 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
156
171
 
157
172
  // TODO(8287): _exists can be removed once we have the vm properly handling the equality check
158
173
  public traceL1ToL2MessageCheck(_contractAddress: Fr, msgHash: Fr, msgLeafIndex: Fr, exists: boolean) {
159
- // TODO(4805): check if some threshold is reached for max message reads
160
174
  // NOTE: contractAddress is unused but will be important when an AVM circuit processes an entire enqueued call
161
- // TODO(dbanks12): leafIndex is unused for now but later must be used by kernel to constrain that the kernel
162
- // is in fact checking the leaf indicated by the user
175
+ if (this.l1ToL2MsgReadRequests.length >= MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX) {
176
+ throw new SideEffectLimitReachedError('l1 to l2 message read request', MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX);
177
+ }
163
178
  this.l1ToL2MsgReadRequests.push(new TreeLeafReadRequest(msgHash, msgLeafIndex));
164
179
  this.avmCircuitHints.l1ToL2MessageExists.items.push(
165
180
  new AvmKeyValueHint(/*key=*/ new Fr(msgLeafIndex), /*value=*/ exists ? Fr.ONE : Fr.ZERO),
166
181
  );
182
+ // NOTE: counter does not increment for l1tol2 message checks (because it doesn't rely on pending messages)
167
183
  }
168
184
 
169
- public traceNewL2ToL1Message(recipient: Fr, content: Fr) {
170
- // TODO(4805): check if some threshold is reached for max messages
185
+ public traceNewL2ToL1Message(_contractAddress: Fr, recipient: Fr, content: Fr) {
186
+ if (this.newL2ToL1Messages.length >= MAX_L2_TO_L1_MSGS_PER_TX) {
187
+ throw new SideEffectLimitReachedError('l2 to l1 message', MAX_L2_TO_L1_MSGS_PER_TX);
188
+ }
171
189
  const recipientAddress = EthAddress.fromField(recipient);
172
190
  this.newL2ToL1Messages.push(new L2ToL1Message(recipientAddress, content, this.sideEffectCounter));
173
191
  this.logger.debug(`NEW_L2_TO_L1_MSG cnt: ${this.sideEffectCounter}`);
@@ -175,7 +193,9 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
175
193
  }
176
194
 
177
195
  public traceUnencryptedLog(contractAddress: Fr, log: Fr[]) {
178
- // TODO(4805): check if some threshold is reached for max logs
196
+ if (this.unencryptedLogs.length >= MAX_UNENCRYPTED_LOGS_PER_TX) {
197
+ throw new SideEffectLimitReachedError('unencrypted log', MAX_UNENCRYPTED_LOGS_PER_TX);
198
+ }
179
199
  const ulog = new UnencryptedL2Log(
180
200
  AztecAddress.fromField(contractAddress),
181
201
  Buffer.concat(log.map(f => f.toBuffer())),
@@ -191,8 +211,9 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
191
211
  }
192
212
 
193
213
  public traceGetContractInstance(instance: TracedContractInstance) {
194
- // TODO(4805): check if some threshold is reached for max contract instance retrievals
195
- this.gotContractInstances.push(instance);
214
+ this.enforceLimitOnNullifierChecks('(contract address nullifier from GETCONTRACTINSTANCE)');
215
+ // TODO(dbanks12): should emit a nullifier read request
216
+
196
217
  this.avmCircuitHints.contractInstances.items.push(
197
218
  new AvmContractInstanceHint(
198
219
  instance.address,
@@ -228,6 +249,11 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
228
249
  /** Function name for logging */
229
250
  functionName: string = 'unknown',
230
251
  ) {
252
+ // TODO(4805): check if some threshold is reached for max nested calls (to unique contracts?)
253
+ // TODO(dbanks12): should emit a nullifier read request. There should be two thresholds.
254
+ // one for max unique contract calls, and another based on max nullifier reads.
255
+ // Since this trace function happens _after_ a nested call, such threshold limits must take
256
+ // place in another trace function that occurs _before_ a nested call.
231
257
  const result = nestedCallTrace.toPublicExecutionResult(
232
258
  nestedEnvironment,
233
259
  startGasLeft,
@@ -305,8 +331,6 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
305
331
  unencryptedLogs: new UnencryptedFunctionL2Logs(this.unencryptedLogs),
306
332
  allUnencryptedLogs: new UnencryptedFunctionL2Logs(this.allUnencryptedLogs),
307
333
  unencryptedLogsHashes: this.unencryptedLogsHashes,
308
- // TODO(dbanks12): process contract instance read requests in public kernel
309
- //gotContractInstances: this.gotContractInstances,
310
334
 
311
335
  publicCallRequests: this.publicCallRequests,
312
336
  nestedExecutions: this.nestedExecutions,
@@ -316,6 +340,27 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
316
340
  functionName,
317
341
  };
318
342
  }
343
+
344
+ private enforceLimitOnNullifierChecks(errorMsgOrigin: string = '') {
345
+ // NOTE: Why error if _either_ limit was reached? If user code emits either an existent or non-existent
346
+ // nullifier read request (NULLIFIEREXISTS, GETCONTRACTINSTANCE, *CALL), and one of the limits has been
347
+ // reached (MAX_NULLIFIER_NON_EXISTENT_RRS vs MAX_NULLIFIER_RRS), but not the other, we must prevent the
348
+ // sequencer from lying and saying "this nullifier exists, but MAX_NULLIFIER_RRS has been reached, so I'm
349
+ // going to skip the read request and just revert instead" when the nullifier actually doesn't exist
350
+ // (or vice versa). So, if either maximum has been reached, any nullifier-reading operation must error.
351
+ if (this.nullifierReadRequests.length >= MAX_NULLIFIER_READ_REQUESTS_PER_TX) {
352
+ throw new SideEffectLimitReachedError(
353
+ `nullifier read request ${errorMsgOrigin}`,
354
+ MAX_NULLIFIER_READ_REQUESTS_PER_TX,
355
+ );
356
+ }
357
+ if (this.nullifierNonExistentReadRequests.length >= MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX) {
358
+ throw new SideEffectLimitReachedError(
359
+ `nullifier non-existent read request ${errorMsgOrigin}`,
360
+ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX,
361
+ );
362
+ }
363
+ }
319
364
  }
320
365
 
321
366
  /**
@@ -8,6 +8,7 @@ import { type TracedContractInstance } from './side_effect_trace.js';
8
8
  export interface PublicSideEffectTraceInterface {
9
9
  fork(): PublicSideEffectTraceInterface;
10
10
  getCounter(): number;
11
+ // all "trace*" functions can throw SideEffectLimitReachedError
11
12
  tracePublicStorageRead(storageAddress: Fr, slot: Fr, value: Fr, exists: boolean, cached: boolean): void;
12
13
  tracePublicStorageWrite(storageAddress: Fr, slot: Fr, value: Fr): void;
13
14
  traceNoteHashCheck(storageAddress: Fr, noteHash: Fr, leafIndex: Fr, exists: boolean): void;
@@ -15,8 +16,7 @@ export interface PublicSideEffectTraceInterface {
15
16
  traceNullifierCheck(storageAddress: Fr, nullifier: Fr, leafIndex: Fr, exists: boolean, isPending: boolean): void;
16
17
  traceNewNullifier(storageAddress: Fr, nullifier: Fr): void;
17
18
  traceL1ToL2MessageCheck(contractAddress: Fr, msgHash: Fr, msgLeafIndex: Fr, exists: boolean): void;
18
- // TODO(dbanks12): should new message accept contract address as arg?
19
- traceNewL2ToL1Message(recipient: Fr, content: Fr): void;
19
+ traceNewL2ToL1Message(contractAddress: Fr, recipient: Fr, content: Fr): void;
20
20
  traceUnencryptedLog(contractAddress: Fr, log: Fr[]): void;
21
21
  // TODO(dbanks12): odd that getContractInstance is a one-off in that it accepts an entire object instead of components
22
22
  traceGetContractInstance(instance: TracedContractInstance): void;
@@ -1,104 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import { EncryptedFunctionL2Logs, type EncryptedL2Log, type EncryptedL2NoteLog, EncryptedNoteFunctionL2Logs, type Note, PublicExecutionRequest, UnencryptedFunctionL2Logs, type UnencryptedL2Log } from '@aztec/circuit-types';
3
- import { type IsEmpty, type PrivateCallStackItem } from '@aztec/circuits.js';
4
- import { type NoteSelector } from '@aztec/foundation/abi';
5
- import { type Fr } from '@aztec/foundation/fields';
6
- import { type ACVMField } from '../acvm/index.js';
7
- /**
8
- * The contents of a new note.
9
- */
10
- export interface NoteAndSlot {
11
- /** The note. */
12
- note: Note;
13
- /** The storage slot of the note. */
14
- storageSlot: Fr;
15
- /** The note type identifier. */
16
- noteTypeId: NoteSelector;
17
- }
18
- export declare class CountedLog<TLog extends UnencryptedL2Log | EncryptedL2NoteLog | EncryptedL2Log> implements IsEmpty {
19
- log: TLog;
20
- counter: number;
21
- constructor(log: TLog, counter: number);
22
- isEmpty(): boolean;
23
- }
24
- export declare class CountedNoteLog extends CountedLog<EncryptedL2NoteLog> {
25
- noteHashCounter: number;
26
- constructor(log: EncryptedL2NoteLog, counter: number, noteHashCounter: number);
27
- }
28
- export declare class CountedPublicExecutionRequest {
29
- request: PublicExecutionRequest;
30
- counter: number;
31
- constructor(request: PublicExecutionRequest, counter: number);
32
- isEmpty(): boolean;
33
- }
34
- /**
35
- * The result of executing a private function.
36
- */
37
- export interface ExecutionResult {
38
- /** The ACIR bytecode. */
39
- acir: Buffer;
40
- /** The verification key. */
41
- vk: Buffer;
42
- /** The partial witness. */
43
- partialWitness: Map<number, ACVMField>;
44
- /** The call stack item. */
45
- callStackItem: PrivateCallStackItem;
46
- /** Mapping of note hash to its index in the note hash tree. Used for building hints for note hash read requests. */
47
- noteHashLeafIndexMap: Map<bigint, bigint>;
48
- /** The notes created in the executed function. */
49
- newNotes: NoteAndSlot[];
50
- /** Mapping of note hash counter to the counter of its nullifier. */
51
- noteHashNullifierCounterMap: Map<number, number>;
52
- /** The raw return values of the executed function. */
53
- returnValues: Fr[];
54
- /** The nested executions. */
55
- nestedExecutions: this[];
56
- /** Enqueued public function execution requests to be picked up by the sequencer. */
57
- enqueuedPublicFunctionCalls: CountedPublicExecutionRequest[];
58
- /** Public function execution requested for teardown */
59
- publicTeardownFunctionCall: PublicExecutionRequest;
60
- /**
61
- * Encrypted note logs emitted during execution of this function call.
62
- * Note: These are preimages to `noteEncryptedLogsHashes`.
63
- */
64
- noteEncryptedLogs: CountedNoteLog[];
65
- /**
66
- * Encrypted logs emitted during execution of this function call.
67
- * Note: These are preimages to `encryptedLogsHashes`.
68
- */
69
- encryptedLogs: CountedLog<EncryptedL2Log>[];
70
- /**
71
- * Unencrypted logs emitted during execution of this function call.
72
- * Note: These are preimages to `unencryptedLogsHashes`.
73
- */
74
- unencryptedLogs: CountedLog<UnencryptedL2Log>[];
75
- }
76
- export declare function collectNoteHashLeafIndexMap(execResult: ExecutionResult, accum?: Map<bigint, bigint>): Map<bigint, bigint>;
77
- export declare function collectNoteHashNullifierCounterMap(execResult: ExecutionResult, accum?: Map<number, number>): Map<number, number>;
78
- /**
79
- * Collect all encrypted logs across all nested executions and sorts by counter.
80
- * @param execResult - The topmost execution result.
81
- * @returns All encrypted logs.
82
- */
83
- export declare function collectSortedNoteEncryptedLogs(execResult: ExecutionResult): EncryptedNoteFunctionL2Logs;
84
- /**
85
- * Collect all encrypted logs across all nested executions and sorts by counter.
86
- * @param execResult - The topmost execution result.
87
- * @returns All encrypted logs.
88
- */
89
- export declare function collectSortedEncryptedLogs(execResult: ExecutionResult): EncryptedFunctionL2Logs;
90
- /**
91
- * Collect all unencrypted logs across all nested executions and sorts by counter.
92
- * @param execResult - The topmost execution result.
93
- * @returns All unencrypted logs.
94
- */
95
- export declare function collectSortedUnencryptedLogs(execResult: ExecutionResult): UnencryptedFunctionL2Logs;
96
- /**
97
- * Collect all enqueued public function calls across all nested executions.
98
- * @param execResult - The topmost execution result.
99
- * @returns All enqueued public function calls.
100
- */
101
- export declare function collectEnqueuedPublicFunctionCalls(execResult: ExecutionResult): PublicExecutionRequest[];
102
- export declare function collectPublicTeardownFunctionCall(execResult: ExecutionResult): PublicExecutionRequest;
103
- export declare function getFinalMinRevertibleSideEffectCounter(execResult: ExecutionResult): number;
104
- //# sourceMappingURL=execution_result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution_result.d.ts","sourceRoot":"","sources":["../../src/client/execution_result.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,2BAA2B,EAC3B,KAAK,IAAI,EACT,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,oBAAoB,EAAiB,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,oCAAoC;IACpC,WAAW,EAAE,EAAE,CAAC;IAChB,gCAAgC;IAChC,UAAU,EAAE,YAAY,CAAC;CAC1B;AAED,qBAAa,UAAU,CAAC,IAAI,SAAS,gBAAgB,GAAG,kBAAkB,GAAG,cAAc,CAAE,YAAW,OAAO;IAC1F,GAAG,EAAE,IAAI;IAAS,OAAO,EAAE,MAAM;gBAAjC,GAAG,EAAE,IAAI,EAAS,OAAO,EAAE,MAAM;IAEpD,OAAO,IAAI,OAAO;CAGnB;AAED,qBAAa,cAAe,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IACH,eAAe,EAAE,MAAM;gBAA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D,UAAU,EAAE,eAAe,EAC3B,KAAK,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAa,uBAKvC;AA0BD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,eAAe,GAAG,2BAA2B,CAMvG;AAUD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,eAAe,GAAG,uBAAuB,CAI/F;AAWD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,eAAe,GAAG,yBAAyB,CAInG;AASD;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,eAAe,GAAG,sBAAsB,EAAE,CAKxG;AAED,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,eAAe,GAAG,sBAAsB,CAerG;AAED,wBAAgB,sCAAsC,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAK1F"}
@@ -1,136 +0,0 @@
1
- import { EncryptedFunctionL2Logs, EncryptedNoteFunctionL2Logs, PublicExecutionRequest, UnencryptedFunctionL2Logs, } from '@aztec/circuit-types';
2
- import { sortByCounter } from '@aztec/circuits.js';
3
- export class CountedLog {
4
- constructor(log, counter) {
5
- this.log = log;
6
- this.counter = counter;
7
- }
8
- isEmpty() {
9
- return !this.log.data.length && !this.counter;
10
- }
11
- }
12
- export class CountedNoteLog extends CountedLog {
13
- constructor(log, counter, noteHashCounter) {
14
- super(log, counter);
15
- this.noteHashCounter = noteHashCounter;
16
- }
17
- }
18
- export class CountedPublicExecutionRequest {
19
- constructor(request, counter) {
20
- this.request = request;
21
- this.counter = counter;
22
- }
23
- isEmpty() {
24
- return this.request.isEmpty() && !this.counter;
25
- }
26
- }
27
- export function collectNoteHashLeafIndexMap(execResult, accum = new Map()) {
28
- execResult.noteHashLeafIndexMap.forEach((value, key) => accum.set(key, value));
29
- execResult.nestedExecutions.forEach(nested => collectNoteHashLeafIndexMap(nested, accum));
30
- return accum;
31
- }
32
- export function collectNoteHashNullifierCounterMap(execResult, accum = new Map()) {
33
- execResult.noteHashNullifierCounterMap.forEach((value, key) => accum.set(key, value));
34
- execResult.nestedExecutions.forEach(nested => collectNoteHashNullifierCounterMap(nested, accum));
35
- return accum;
36
- }
37
- /**
38
- * Collect all encrypted logs across all nested executions.
39
- * @param execResult - The topmost execution result.
40
- * @returns All encrypted logs.
41
- */
42
- function collectNoteEncryptedLogs(execResult, noteHashNullifierCounterMap, minRevertibleSideEffectCounter) {
43
- return [
44
- execResult.noteEncryptedLogs.filter(noteLog => {
45
- const nullifierCounter = noteHashNullifierCounterMap.get(noteLog.noteHashCounter);
46
- return (nullifierCounter === undefined ||
47
- (noteLog.noteHashCounter < minRevertibleSideEffectCounter && nullifierCounter >= minRevertibleSideEffectCounter));
48
- }),
49
- ...execResult.nestedExecutions.flatMap(res => collectNoteEncryptedLogs(res, noteHashNullifierCounterMap, minRevertibleSideEffectCounter)),
50
- ].flat();
51
- }
52
- /**
53
- * Collect all encrypted logs across all nested executions and sorts by counter.
54
- * @param execResult - The topmost execution result.
55
- * @returns All encrypted logs.
56
- */
57
- export function collectSortedNoteEncryptedLogs(execResult) {
58
- const noteHashNullifierCounterMap = collectNoteHashNullifierCounterMap(execResult);
59
- const minRevertibleSideEffectCounter = getFinalMinRevertibleSideEffectCounter(execResult);
60
- const allLogs = collectNoteEncryptedLogs(execResult, noteHashNullifierCounterMap, minRevertibleSideEffectCounter);
61
- const sortedLogs = sortByCounter(allLogs);
62
- return new EncryptedNoteFunctionL2Logs(sortedLogs.map(l => l.log));
63
- }
64
- /**
65
- * Collect all encrypted logs across all nested executions.
66
- * @param execResult - The topmost execution result.
67
- * @returns All encrypted logs.
68
- */
69
- function collectEncryptedLogs(execResult) {
70
- return [execResult.encryptedLogs, ...execResult.nestedExecutions.flatMap(collectEncryptedLogs)].flat();
71
- }
72
- /**
73
- * Collect all encrypted logs across all nested executions and sorts by counter.
74
- * @param execResult - The topmost execution result.
75
- * @returns All encrypted logs.
76
- */
77
- export function collectSortedEncryptedLogs(execResult) {
78
- const allLogs = collectEncryptedLogs(execResult);
79
- const sortedLogs = sortByCounter(allLogs);
80
- return new EncryptedFunctionL2Logs(sortedLogs.map(l => l.log));
81
- }
82
- /**
83
- * Collect all unencrypted logs across all nested executions.
84
- * @param execResult - The topmost execution result.
85
- * @returns All unencrypted logs.
86
- */
87
- function collectUnencryptedLogs(execResult) {
88
- return [execResult.unencryptedLogs, ...execResult.nestedExecutions.flatMap(collectUnencryptedLogs)].flat();
89
- }
90
- /**
91
- * Collect all unencrypted logs across all nested executions and sorts by counter.
92
- * @param execResult - The topmost execution result.
93
- * @returns All unencrypted logs.
94
- */
95
- export function collectSortedUnencryptedLogs(execResult) {
96
- const allLogs = collectUnencryptedLogs(execResult);
97
- const sortedLogs = sortByCounter(allLogs);
98
- return new UnencryptedFunctionL2Logs(sortedLogs.map(l => l.log));
99
- }
100
- function collectEnqueuedCountedPublicExecutionRequests(execResult) {
101
- return [
102
- ...execResult.enqueuedPublicFunctionCalls,
103
- ...execResult.nestedExecutions.flatMap(collectEnqueuedCountedPublicExecutionRequests),
104
- ];
105
- }
106
- /**
107
- * Collect all enqueued public function calls across all nested executions.
108
- * @param execResult - The topmost execution result.
109
- * @returns All enqueued public function calls.
110
- */
111
- export function collectEnqueuedPublicFunctionCalls(execResult) {
112
- const countedRequests = collectEnqueuedCountedPublicExecutionRequests(execResult);
113
- // without the reverse sort, the logs will be in a queue like fashion which is wrong
114
- // as the kernel processes it like a stack, popping items off and pushing them to output
115
- return sortByCounter(countedRequests, false).map(r => r.request);
116
- }
117
- export function collectPublicTeardownFunctionCall(execResult) {
118
- const teardownCalls = [
119
- execResult.publicTeardownFunctionCall,
120
- ...execResult.nestedExecutions.flatMap(collectPublicTeardownFunctionCall),
121
- ].filter(call => !call.isEmpty());
122
- if (teardownCalls.length === 1) {
123
- return teardownCalls[0];
124
- }
125
- if (teardownCalls.length > 1) {
126
- throw new Error('Multiple public teardown calls detected');
127
- }
128
- return PublicExecutionRequest.empty();
129
- }
130
- export function getFinalMinRevertibleSideEffectCounter(execResult) {
131
- return execResult.nestedExecutions.reduce((counter, exec) => {
132
- const nestedCounter = getFinalMinRevertibleSideEffectCounter(exec);
133
- return nestedCounter ? nestedCounter : counter;
134
- }, execResult.callStackItem.publicInputs.minRevertibleSideEffectCounter.toNumber());
135
- }
136
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhlY3V0aW9uX3Jlc3VsdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbGllbnQvZXhlY3V0aW9uX3Jlc3VsdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBR3ZCLDJCQUEyQixFQUUzQixzQkFBc0IsRUFDdEIseUJBQXlCLEdBRTFCLE1BQU0sc0JBQXNCLENBQUM7QUFDOUIsT0FBTyxFQUEyQyxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQWtCNUYsTUFBTSxPQUFPLFVBQVU7SUFDckIsWUFBbUIsR0FBUyxFQUFTLE9BQWU7UUFBakMsUUFBRyxHQUFILEdBQUcsQ0FBTTtRQUFTLFlBQU8sR0FBUCxPQUFPLENBQVE7SUFBRyxDQUFDO0lBRXhELE9BQU87UUFDTCxPQUFPLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUNoRCxDQUFDO0NBQ0Y7QUFFRCxNQUFNLE9BQU8sY0FBZSxTQUFRLFVBQThCO0lBQ2hFLFlBQVksR0FBdUIsRUFBRSxPQUFlLEVBQVMsZUFBdUI7UUFDbEYsS0FBSyxDQUFDLEdBQUcsRUFBRSxPQUFPLENBQUMsQ0FBQztRQUR1QyxvQkFBZSxHQUFmLGVBQWUsQ0FBUTtJQUVwRixDQUFDO0NBQ0Y7QU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sTUFBTSxLQUFLLENBQUMsRUFBRSxDQUFDO1FBQy9CLE9BQU8sYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzFCLENBQUM7SUFFRCxJQUFJLGFBQWEsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFLENBQUM7UUFDN0IsTUFBTSxJQUFJLEtBQUssQ0FBQyx5Q0FBeUMsQ0FBQyxDQUFDO0lBQzdELENBQUM7SUFFRCxPQUFPLHNCQUFzQixDQUFDLEtBQUssRUFBRSxDQUFDO0FBQ3hDLENBQUM7QUFFRCxNQUFNLFVBQVUsc0NBQXNDLENBQUMsVUFBMkI7SUFDaEYsT0FBTyxVQUFVLENBQUMsZ0JBQWdCLENBQUMsTUFBTSxDQUFDLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRSxFQUFFO1FBQzFELE1BQU0sYUFBYSxHQUFHLHNDQUFzQyxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQ25FLE9BQU8sYUFBYSxDQUFDLENBQUMsQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQztJQUNqRCxDQUFDLEVBQUUsVUFBVSxDQUFDLGFBQWEsQ0FBQyxZQUFZLENBQUMsOEJBQThCLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQztBQUN0RixDQUFDIn0=
@@ -1,11 +0,0 @@
1
- import { NestedProcessReturnValues } from '@aztec/circuit-types';
2
- import type { ExecutionResult } from '../client/execution_result.js';
3
- import type { PublicExecutionResult } from '../public/execution.js';
4
- /**
5
- * Recursively accummulate the return values of a call result and its nested executions,
6
- * so they can be retrieved in order.
7
- * @param executionResult
8
- * @returns
9
- */
10
- export declare function accumulateReturnValues(executionResult: PublicExecutionResult | ExecutionResult): NestedProcessReturnValues;
11
- //# sourceMappingURL=return_values.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"return_values.d.ts","sourceRoot":"","sources":["../../src/common/return_values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,qBAAqB,GAAG,eAAe,GACvD,yBAAyB,CAI3B"}
@@ -1,13 +0,0 @@
1
- import { NestedProcessReturnValues } from '@aztec/circuit-types';
2
- /**
3
- * Recursively accummulate the return values of a call result and its nested executions,
4
- * so they can be retrieved in order.
5
- * @param executionResult
6
- * @returns
7
- */
8
- export function accumulateReturnValues(executionResult) {
9
- const acc = new NestedProcessReturnValues(executionResult.returnValues);
10
- acc.nested = executionResult.nestedExecutions.map(nestedExecution => accumulateReturnValues(nestedExecution));
11
- return acc;
12
- }
13
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV0dXJuX3ZhbHVlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vcmV0dXJuX3ZhbHVlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUtqRTs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxzQkFBc0IsQ0FDcEMsZUFBd0Q7SUFFeEQsTUFBTSxHQUFHLEdBQUcsSUFBSSx5QkFBeUIsQ0FBQyxlQUFlLENBQUMsWUFBWSxDQUFDLENBQUM7SUFDeEUsR0FBRyxDQUFDLE1BQU0sR0FBRyxlQUFlLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxDQUFDLGVBQWUsQ0FBQyxFQUFFLENBQUMsc0JBQXNCLENBQUMsZUFBZSxDQUFDLENBQUMsQ0FBQztJQUM5RyxPQUFPLEdBQUcsQ0FBQztBQUNiLENBQUMifQ==