@aztec/simulator 0.65.2 → 0.67.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 (136) hide show
  1. package/dest/acvm/acvm.js +3 -3
  2. package/dest/acvm/oracle/oracle.d.ts +1 -4
  3. package/dest/acvm/oracle/oracle.d.ts.map +1 -1
  4. package/dest/acvm/oracle/oracle.js +3 -19
  5. package/dest/acvm/oracle/typed_oracle.d.ts +2 -7
  6. package/dest/acvm/oracle/typed_oracle.d.ts.map +1 -1
  7. package/dest/acvm/oracle/typed_oracle.js +3 -12
  8. package/dest/acvm/serialize.js +2 -2
  9. package/dest/avm/avm_context.d.ts +2 -2
  10. package/dest/avm/avm_context.d.ts.map +1 -1
  11. package/dest/avm/avm_context.js +3 -4
  12. package/dest/avm/avm_execution_environment.d.ts +4 -6
  13. package/dest/avm/avm_execution_environment.d.ts.map +1 -1
  14. package/dest/avm/avm_execution_environment.js +8 -13
  15. package/dest/avm/avm_memory_types.d.ts +2 -2
  16. package/dest/avm/avm_memory_types.d.ts.map +1 -1
  17. package/dest/avm/avm_memory_types.js +7 -7
  18. package/dest/avm/avm_simulator.d.ts +3 -3
  19. package/dest/avm/avm_simulator.d.ts.map +1 -1
  20. package/dest/avm/avm_simulator.js +26 -16
  21. package/dest/avm/avm_tree.d.ts +31 -14
  22. package/dest/avm/avm_tree.d.ts.map +1 -1
  23. package/dest/avm/avm_tree.js +34 -40
  24. package/dest/avm/errors.d.ts +3 -3
  25. package/dest/avm/errors.d.ts.map +1 -1
  26. package/dest/avm/errors.js +8 -15
  27. package/dest/avm/fixtures/index.d.ts.map +1 -1
  28. package/dest/avm/fixtures/index.js +4 -4
  29. package/dest/avm/journal/journal.d.ts +15 -4
  30. package/dest/avm/journal/journal.d.ts.map +1 -1
  31. package/dest/avm/journal/journal.js +121 -36
  32. package/dest/avm/opcodes/environment_getters.d.ts +10 -11
  33. package/dest/avm/opcodes/environment_getters.d.ts.map +1 -1
  34. package/dest/avm/opcodes/environment_getters.js +12 -15
  35. package/dest/avm/opcodes/external_calls.d.ts.map +1 -1
  36. package/dest/avm/opcodes/external_calls.js +4 -11
  37. package/dest/avm/opcodes/misc.d.ts.map +1 -1
  38. package/dest/avm/opcodes/misc.js +3 -3
  39. package/dest/client/client_execution_context.d.ts +6 -33
  40. package/dest/client/client_execution_context.d.ts.map +1 -1
  41. package/dest/client/client_execution_context.js +18 -54
  42. package/dest/client/db_oracle.d.ts +2 -2
  43. package/dest/client/db_oracle.d.ts.map +1 -1
  44. package/dest/client/execution_note_cache.d.ts +9 -1
  45. package/dest/client/execution_note_cache.d.ts.map +1 -1
  46. package/dest/client/execution_note_cache.js +10 -3
  47. package/dest/client/private_execution.d.ts.map +1 -1
  48. package/dest/client/private_execution.js +5 -7
  49. package/dest/client/simulator.d.ts.map +1 -1
  50. package/dest/client/simulator.js +4 -4
  51. package/dest/client/unconstrained_execution.d.ts.map +1 -1
  52. package/dest/client/unconstrained_execution.js +3 -3
  53. package/dest/client/view_data_oracle.d.ts +2 -2
  54. package/dest/client/view_data_oracle.d.ts.map +1 -1
  55. package/dest/client/view_data_oracle.js +5 -6
  56. package/dest/common/debug_fn_name.d.ts +2 -2
  57. package/dest/common/debug_fn_name.d.ts.map +1 -1
  58. package/dest/common/debug_fn_name.js +8 -14
  59. package/dest/providers/acvm_native.js +4 -4
  60. package/dest/providers/factory.d.ts +2 -2
  61. package/dest/providers/factory.d.ts.map +1 -1
  62. package/dest/providers/factory.js +4 -4
  63. package/dest/public/enqueued_call_side_effect_trace.d.ts +11 -23
  64. package/dest/public/enqueued_call_side_effect_trace.d.ts.map +1 -1
  65. package/dest/public/enqueued_call_side_effect_trace.js +51 -72
  66. package/dest/public/executor_metrics.d.ts.map +1 -1
  67. package/dest/public/executor_metrics.js +2 -5
  68. package/dest/public/fixtures/index.d.ts +25 -7
  69. package/dest/public/fixtures/index.d.ts.map +1 -1
  70. package/dest/public/fixtures/index.js +20 -17
  71. package/dest/public/index.d.ts +0 -1
  72. package/dest/public/index.d.ts.map +1 -1
  73. package/dest/public/index.js +1 -2
  74. package/dest/public/public_db_sources.d.ts.map +1 -1
  75. package/dest/public/public_db_sources.js +30 -16
  76. package/dest/public/public_processor.d.ts +7 -8
  77. package/dest/public/public_processor.d.ts.map +1 -1
  78. package/dest/public/public_processor.js +37 -26
  79. package/dest/public/public_processor_metrics.d.ts +1 -1
  80. package/dest/public/public_processor_metrics.d.ts.map +1 -1
  81. package/dest/public/public_tx_context.d.ts +13 -14
  82. package/dest/public/public_tx_context.d.ts.map +1 -1
  83. package/dest/public/public_tx_context.js +63 -54
  84. package/dest/public/public_tx_simulator.d.ts +2 -2
  85. package/dest/public/public_tx_simulator.d.ts.map +1 -1
  86. package/dest/public/public_tx_simulator.js +43 -25
  87. package/dest/public/side_effect_trace_interface.d.ts +4 -17
  88. package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
  89. package/dest/public/transitional_adapters.d.ts +2 -6
  90. package/dest/public/transitional_adapters.d.ts.map +1 -1
  91. package/dest/public/transitional_adapters.js +29 -88
  92. package/package.json +16 -9
  93. package/src/acvm/acvm.ts +2 -2
  94. package/src/acvm/oracle/oracle.ts +2 -32
  95. package/src/acvm/oracle/typed_oracle.ts +3 -20
  96. package/src/acvm/serialize.ts +1 -1
  97. package/src/avm/avm_context.ts +2 -3
  98. package/src/avm/avm_execution_environment.ts +6 -31
  99. package/src/avm/avm_memory_types.ts +6 -6
  100. package/src/avm/avm_simulator.ts +28 -23
  101. package/src/avm/avm_tree.ts +67 -53
  102. package/src/avm/errors.ts +12 -14
  103. package/src/avm/fixtures/index.ts +2 -3
  104. package/src/avm/journal/journal.ts +206 -68
  105. package/src/avm/opcodes/environment_getters.ts +1 -4
  106. package/src/avm/opcodes/external_calls.ts +3 -19
  107. package/src/avm/opcodes/misc.ts +2 -2
  108. package/src/client/client_execution_context.ts +22 -68
  109. package/src/client/db_oracle.ts +2 -2
  110. package/src/client/execution_note_cache.ts +13 -3
  111. package/src/client/private_execution.ts +3 -7
  112. package/src/client/simulator.ts +4 -4
  113. package/src/client/unconstrained_execution.ts +2 -2
  114. package/src/client/view_data_oracle.ts +5 -6
  115. package/src/common/debug_fn_name.ts +7 -13
  116. package/src/providers/acvm_native.ts +3 -3
  117. package/src/providers/factory.ts +3 -3
  118. package/src/public/enqueued_call_side_effect_trace.ts +68 -90
  119. package/src/public/executor_metrics.ts +0 -4
  120. package/src/public/fixtures/index.ts +28 -17
  121. package/src/public/index.ts +0 -1
  122. package/src/public/public_db_sources.ts +32 -19
  123. package/src/public/public_processor.ts +52 -55
  124. package/src/public/public_processor_metrics.ts +1 -1
  125. package/src/public/public_tx_context.ts +89 -76
  126. package/src/public/public_tx_simulator.ts +58 -49
  127. package/src/public/side_effect_trace_interface.ts +8 -15
  128. package/src/public/transitional_adapters.ts +43 -215
  129. package/dest/public/dual_side_effect_trace.d.ts +0 -77
  130. package/dest/public/dual_side_effect_trace.d.ts.map +0 -1
  131. package/dest/public/dual_side_effect_trace.js +0 -119
  132. package/dest/public/side_effect_trace.d.ts +0 -96
  133. package/dest/public/side_effect_trace.d.ts.map +0 -1
  134. package/dest/public/side_effect_trace.js +0 -309
  135. package/src/public/dual_side_effect_trace.ts +0 -242
  136. package/src/public/side_effect_trace.ts +0 -536
@@ -10,16 +10,10 @@ import {
10
10
  UnencryptedFunctionL2Logs,
11
11
  } from '@aztec/circuit-types';
12
12
  import { type AvmSimulationStats } from '@aztec/circuit-types/stats';
13
- import {
14
- type Fr,
15
- Gas,
16
- type GlobalVariables,
17
- MAX_L2_GAS_PER_ENQUEUED_CALL,
18
- type PublicCallRequest,
19
- type RevertCode,
20
- } from '@aztec/circuits.js';
21
- import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
13
+ import { type Fr, type Gas, type GlobalVariables, type PublicCallRequest, type RevertCode } from '@aztec/circuits.js';
14
+ import { type Logger, createLogger } from '@aztec/foundation/log';
22
15
  import { Timer } from '@aztec/foundation/timer';
16
+ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
23
17
  import { Attributes, type TelemetryClient, type Tracer, trackSpan } from '@aztec/telemetry-client';
24
18
 
25
19
  import { strict as assert } from 'assert';
@@ -29,6 +23,7 @@ import { type AvmPersistableStateManager, AvmSimulator } from '../avm/index.js';
29
23
  import { NullifierCollisionError } from '../avm/journal/nullifiers.js';
30
24
  import { getPublicFunctionDebugName } from '../common/debug_fn_name.js';
31
25
  import { ExecutorMetrics } from './executor_metrics.js';
26
+ import { computeFeePayerBalanceStorageSlot } from './fee_payment.js';
32
27
  import { type WorldStateDB } from './public_db_sources.js';
33
28
  import { PublicTxContext } from './public_tx_context.js';
34
29
 
@@ -53,17 +48,16 @@ export type PublicTxResult = {
53
48
  export class PublicTxSimulator {
54
49
  metrics: ExecutorMetrics;
55
50
 
56
- private log: DebugLogger;
51
+ private log: Logger;
57
52
 
58
53
  constructor(
59
54
  private db: MerkleTreeReadOperations,
60
55
  private worldStateDB: WorldStateDB,
61
56
  telemetryClient: TelemetryClient,
62
57
  private globalVariables: GlobalVariables,
63
- private realAvmProvingRequests: boolean = true,
64
58
  private doMerkleOperations: boolean = false,
65
59
  ) {
66
- this.log = createDebugLogger(`aztec:public_tx_simulator`);
60
+ this.log = createLogger(`simulator:public_tx_simulator`);
67
61
  this.metrics = new ExecutorMetrics(telemetryClient, 'PublicTxSimulator');
68
62
  }
69
63
 
@@ -75,8 +69,9 @@ export class PublicTxSimulator {
75
69
  * @param tx - The transaction to simulate.
76
70
  * @returns The result of the transaction's public execution.
77
71
  */
78
- async simulate(tx: Tx): Promise<PublicTxResult> {
79
- this.log.verbose(`Processing tx ${tx.getTxHash()}`);
72
+ public async simulate(tx: Tx): Promise<PublicTxResult> {
73
+ const txHash = tx.getTxHash();
74
+ this.log.debug(`Simulating ${tx.enqueuedPublicFunctionCalls.length} public calls for tx ${txHash}`, { txHash });
80
75
 
81
76
  const context = await PublicTxContext.create(
82
77
  this.db,
@@ -107,11 +102,14 @@ export class PublicTxSimulator {
107
102
  const appLogicResult: ProcessedPhase = await this.simulateAppLogicPhase(context);
108
103
  processedPhases.push(appLogicResult);
109
104
  }
105
+
110
106
  if (context.hasPhase(TxExecutionPhase.TEARDOWN)) {
111
107
  const teardownResult: ProcessedPhase = await this.simulateTeardownPhase(context);
112
108
  processedPhases.push(teardownResult);
113
109
  }
110
+
114
111
  context.halt();
112
+ await this.payFee(context);
115
113
 
116
114
  const endStateReference = await this.db.getStateReference();
117
115
 
@@ -210,7 +208,12 @@ export class PublicTxSimulator {
210
208
  const callRequests = context.getCallRequestsForPhase(phase);
211
209
  const executionRequests = context.getExecutionRequestsForPhase(phase);
212
210
 
213
- this.log.debug(`Beginning processing in phase ${TxExecutionPhase[phase]} for tx ${context.getTxHash()}`);
211
+ this.log.debug(`Processing phase ${TxExecutionPhase[phase]} for tx ${context.getTxHash()}`, {
212
+ txHash: context.getTxHash().toString(),
213
+ phase: TxExecutionPhase[phase],
214
+ callRequests: callRequests.length,
215
+ executionRequests: executionRequests.length,
216
+ });
214
217
 
215
218
  const returnValues: NestedProcessReturnValues[] = [];
216
219
  let reverted = false;
@@ -265,40 +268,22 @@ export class PublicTxSimulator {
265
268
  ): Promise<AvmFinalizedCallResult> {
266
269
  const stateManager = context.state.getActiveStateManager();
267
270
  const address = executionRequest.callContext.contractAddress;
268
- const selector = executionRequest.callContext.functionSelector;
269
- const fnName = await getPublicFunctionDebugName(this.worldStateDB, address, selector, executionRequest.args);
270
-
271
- const availableGas = context.getGasLeftForPhase(phase);
272
- // Gas allocated to an enqueued call can be different from the available gas
273
- // if there is more gas available than the max allocation per enqueued call.
274
- const allocatedGas = new Gas(
275
- /*daGas=*/ availableGas.daGas,
276
- /*l2Gas=*/ Math.min(availableGas.l2Gas, MAX_L2_GAS_PER_ENQUEUED_CALL),
277
- );
271
+ const fnName = await getPublicFunctionDebugName(this.worldStateDB, address, executionRequest.args);
272
+
273
+ const allocatedGas = context.getGasLeftAtPhase(phase);
278
274
 
279
275
  const result = await this.simulateEnqueuedCallInternal(
280
276
  context.state.getActiveStateManager(),
281
277
  executionRequest,
282
278
  allocatedGas,
283
- context.getTransactionFee(phase),
279
+ /*transactionFee=*/ context.getTransactionFee(phase),
284
280
  fnName,
285
281
  );
286
282
 
287
- const gasUsed = allocatedGas.sub(result.gasLeft);
283
+ const gasUsed = allocatedGas.sub(result.gasLeft); // by enqueued call
288
284
  context.consumeGas(phase, gasUsed);
289
- this.log.verbose(
290
- `[AVM] Enqueued public call consumed ${gasUsed.l2Gas} L2 gas ending with ${result.gasLeft.l2Gas} L2 gas left.`,
291
- );
292
-
293
- // TODO(dbanks12): remove once AVM proves entire public tx
294
- context.updateProvingRequest(
295
- this.realAvmProvingRequests,
296
- phase,
297
- fnName,
298
- stateManager,
299
- executionRequest,
300
- result,
301
- allocatedGas,
285
+ this.log.debug(
286
+ `Simulated enqueued public call consumed ${gasUsed.l2Gas} L2 gas ending with ${result.gasLeft.l2Gas} L2 gas left.`,
302
287
  );
303
288
 
304
289
  stateManager.traceEnqueuedCall(callRequest, executionRequest.args, result.reverted);
@@ -340,18 +325,16 @@ export class PublicTxSimulator {
340
325
  ): Promise<AvmFinalizedCallResult> {
341
326
  const address = executionRequest.callContext.contractAddress;
342
327
  const sender = executionRequest.callContext.msgSender;
343
- const selector = executionRequest.callContext.functionSelector;
344
328
 
345
- this.log.verbose(
346
- `[AVM] Executing enqueued public call to external function ${fnName}@${address} with ${allocatedGas.l2Gas} allocated L2 gas.`,
329
+ this.log.debug(
330
+ `Executing enqueued public call to external function ${fnName}@${address} with ${allocatedGas.l2Gas} allocated L2 gas.`,
347
331
  );
348
332
  const timer = new Timer();
349
333
 
350
- const simulator = AvmSimulator.create(
334
+ const simulator = await AvmSimulator.create(
351
335
  stateManager,
352
336
  address,
353
337
  sender,
354
- selector,
355
338
  transactionFee,
356
339
  this.globalVariables,
357
340
  executionRequest.callContext.isStaticCall,
@@ -361,10 +344,10 @@ export class PublicTxSimulator {
361
344
  const avmCallResult = await simulator.execute();
362
345
  const result = avmCallResult.finalize();
363
346
 
364
- this.log.verbose(
365
- `[AVM] Simulation of enqueued public call ${fnName} completed. reverted: ${result.reverted}${
366
- result.reverted ? ', reason: ' + result.revertReason : ''
367
- }.`,
347
+ this.log.debug(
348
+ result.reverted
349
+ ? `Simulation of enqueued public call ${fnName} reverted with reason ${result.revertReason}.`
350
+ : `Simulation of enqueued public call ${fnName} completed successfully.`,
368
351
  {
369
352
  eventName: 'avm-simulation',
370
353
  appCircuitName: fnName,
@@ -415,4 +398,30 @@ export class PublicTxSimulator {
415
398
  }
416
399
  }
417
400
  }
401
+
402
+ private async payFee(context: PublicTxContext) {
403
+ const txFee = context.getTransactionFee(TxExecutionPhase.TEARDOWN);
404
+
405
+ if (context.feePayer.isZero()) {
406
+ this.log.debug(`No one is paying the fee of ${txFee.toBigInt()}`);
407
+ return;
408
+ }
409
+
410
+ const feeJuiceAddress = ProtocolContractAddress.FeeJuice;
411
+ const balanceSlot = computeFeePayerBalanceStorageSlot(context.feePayer);
412
+
413
+ this.log.debug(`Deducting ${txFee.toBigInt()} balance in Fee Juice for ${context.feePayer}`);
414
+ const stateManager = context.state.getActiveStateManager();
415
+
416
+ const currentBalance = await stateManager.readStorage(feeJuiceAddress, balanceSlot);
417
+
418
+ if (currentBalance.lt(txFee)) {
419
+ throw new Error(
420
+ `Not enough balance for fee payer to pay for transaction (got ${currentBalance.toBigInt()} needs ${txFee.toBigInt()})`,
421
+ );
422
+ }
423
+
424
+ const updatedBalance = currentBalance.sub(txFee);
425
+ await stateManager.writeStorage(feeJuiceAddress, balanceSlot, updatedBalance, true);
426
+ }
418
427
  }
@@ -10,7 +10,7 @@ import {
10
10
  import { type AztecAddress } from '@aztec/foundation/aztec-address';
11
11
  import { type Fr } from '@aztec/foundation/fields';
12
12
 
13
- import { type AvmContractCallResult, type AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
13
+ import { type AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
14
14
  import { type AvmExecutionEnvironment } from '../avm/avm_execution_environment.js';
15
15
  import { type EnqueuedPublicCallExecutionResultWithSideEffects, type PublicFunctionCallResult } from './execution.js';
16
16
 
@@ -31,6 +31,7 @@ export interface PublicSideEffectTraceInterface {
31
31
  contractAddress: AztecAddress,
32
32
  slot: Fr, // This is the storage slot not the computed leaf slot
33
33
  value: Fr,
34
+ protocolWrite: boolean,
34
35
  lowLeafPreimage?: PublicDataTreeLeafPreimage,
35
36
  lowLeafIndex?: Fr,
36
37
  lowLeafPath?: Fr[],
@@ -66,6 +67,9 @@ export interface PublicSideEffectTraceInterface {
66
67
  contractAddress: AztecAddress,
67
68
  exists: boolean,
68
69
  instance?: SerializableContractInstance,
70
+ lowLeafPreimage?: NullifierLeafPreimage,
71
+ lowLeafIndex?: Fr,
72
+ lowLeafPath?: Fr[],
69
73
  ): void;
70
74
  traceGetBytecode(
71
75
  contractAddress: AztecAddress,
@@ -73,20 +77,9 @@ export interface PublicSideEffectTraceInterface {
73
77
  bytecode?: Buffer,
74
78
  contractInstance?: SerializableContractInstance,
75
79
  contractClass?: ContractClassIdPreimage,
76
- ): void;
77
- traceNestedCall(
78
- /** The trace of the nested call. */
79
- nestedCallTrace: PublicSideEffectTraceInterface,
80
- /** The execution environment of the nested call. */
81
- nestedEnvironment: AvmExecutionEnvironment,
82
- /** How much gas was available for this public execution. */
83
- startGasLeft: Gas,
84
- /** Bytecode used for this execution. */
85
- bytecode: Buffer,
86
- /** The call's results */
87
- avmCallResults: AvmContractCallResult,
88
- /** Function name */
89
- functionName: string,
80
+ lowLeafPreimage?: NullifierLeafPreimage,
81
+ lowLeafIndex?: Fr,
82
+ lowLeafPath?: Fr[],
90
83
  ): void;
91
84
  traceEnqueuedCall(
92
85
  /** The call request from private that enqueued this call. */
@@ -1,57 +1,29 @@
1
- import { type AvmProvingRequest, ProvingRequestType, type PublicExecutionRequest } from '@aztec/circuit-types';
2
1
  import {
3
- AvmCircuitInputs,
4
- AvmCircuitPublicInputs,
5
- AztecAddress,
6
- ContractStorageRead,
7
- ContractStorageUpdateRequest,
2
+ type AvmCircuitPublicInputs,
3
+ type AztecAddress,
8
4
  Fr,
9
- Gas,
5
+ type Gas,
10
6
  type GasSettings,
11
7
  type GlobalVariables,
12
- type Header,
13
- L2ToL1Message,
14
- LogHash,
15
- MAX_ENQUEUED_CALLS_PER_CALL,
16
- MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL,
17
- MAX_L2_TO_L1_MSGS_PER_CALL,
18
8
  MAX_L2_TO_L1_MSGS_PER_TX,
19
- MAX_NOTE_HASHES_PER_CALL,
20
9
  MAX_NOTE_HASHES_PER_TX,
21
- MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
22
- MAX_NULLIFIERS_PER_CALL,
23
- MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL,
24
- MAX_NULLIFIER_READ_REQUESTS_PER_CALL,
25
- MAX_PUBLIC_DATA_READS_PER_CALL,
26
- MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL,
27
- MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
28
- MAX_UNENCRYPTED_LOGS_PER_CALL,
29
- NoteHash,
30
- Nullifier,
10
+ MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
31
11
  PrivateToAvmAccumulatedData,
32
12
  PrivateToAvmAccumulatedDataArrayLengths,
33
13
  type PrivateToPublicAccumulatedData,
34
14
  PublicCallRequest,
35
- PublicCircuitPublicInputs,
36
15
  PublicDataWrite,
37
- PublicInnerCallRequest,
38
- ReadRequest,
39
- RevertCode,
16
+ type RevertCode,
40
17
  type StateReference,
41
- TreeLeafReadRequest,
42
18
  TreeSnapshots,
43
19
  countAccumulatedItems,
44
20
  mergeAccumulatedData,
45
21
  } from '@aztec/circuits.js';
46
- import { computeNoteHashNonce, computeUniqueNoteHash, computeVarArgsHash, siloNoteHash } from '@aztec/circuits.js/hash';
22
+ import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash } from '@aztec/circuits.js/hash';
47
23
  import { padArrayEnd } from '@aztec/foundation/collection';
48
24
  import { assertLength } from '@aztec/foundation/serialize';
49
25
 
50
- import { AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
51
- import { AvmExecutionEnvironment } from '../avm/avm_execution_environment.js';
52
- import { type AvmPersistableStateManager } from '../avm/journal/journal.js';
53
26
  import { type PublicEnqueuedCallSideEffectTrace } from './enqueued_call_side_effect_trace.js';
54
- import { type EnqueuedPublicCallExecutionResult, type PublicFunctionCallResult } from './execution.js';
55
27
 
56
28
  export function generateAvmCircuitPublicInputs(
57
29
  trace: PublicEnqueuedCallSideEffectTrace,
@@ -59,12 +31,13 @@ export function generateAvmCircuitPublicInputs(
59
31
  startStateReference: StateReference,
60
32
  startGasUsed: Gas,
61
33
  gasSettings: GasSettings,
34
+ feePayer: AztecAddress,
62
35
  setupCallRequests: PublicCallRequest[],
63
36
  appLogicCallRequests: PublicCallRequest[],
64
37
  teardownCallRequests: PublicCallRequest[],
65
38
  nonRevertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData,
66
39
  revertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData,
67
- endStateReference: StateReference,
40
+ endTreeSnapshots: TreeSnapshots,
68
41
  endGasUsed: Gas,
69
42
  transactionFee: Fr,
70
43
  revertCode: RevertCode,
@@ -75,18 +48,13 @@ export function generateAvmCircuitPublicInputs(
75
48
  startStateReference.partial.nullifierTree,
76
49
  startStateReference.partial.publicDataTree,
77
50
  );
78
- const endTreeSnapshots = new TreeSnapshots(
79
- endStateReference.l1ToL2MessageTree,
80
- endStateReference.partial.noteHashTree,
81
- endStateReference.partial.nullifierTree,
82
- endStateReference.partial.publicDataTree,
83
- );
84
51
 
85
52
  const avmCircuitPublicInputs = trace.toAvmCircuitPublicInputs(
86
53
  globalVariables,
87
54
  startTreeSnapshots,
88
55
  startGasUsed,
89
56
  gasSettings,
57
+ feePayer,
90
58
  setupCallRequests,
91
59
  appLogicCallRequests,
92
60
  teardownCallRequests.length ? teardownCallRequests[0] : PublicCallRequest.empty(),
@@ -118,6 +86,28 @@ export function generateAvmCircuitPublicInputs(
118
86
  revertibleAccumulatedDataFromPrivate,
119
87
  );
120
88
 
89
+ const txHash = avmCircuitPublicInputs.previousNonRevertibleAccumulatedData.nullifiers[0];
90
+
91
+ // Add nonces to revertible note hashes from private. These don't have nonces since we don't know
92
+ // the final position in the tx until the AVM has executed.
93
+ // TODO: Use the final position in the tx
94
+ for (
95
+ let revertibleIndex = 0;
96
+ revertibleIndex < avmCircuitPublicInputs.previousRevertibleAccumulatedData.noteHashes.length;
97
+ revertibleIndex++
98
+ ) {
99
+ const noteHash = avmCircuitPublicInputs.previousRevertibleAccumulatedData.noteHashes[revertibleIndex];
100
+ if (noteHash.isZero()) {
101
+ continue;
102
+ }
103
+ const indexInTx =
104
+ revertibleIndex + avmCircuitPublicInputs.previousNonRevertibleAccumulatedDataArrayLengths.noteHashes;
105
+
106
+ const nonce = computeNoteHashNonce(txHash, indexInTx);
107
+ const uniqueNoteHash = computeUniqueNoteHash(nonce, noteHash);
108
+ avmCircuitPublicInputs.previousRevertibleAccumulatedData.noteHashes[revertibleIndex] = uniqueNoteHash;
109
+ }
110
+
121
111
  // merge all revertible & non-revertible side effects into output accumulated data
122
112
  const noteHashesFromPrivate = revertCode.isOK()
123
113
  ? mergeAccumulatedData(
@@ -130,8 +120,7 @@ export function generateAvmCircuitPublicInputs(
130
120
  MAX_NOTE_HASHES_PER_TX,
131
121
  );
132
122
 
133
- const txHash = avmCircuitPublicInputs.previousNonRevertibleAccumulatedData.nullifiers[0];
134
-
123
+ // Silo and add nonces for note hashes emitted by the AVM
135
124
  const scopedNoteHashesFromPublic = trace.getSideEffects().noteHashes;
136
125
  for (let i = 0; i < scopedNoteHashesFromPublic.length; i++) {
137
126
  const scopedNoteHash = scopedNoteHashesFromPublic[i];
@@ -139,9 +128,10 @@ export function generateAvmCircuitPublicInputs(
139
128
  if (!noteHash.isZero()) {
140
129
  const noteHashIndexInTx = i + countAccumulatedItems(noteHashesFromPrivate);
141
130
  const nonce = computeNoteHashNonce(txHash, noteHashIndexInTx);
142
- const uniqueNoteHash = computeUniqueNoteHash(nonce, noteHash);
143
- const siloedNoteHash = siloNoteHash(scopedNoteHash.contractAddress, uniqueNoteHash);
144
- avmCircuitPublicInputs.accumulatedData.noteHashes[noteHashIndexInTx] = siloedNoteHash;
131
+ const siloedNoteHash = siloNoteHash(scopedNoteHash.contractAddress, noteHash);
132
+ const uniqueNoteHash = computeUniqueNoteHash(nonce, siloedNoteHash);
133
+
134
+ avmCircuitPublicInputs.accumulatedData.noteHashes[noteHashIndexInTx] = uniqueNoteHash;
145
135
  }
146
136
  }
147
137
 
@@ -156,181 +146,19 @@ export function generateAvmCircuitPublicInputs(
156
146
  MAX_L2_TO_L1_MSGS_PER_TX,
157
147
  );
158
148
 
159
- const dedupedPublicDataWrites: Array<PublicDataWrite> = [];
160
- const leafSlotOccurences: Map<bigint, number> = new Map();
161
- for (const publicDataWrite of avmCircuitPublicInputs.accumulatedData.publicDataWrites) {
162
- const slot = publicDataWrite.leafSlot.toBigInt();
163
- const prevOccurrences = leafSlotOccurences.get(slot) || 0;
164
- leafSlotOccurences.set(slot, prevOccurrences + 1);
165
- }
166
-
149
+ // Maps slot to value. Maps in TS are iterable in insertion order, which is exactly what we want for
150
+ // squashing "to the left", where the first occurrence of a slot uses the value of the last write to it,
151
+ // and the rest occurrences are omitted
152
+ const squashedPublicDataWrites: Map<bigint, Fr> = new Map();
167
153
  for (const publicDataWrite of avmCircuitPublicInputs.accumulatedData.publicDataWrites) {
168
- const slot = publicDataWrite.leafSlot.toBigInt();
169
- const prevOccurrences = leafSlotOccurences.get(slot) || 0;
170
- if (prevOccurrences === 1) {
171
- dedupedPublicDataWrites.push(publicDataWrite);
172
- } else {
173
- leafSlotOccurences.set(slot, prevOccurrences - 1);
174
- }
154
+ squashedPublicDataWrites.set(publicDataWrite.leafSlot.toBigInt(), publicDataWrite.value);
175
155
  }
176
156
 
177
157
  avmCircuitPublicInputs.accumulatedData.publicDataWrites = padArrayEnd(
178
- dedupedPublicDataWrites,
158
+ Array.from(squashedPublicDataWrites.entries()).map(([slot, value]) => new PublicDataWrite(new Fr(slot), value)),
179
159
  PublicDataWrite.empty(),
180
- MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
160
+ MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
181
161
  );
182
162
  //console.log(`AvmCircuitPublicInputs:\n${inspect(avmCircuitPublicInputs)}`);
183
163
  return avmCircuitPublicInputs;
184
164
  }
185
-
186
- export function generateAvmProvingRequest(
187
- real: boolean,
188
- fnName: string,
189
- stateManager: AvmPersistableStateManager,
190
- historicalHeader: Header,
191
- globalVariables: GlobalVariables,
192
- executionRequest: PublicExecutionRequest,
193
- result: EnqueuedPublicCallExecutionResult,
194
- allocatedGas: Gas,
195
- transactionFee: Fr,
196
- ): AvmProvingRequest {
197
- const avmExecutionEnv = new AvmExecutionEnvironment(
198
- executionRequest.callContext.contractAddress,
199
- executionRequest.callContext.msgSender,
200
- executionRequest.callContext.functionSelector,
201
- /*contractCallDepth=*/ Fr.zero(),
202
- transactionFee,
203
- globalVariables,
204
- executionRequest.callContext.isStaticCall,
205
- executionRequest.args,
206
- );
207
-
208
- const avmCallResult = new AvmFinalizedCallResult(result.reverted, result.returnValues, result.endGasLeft);
209
-
210
- // Generate an AVM proving request
211
- let avmProvingRequest: AvmProvingRequest;
212
- if (real) {
213
- const deprecatedFunctionCallResult = stateManager.trace.toPublicFunctionCallResult(
214
- avmExecutionEnv,
215
- /*startGasLeft=*/ allocatedGas,
216
- Buffer.alloc(0),
217
- avmCallResult,
218
- fnName,
219
- );
220
- const publicInputs = getPublicCircuitPublicInputs(historicalHeader, globalVariables, deprecatedFunctionCallResult);
221
- avmProvingRequest = makeAvmProvingRequest(publicInputs, deprecatedFunctionCallResult);
222
- } else {
223
- avmProvingRequest = emptyAvmProvingRequest();
224
- }
225
- return avmProvingRequest;
226
- }
227
-
228
- function emptyAvmProvingRequest(): AvmProvingRequest {
229
- return {
230
- type: ProvingRequestType.PUBLIC_VM,
231
- inputs: AvmCircuitInputs.empty(),
232
- };
233
- }
234
- function makeAvmProvingRequest(inputs: PublicCircuitPublicInputs, result: PublicFunctionCallResult): AvmProvingRequest {
235
- return {
236
- type: ProvingRequestType.PUBLIC_VM,
237
- inputs: new AvmCircuitInputs(
238
- result.functionName,
239
- result.calldata,
240
- inputs,
241
- result.avmCircuitHints,
242
- AvmCircuitPublicInputs.empty(),
243
- ),
244
- };
245
- }
246
-
247
- function getPublicCircuitPublicInputs(
248
- historicalHeader: Header,
249
- globalVariables: GlobalVariables,
250
- result: PublicFunctionCallResult,
251
- ) {
252
- const header = historicalHeader.clone(); // don't modify the original
253
- header.state.partial.publicDataTree.root = Fr.zero(); // AVM doesn't check this yet
254
-
255
- return PublicCircuitPublicInputs.from({
256
- callContext: result.executionRequest.callContext,
257
- proverAddress: AztecAddress.ZERO,
258
- argsHash: computeVarArgsHash(result.executionRequest.args),
259
- noteHashes: padArrayEnd(
260
- result.noteHashes,
261
- NoteHash.empty(),
262
- MAX_NOTE_HASHES_PER_CALL,
263
- `Too many note hashes. Got ${result.noteHashes.length} with max being ${MAX_NOTE_HASHES_PER_CALL}`,
264
- ),
265
- nullifiers: padArrayEnd(
266
- result.nullifiers,
267
- Nullifier.empty(),
268
- MAX_NULLIFIERS_PER_CALL,
269
- `Too many nullifiers. Got ${result.nullifiers.length} with max being ${MAX_NULLIFIERS_PER_CALL}`,
270
- ),
271
- l2ToL1Msgs: padArrayEnd(
272
- result.l2ToL1Messages,
273
- L2ToL1Message.empty(),
274
- MAX_L2_TO_L1_MSGS_PER_CALL,
275
- `Too many L2 to L1 messages. Got ${result.l2ToL1Messages.length} with max being ${MAX_L2_TO_L1_MSGS_PER_CALL}`,
276
- ),
277
- startSideEffectCounter: result.startSideEffectCounter,
278
- endSideEffectCounter: result.endSideEffectCounter,
279
- returnsHash: computeVarArgsHash(result.returnValues),
280
- noteHashReadRequests: padArrayEnd(
281
- result.noteHashReadRequests,
282
- TreeLeafReadRequest.empty(),
283
- MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
284
- `Too many note hash read requests. Got ${result.noteHashReadRequests.length} with max being ${MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}`,
285
- ),
286
- nullifierReadRequests: padArrayEnd(
287
- result.nullifierReadRequests,
288
- ReadRequest.empty(),
289
- MAX_NULLIFIER_READ_REQUESTS_PER_CALL,
290
- `Too many nullifier read requests. Got ${result.nullifierReadRequests.length} with max being ${MAX_NULLIFIER_READ_REQUESTS_PER_CALL}`,
291
- ),
292
- nullifierNonExistentReadRequests: padArrayEnd(
293
- result.nullifierNonExistentReadRequests,
294
- ReadRequest.empty(),
295
- MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL,
296
- `Too many nullifier non-existent read requests. Got ${result.nullifierNonExistentReadRequests.length} with max being ${MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL}`,
297
- ),
298
- l1ToL2MsgReadRequests: padArrayEnd(
299
- result.l1ToL2MsgReadRequests,
300
- TreeLeafReadRequest.empty(),
301
- MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL,
302
- `Too many L1 to L2 message read requests. Got ${result.l1ToL2MsgReadRequests.length} with max being ${MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL}`,
303
- ),
304
- contractStorageReads: padArrayEnd(
305
- result.contractStorageReads,
306
- ContractStorageRead.empty(),
307
- MAX_PUBLIC_DATA_READS_PER_CALL,
308
- `Too many public data reads. Got ${result.contractStorageReads.length} with max being ${MAX_PUBLIC_DATA_READS_PER_CALL}`,
309
- ),
310
- contractStorageUpdateRequests: padArrayEnd(
311
- result.contractStorageUpdateRequests,
312
- ContractStorageUpdateRequest.empty(),
313
- MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL,
314
- `Too many public data update requests. Got ${result.contractStorageUpdateRequests.length} with max being ${MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL}`,
315
- ),
316
- publicCallRequests: padArrayEnd(
317
- result.publicCallRequests,
318
- PublicInnerCallRequest.empty(),
319
- MAX_ENQUEUED_CALLS_PER_CALL,
320
- `Too many public call requests. Got ${result.publicCallRequests.length} with max being ${MAX_ENQUEUED_CALLS_PER_CALL}`,
321
- ),
322
- unencryptedLogsHashes: padArrayEnd(
323
- result.unencryptedLogsHashes,
324
- LogHash.empty(),
325
- MAX_UNENCRYPTED_LOGS_PER_CALL,
326
- `Too many unencrypted logs. Got ${result.unencryptedLogsHashes.length} with max being ${MAX_UNENCRYPTED_LOGS_PER_CALL}`,
327
- ),
328
- historicalHeader: header,
329
- globalVariables: globalVariables,
330
- startGasLeft: Gas.from(result.startGasLeft),
331
- endGasLeft: Gas.from(result.endGasLeft),
332
- transactionFee: result.transactionFee,
333
- // TODO(@just-mitch): need better mapping from simulator to revert code.
334
- revertCode: result.reverted ? RevertCode.APP_LOGIC_REVERTED : RevertCode.OK,
335
- });
336
- }
@@ -1,77 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import { type UnencryptedL2Log } from '@aztec/circuit-types';
4
- import { type ContractClassIdPreimage, type Gas, type NullifierLeafPreimage, type PublicCallRequest, type PublicDataTreeLeafPreimage, type SerializableContractInstance } from '@aztec/circuits.js';
5
- import { type AztecAddress } from '@aztec/foundation/aztec-address';
6
- import { type Fr } from '@aztec/foundation/fields';
7
- import { type AvmContractCallResult, type AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
8
- import { type AvmExecutionEnvironment } from '../avm/avm_execution_environment.js';
9
- import { type PublicEnqueuedCallSideEffectTrace } from './enqueued_call_side_effect_trace.js';
10
- import { type EnqueuedPublicCallExecutionResultWithSideEffects, type PublicFunctionCallResult } from './execution.js';
11
- import { type PublicSideEffectTrace } from './side_effect_trace.js';
12
- import { type PublicSideEffectTraceInterface } from './side_effect_trace_interface.js';
13
- export declare class DualSideEffectTrace implements PublicSideEffectTraceInterface {
14
- readonly innerCallTrace: PublicSideEffectTrace;
15
- readonly enqueuedCallTrace: PublicEnqueuedCallSideEffectTrace;
16
- constructor(innerCallTrace: PublicSideEffectTrace, enqueuedCallTrace: PublicEnqueuedCallSideEffectTrace);
17
- fork(): DualSideEffectTrace;
18
- merge(nestedTrace: this, reverted?: boolean): void;
19
- getCounter(): number;
20
- tracePublicStorageRead(contractAddress: AztecAddress, slot: Fr, value: Fr, leafPreimage: PublicDataTreeLeafPreimage, leafIndex: Fr, path: Fr[]): void;
21
- tracePublicStorageWrite(contractAddress: AztecAddress, slot: Fr, value: Fr, lowLeafPreimage: PublicDataTreeLeafPreimage, lowLeafIndex: Fr, lowLeafPath: Fr[], newLeafPreimage: PublicDataTreeLeafPreimage, insertionPath: Fr[]): void;
22
- traceNoteHashCheck(contractAddress: AztecAddress, noteHash: Fr, leafIndex: Fr, exists: boolean, path: Fr[]): void;
23
- traceNewNoteHash(contractAddress: AztecAddress, noteHash: Fr, leafIndex: Fr, path: Fr[]): void;
24
- traceNullifierCheck(siloedNullifier: Fr, exists: boolean, lowLeafPreimage: NullifierLeafPreimage, lowLeafIndex: Fr, lowLeafPath: Fr[]): void;
25
- traceNewNullifier(siloedNullifier: Fr, lowLeafPreimage: NullifierLeafPreimage, lowLeafIndex: Fr, lowLeafPath: Fr[], insertionPath: Fr[]): void;
26
- traceL1ToL2MessageCheck(contractAddress: AztecAddress, msgHash: Fr, msgLeafIndex: Fr, exists: boolean, path: Fr[]): void;
27
- traceNewL2ToL1Message(contractAddress: AztecAddress, recipient: Fr, content: Fr): void;
28
- traceUnencryptedLog(contractAddress: AztecAddress, log: Fr[]): void;
29
- traceGetContractInstance(contractAddress: AztecAddress, exists: boolean, instance: SerializableContractInstance | undefined): void;
30
- traceGetBytecode(contractAddress: AztecAddress, exists: boolean, bytecode: Buffer, contractInstance: SerializableContractInstance | undefined, contractClass: ContractClassIdPreimage | undefined): void;
31
- /**
32
- * Trace a nested call.
33
- * Accept some results from a finished nested call's trace into this one.
34
- */
35
- traceNestedCall(
36
- /** The trace of the nested call. */
37
- nestedCallTrace: this,
38
- /** The execution environment of the nested call. */
39
- nestedEnvironment: AvmExecutionEnvironment,
40
- /** How much gas was available for this public execution. */
41
- startGasLeft: Gas,
42
- /** Bytecode used for this execution. */
43
- bytecode: Buffer,
44
- /** The call's results */
45
- avmCallResults: AvmContractCallResult,
46
- /** Function name for logging */
47
- functionName?: string): void;
48
- traceEnqueuedCall(
49
- /** The call request from private that enqueued this call. */
50
- publicCallRequest: PublicCallRequest,
51
- /** The call's calldata */
52
- calldata: Fr[],
53
- /** Did the call revert? */
54
- reverted: boolean): void;
55
- /**
56
- * Convert this trace to a PublicExecutionResult for use externally to the simulator.
57
- */
58
- toPublicEnqueuedCallExecutionResult(
59
- /** The call's results */
60
- avmCallResults: AvmFinalizedCallResult): EnqueuedPublicCallExecutionResultWithSideEffects;
61
- /**
62
- * Convert this trace to a PublicExecutionResult for use externally to the simulator.
63
- */
64
- toPublicFunctionCallResult(
65
- /** The execution environment of the nested call. */
66
- avmEnvironment: AvmExecutionEnvironment,
67
- /** How much gas was available for this public execution. */
68
- startGasLeft: Gas,
69
- /** Bytecode used for this execution. */
70
- bytecode: Buffer,
71
- /** The call's results */
72
- avmCallResults: AvmFinalizedCallResult,
73
- /** Function name for logging */
74
- functionName?: string): PublicFunctionCallResult;
75
- getUnencryptedLogs(): UnencryptedL2Log[];
76
- }
77
- //# sourceMappingURL=dual_side_effect_trace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dual_side_effect_trace.d.ts","sourceRoot":"","sources":["../../src/public/dual_side_effect_trace.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EACR,KAAK,qBAAqB,EA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