@aztec/simulator 0.72.1 → 0.73.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 (114) hide show
  1. package/README.md +1 -1
  2. package/dest/avm/avm_simulator.d.ts +0 -1
  3. package/dest/avm/avm_simulator.d.ts.map +1 -1
  4. package/dest/avm/avm_simulator.js +4 -19
  5. package/dest/avm/avm_tree.d.ts +9 -8
  6. package/dest/avm/avm_tree.d.ts.map +1 -1
  7. package/dest/avm/avm_tree.js +35 -30
  8. package/dest/avm/fixtures/avm_simulation_tester.d.ts +21 -0
  9. package/dest/avm/fixtures/avm_simulation_tester.d.ts.map +1 -0
  10. package/dest/avm/fixtures/avm_simulation_tester.js +74 -0
  11. package/dest/avm/fixtures/base_avm_simulation_tester.d.ts +35 -0
  12. package/dest/avm/fixtures/base_avm_simulation_tester.d.ts.map +1 -0
  13. package/dest/avm/fixtures/base_avm_simulation_tester.js +76 -0
  14. package/dest/avm/fixtures/index.d.ts +6 -2
  15. package/dest/avm/fixtures/index.d.ts.map +1 -1
  16. package/dest/avm/fixtures/index.js +28 -14
  17. package/dest/avm/fixtures/simple_contract_data_source.d.ts +31 -0
  18. package/dest/avm/fixtures/simple_contract_data_source.d.ts.map +1 -0
  19. package/dest/avm/fixtures/simple_contract_data_source.js +75 -0
  20. package/dest/avm/journal/journal.d.ts +3 -3
  21. package/dest/avm/journal/journal.d.ts.map +1 -1
  22. package/dest/avm/journal/journal.js +24 -21
  23. package/dest/avm/opcodes/accrued_substate.js +2 -2
  24. package/dest/avm/opcodes/hashing.js +2 -2
  25. package/dest/avm/test_utils.d.ts +1 -1
  26. package/dest/avm/test_utils.d.ts.map +1 -1
  27. package/dest/avm/test_utils.js +4 -3
  28. package/dest/client/client_execution_context.d.ts +1 -1
  29. package/dest/client/client_execution_context.d.ts.map +1 -1
  30. package/dest/client/client_execution_context.js +21 -18
  31. package/dest/client/execution_note_cache.d.ts +3 -3
  32. package/dest/client/execution_note_cache.d.ts.map +1 -1
  33. package/dest/client/execution_note_cache.js +10 -10
  34. package/dest/client/pick_notes.js +5 -5
  35. package/dest/client/simulator.js +4 -4
  36. package/dest/client/view_data_oracle.js +2 -2
  37. package/dest/common/hashed_values_cache.d.ts +1 -1
  38. package/dest/common/hashed_values_cache.d.ts.map +1 -1
  39. package/dest/common/hashed_values_cache.js +5 -5
  40. package/dest/providers/acvm_wasm.d.ts +2 -0
  41. package/dest/providers/acvm_wasm.d.ts.map +1 -1
  42. package/dest/providers/acvm_wasm.js +15 -2
  43. package/dest/public/execution.d.ts +1 -1
  44. package/dest/public/execution.d.ts.map +1 -1
  45. package/dest/public/execution.js +3 -3
  46. package/dest/public/fee_payment.d.ts +2 -2
  47. package/dest/public/fee_payment.d.ts.map +1 -1
  48. package/dest/public/fee_payment.js +3 -3
  49. package/dest/public/fixtures/index.d.ts +2 -37
  50. package/dest/public/fixtures/index.d.ts.map +1 -1
  51. package/dest/public/fixtures/index.js +3 -250
  52. package/dest/public/fixtures/public_tx_simulation_tester.d.ts +21 -0
  53. package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -0
  54. package/dest/public/fixtures/public_tx_simulation_tester.js +89 -0
  55. package/dest/public/fixtures/utils.d.ts +17 -0
  56. package/dest/public/fixtures/utils.d.ts.map +1 -0
  57. package/dest/public/fixtures/utils.js +66 -0
  58. package/dest/public/index.d.ts +1 -1
  59. package/dest/public/index.d.ts.map +1 -1
  60. package/dest/public/index.js +2 -2
  61. package/dest/public/public_db_sources.d.ts +2 -1
  62. package/dest/public/public_db_sources.d.ts.map +1 -1
  63. package/dest/public/public_db_sources.js +27 -21
  64. package/dest/public/public_processor.d.ts +1 -1
  65. package/dest/public/public_processor.d.ts.map +1 -1
  66. package/dest/public/public_processor.js +19 -18
  67. package/dest/public/public_tx_context.d.ts +5 -5
  68. package/dest/public/public_tx_context.d.ts.map +1 -1
  69. package/dest/public/public_tx_context.js +43 -17
  70. package/dest/public/public_tx_simulator.js +7 -7
  71. package/dest/public/{enqueued_call_side_effect_trace.d.ts → side_effect_trace.d.ts} +5 -5
  72. package/dest/public/side_effect_trace.d.ts.map +1 -0
  73. package/dest/public/{enqueued_call_side_effect_trace.js → side_effect_trace.js} +7 -7
  74. package/dest/public/side_effect_trace_interface.d.ts +1 -1
  75. package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
  76. package/dest/test/utils.d.ts +1 -1
  77. package/dest/test/utils.d.ts.map +1 -1
  78. package/dest/test/utils.js +3 -3
  79. package/package.json +9 -9
  80. package/src/avm/avm_simulator.ts +3 -27
  81. package/src/avm/avm_tree.ts +39 -37
  82. package/src/avm/fixtures/avm_simulation_tester.ts +105 -0
  83. package/src/avm/fixtures/base_avm_simulation_tester.ts +104 -0
  84. package/src/avm/fixtures/index.ts +46 -17
  85. package/src/avm/fixtures/simple_contract_data_source.ts +98 -0
  86. package/src/avm/journal/journal.ts +24 -21
  87. package/src/avm/opcodes/accrued_substate.ts +1 -1
  88. package/src/avm/opcodes/hashing.ts +1 -1
  89. package/src/avm/test_utils.ts +3 -4
  90. package/src/client/client_execution_context.ts +27 -21
  91. package/src/client/execution_note_cache.ts +19 -14
  92. package/src/client/pick_notes.ts +4 -4
  93. package/src/client/simulator.ts +3 -3
  94. package/src/client/view_data_oracle.ts +1 -1
  95. package/src/common/hashed_values_cache.ts +4 -4
  96. package/src/providers/acvm_wasm.ts +13 -2
  97. package/src/public/execution.ts +3 -3
  98. package/src/public/fee_payment.ts +2 -2
  99. package/src/public/fixtures/index.ts +2 -387
  100. package/src/public/fixtures/public_tx_simulation_tester.ts +174 -0
  101. package/src/public/fixtures/utils.ts +110 -0
  102. package/src/public/index.ts +1 -1
  103. package/src/public/public_db_sources.ts +31 -20
  104. package/src/public/public_processor.ts +25 -18
  105. package/src/public/public_tx_context.ts +86 -27
  106. package/src/public/public_tx_simulator.ts +6 -6
  107. package/src/public/{enqueued_call_side_effect_trace.ts → side_effect_trace.ts} +7 -7
  108. package/src/public/side_effect_trace_interface.ts +1 -1
  109. package/src/test/utils.ts +2 -2
  110. package/dest/public/enqueued_call_side_effect_trace.d.ts.map +0 -1
  111. package/dest/public/transitional_adapters.d.ts +0 -4
  112. package/dest/public/transitional_adapters.d.ts.map +0 -1
  113. package/dest/public/transitional_adapters.js +0 -29
  114. package/src/public/transitional_adapters.ts +0 -113
@@ -1,4 +1,5 @@
1
1
  import {
2
+ ContractClassTxL2Logs,
2
3
  MerkleTreeId,
3
4
  type MerkleTreeReadOperations,
4
5
  type MerkleTreeWriteOperations,
@@ -44,16 +45,18 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
44
45
  * Add new contracts from a transaction
45
46
  * @param tx - The transaction to add contracts from.
46
47
  */
47
- public addNewContracts(tx: Tx): Promise<void> {
48
+ public async addNewContracts(tx: Tx): Promise<void> {
48
49
  // Extract contract class and instance data from logs and add to cache for this block
49
50
  const logs = tx.contractClassLogs.unrollLogs();
50
- logs
51
+ const contractClassRegisteredEvents = logs
51
52
  .filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log.data))
52
- .forEach(log => {
53
- const event = ContractClassRegisteredEvent.fromLog(log.data);
53
+ .map(log => ContractClassRegisteredEvent.fromLog(log.data));
54
+ await Promise.all(
55
+ contractClassRegisteredEvents.map(async event => {
54
56
  this.log.debug(`Adding class ${event.contractClassId.toString()} to public execution contract cache`);
55
- this.classCache.set(event.contractClassId.toString(), event.toContractClassPublic());
56
- });
57
+ this.classCache.set(event.contractClassId.toString(), await event.toContractClassPublic());
58
+ }),
59
+ );
57
60
 
58
61
  // We store the contract instance deployed event log in private logs, contract_instance_deployer_contract/src/main.nr
59
62
  const contractInstanceEvents = tx.data
@@ -66,20 +69,26 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
66
69
  );
67
70
  this.instanceCache.set(e.address.toString(), e.toContractInstance());
68
71
  });
69
-
70
- return Promise.resolve();
71
72
  }
72
73
 
73
74
  /**
74
75
  * Removes new contracts added from transactions
75
76
  * @param tx - The tx's contracts to be removed
77
+ * @param onlyRevertible - Whether to only remove contracts added from revertible contract class logs
76
78
  */
77
- public removeNewContracts(tx: Tx): Promise<void> {
79
+ public removeNewContracts(tx: Tx, onlyRevertible: boolean = false): Promise<void> {
78
80
  // TODO(@spalladino): Can this inadvertently delete a valid contract added by another tx?
79
81
  // Let's say we have two txs adding the same contract on the same block. If the 2nd one reverts,
80
82
  // wouldn't that accidentally remove the contract added on the first one?
81
- const logs = tx.contractClassLogs.unrollLogs();
82
- logs
83
+ const contractClassLogs = onlyRevertible
84
+ ? tx.contractClassLogs
85
+ .filterScoped(
86
+ tx.data.forPublic!.revertibleAccumulatedData.contractClassLogsHashes,
87
+ ContractClassTxL2Logs.empty(),
88
+ )
89
+ .unrollLogs()
90
+ : tx.contractClassLogs.unrollLogs();
91
+ contractClassLogs
83
92
  .filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log.data))
84
93
  .forEach(log => {
85
94
  const event = ContractClassRegisteredEvent.fromLog(log.data);
@@ -87,8 +96,10 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
87
96
  });
88
97
 
89
98
  // We store the contract instance deployed event log in private logs, contract_instance_deployer_contract/src/main.nr
90
- const contractInstanceEvents = tx.data
91
- .getNonEmptyPrivateLogs()
99
+ const privateLogs = onlyRevertible
100
+ ? tx.data.forPublic!.revertibleAccumulatedData.privateLogs.filter(l => !l.isEmpty())
101
+ : tx.data.getNonEmptyPrivateLogs();
102
+ const contractInstanceEvents = privateLogs
92
103
  .filter(log => ContractInstanceDeployedEvent.isContractInstanceDeployedEvent(log))
93
104
  .map(ContractInstanceDeployedEvent.fromLog);
94
105
  contractInstanceEvents.forEach(e => this.instanceCache.delete(e.address.toString()));
@@ -124,7 +135,7 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
124
135
  return undefined;
125
136
  }
126
137
 
127
- const value = computePublicBytecodeCommitment(contractClass.packedBytecode);
138
+ const value = await computePublicBytecodeCommitment(contractClass.packedBytecode);
128
139
  this.bytecodeCommitmentCache.set(key, value);
129
140
  return value;
130
141
  }
@@ -171,7 +182,7 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
171
182
  * @returns The current value in the storage slot.
172
183
  */
173
184
  public async storageRead(contract: AztecAddress, slot: Fr): Promise<Fr> {
174
- const leafSlot = computePublicDataTreeLeafSlot(contract, slot).value;
185
+ const leafSlot = (await computePublicDataTreeLeafSlot(contract, slot)).toBigInt();
175
186
  const uncommitted = this.publicUncommittedWriteCache.get(leafSlot);
176
187
  if (uncommitted !== undefined) {
177
188
  return uncommitted;
@@ -195,10 +206,10 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
195
206
  * @param newValue - The new value to store.
196
207
  * @returns The slot of the written leaf in the public data tree.
197
208
  */
198
- public storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<bigint> {
199
- const index = computePublicDataTreeLeafSlot(contract, slot).value;
209
+ public async storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<bigint> {
210
+ const index = (await computePublicDataTreeLeafSlot(contract, slot)).toBigInt();
200
211
  this.publicUncommittedWriteCache.set(index, newValue);
201
- return Promise.resolve(index);
212
+ return index;
202
213
  }
203
214
 
204
215
  public async getNullifierMembershipWitnessAtLatestBlock(
@@ -243,7 +254,7 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
243
254
  throw new Error(`No L1 to L2 message found for message hash ${messageHash.toString()}`);
244
255
  }
245
256
 
246
- const messageNullifier = computeL1ToL2MessageNullifier(contractAddress, messageHash, secret);
257
+ const messageNullifier = await computeL1ToL2MessageNullifier(contractAddress, messageHash, secret);
247
258
  const nullifierIndex = await this.getNullifierIndex(messageNullifier);
248
259
 
249
260
  if (nullifierIndex !== undefined) {
@@ -348,7 +359,7 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
348
359
  }
349
360
 
350
361
  export async function readPublicState(db: MerkleTreeReadOperations, contract: AztecAddress, slot: Fr): Promise<Fr> {
351
- const leafSlot = computePublicDataTreeLeafSlot(contract, slot).toBigInt();
362
+ const leafSlot = (await computePublicDataTreeLeafSlot(contract, slot)).toBigInt();
352
363
 
353
364
  const lowLeafResult = await db.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot);
354
365
  if (!lowLeafResult || !lowLeafResult.alreadyPresent) {
@@ -137,7 +137,7 @@ export class PublicProcessor implements Traceable {
137
137
  * @returns The list of processed txs with their circuit simulation outputs.
138
138
  */
139
139
  public async process(
140
- txs: Iterable<Tx>,
140
+ txs: Iterable<Tx> | AsyncIterable<Tx>,
141
141
  limits: {
142
142
  maxTransactions?: number;
143
143
  maxBlockSize?: number;
@@ -161,7 +161,7 @@ export class PublicProcessor implements Traceable {
161
161
  let totalPublicGas = new Gas(0, 0);
162
162
  let totalBlockGas = new Gas(0, 0);
163
163
 
164
- for (const origTx of txs) {
164
+ for await (const origTx of txs) {
165
165
  // Only process up to the max tx limit
166
166
  if (maxTransactions !== undefined && result.length >= maxTransactions) {
167
167
  this.log.debug(`Stopping tx processing due to reaching the max tx limit.`);
@@ -175,7 +175,7 @@ export class PublicProcessor implements Traceable {
175
175
  }
176
176
 
177
177
  // Skip this tx if it'd exceed max block size
178
- const txHash = origTx.getTxHash().toString();
178
+ const txHash = (await origTx.getTxHash()).toString();
179
179
  const preTxSizeInBytes = origTx.getEstimatedPrivateTxEffectsSize();
180
180
  if (maxBlockSize !== undefined && totalSizeInBytes + preTxSizeInBytes > maxBlockSize) {
181
181
  this.log.warn(`Skipping processing of tx ${txHash} sized ${preTxSizeInBytes} bytes due to block size limit`, {
@@ -205,19 +205,20 @@ export class PublicProcessor implements Traceable {
205
205
  // We validate the tx before processing it, to avoid unnecessary work.
206
206
  if (preprocessValidator) {
207
207
  const result = await preprocessValidator.validateTx(tx);
208
+ const txHash = await tx.getTxHash();
208
209
  if (result.result === 'invalid') {
209
210
  const reason = result.reason.join(', ');
210
- this.log.warn(`Rejecting tx ${tx.getTxHash().toString()} due to pre-process validation fail: ${reason}`);
211
+ this.log.warn(`Rejecting tx ${txHash.toString()} due to pre-process validation fail: ${reason}`);
211
212
  failed.push({ tx, error: new Error(`Tx failed preprocess validation: ${reason}`) });
212
213
  returns.push(new NestedProcessReturnValues([]));
213
214
  continue;
214
215
  } else if (result.result === 'skipped') {
215
216
  const reason = result.reason.join(', ');
216
- this.log.warn(`Skipping tx ${tx.getTxHash().toString()} due to pre-process validation: ${reason}`);
217
+ this.log.warn(`Skipping tx ${txHash.toString()} due to pre-process validation: ${reason}`);
217
218
  returns.push(new NestedProcessReturnValues([]));
218
219
  continue;
219
220
  } else {
220
- this.log.trace(`Tx ${tx.getTxHash().toString()} is valid before processing.`);
221
+ this.log.trace(`Tx ${txHash.toString()} is valid before processing.`);
221
222
  }
222
223
  }
223
224
 
@@ -250,7 +251,7 @@ export class PublicProcessor implements Traceable {
250
251
  failed.push({ tx, error: new Error(`Tx failed post-process validation: ${reason}`) });
251
252
  continue;
252
253
  } else {
253
- this.log.trace(`Tx ${tx.getTxHash().toString()} is valid post processing.`);
254
+ this.log.trace(`Tx ${(await tx.getTxHash()).toString()} is valid post processing.`);
254
255
  }
255
256
  }
256
257
 
@@ -291,7 +292,7 @@ export class PublicProcessor implements Traceable {
291
292
  return [result, failed, returns];
292
293
  }
293
294
 
294
- @trackSpan('PublicProcessor.processTx', tx => ({ [Attributes.TX_HASH]: tx.getTxHash().toString() }))
295
+ @trackSpan('PublicProcessor.processTx', async tx => ({ [Attributes.TX_HASH]: (await tx.getTxHash()).toString() }))
295
296
  private async processTx(tx: Tx, deadline?: Date): Promise<[ProcessedTx, NestedProcessReturnValues[]]> {
296
297
  const [time, [processedTx, returnValues]] = await elapsed(() => this.processTxWithinDeadline(tx, deadline));
297
298
 
@@ -372,13 +373,13 @@ export class PublicProcessor implements Traceable {
372
373
  return await processFn();
373
374
  }
374
375
 
375
- const txHash = tx.getTxHash().toString();
376
+ const txHash = await tx.getTxHash();
376
377
  const timeout = +deadline - this.dateProvider.now();
377
378
  if (timeout <= 0) {
378
379
  throw new PublicProcessorTimeoutError();
379
380
  }
380
381
 
381
- this.log.debug(`Processing tx ${tx.getTxHash().toString()} within ${timeout}ms`, {
382
+ this.log.debug(`Processing tx ${txHash.toString()} within ${timeout}ms`, {
382
383
  deadline: deadline.toISOString(),
383
384
  now: new Date(this.dateProvider.now()).toISOString(),
384
385
  txHash,
@@ -403,8 +404,8 @@ export class PublicProcessor implements Traceable {
403
404
  }
404
405
 
405
406
  const feeJuiceAddress = ProtocolContractAddress.FeeJuice;
406
- const balanceSlot = computeFeePayerBalanceStorageSlot(feePayer);
407
- const leafSlot = computeFeePayerBalanceLeafSlot(feePayer);
407
+ const balanceSlot = await computeFeePayerBalanceStorageSlot(feePayer);
408
+ const leafSlot = await computeFeePayerBalanceLeafSlot(feePayer);
408
409
 
409
410
  this.log.debug(`Deducting ${txFee.toBigInt()} balance in Fee Juice for ${feePayer}`);
410
411
 
@@ -422,8 +423,8 @@ export class PublicProcessor implements Traceable {
422
423
  return new PublicDataWrite(leafSlot, updatedBalance);
423
424
  }
424
425
 
425
- @trackSpan('PublicProcessor.processPrivateOnlyTx', (tx: Tx) => ({
426
- [Attributes.TX_HASH]: tx.getTxHash().toString(),
426
+ @trackSpan('PublicProcessor.processPrivateOnlyTx', async (tx: Tx) => ({
427
+ [Attributes.TX_HASH]: (await tx.getTxHash()).toString(),
427
428
  }))
428
429
  private async processPrivateOnlyTx(tx: Tx): Promise<[ProcessedTx, undefined]> {
429
430
  const gasFees = this.globalVariables.gasFees;
@@ -431,7 +432,7 @@ export class PublicProcessor implements Traceable {
431
432
 
432
433
  const feePaymentPublicDataWrite = await this.getFeePaymentPublicDataWrite(transactionFee, tx.data.feePayer);
433
434
 
434
- const processedTx = makeProcessedTxFromPrivateOnlyTx(
435
+ const processedTx = await makeProcessedTxFromPrivateOnlyTx(
435
436
  tx,
436
437
  transactionFee,
437
438
  feePaymentPublicDataWrite,
@@ -447,8 +448,8 @@ export class PublicProcessor implements Traceable {
447
448
  return [processedTx, undefined];
448
449
  }
449
450
 
450
- @trackSpan('PublicProcessor.processTxWithPublicCalls', tx => ({
451
- [Attributes.TX_HASH]: tx.getTxHash().toString(),
451
+ @trackSpan('PublicProcessor.processTxWithPublicCalls', async tx => ({
452
+ [Attributes.TX_HASH]: (await tx.getTxHash()).toString(),
452
453
  }))
453
454
  private async processTxWithPublicCalls(tx: Tx): Promise<[ProcessedTx, NestedProcessReturnValues[]]> {
454
455
  const timer = new Timer();
@@ -480,7 +481,13 @@ export class PublicProcessor implements Traceable {
480
481
  const durationMs = timer.ms();
481
482
  this.metrics.recordTx(phaseCount, durationMs, gasUsed.publicGas);
482
483
 
483
- const processedTx = makeProcessedTxFromTxWithPublicCalls(tx, avmProvingRequest, gasUsed, revertCode, revertReason);
484
+ const processedTx = await makeProcessedTxFromTxWithPublicCalls(
485
+ tx,
486
+ avmProvingRequest,
487
+ gasUsed,
488
+ revertCode,
489
+ revertReason,
490
+ );
484
491
 
485
492
  const returnValues = processedPhases.find(({ phase }) => phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
486
493
 
@@ -18,26 +18,32 @@ import {
18
18
  type GasSettings,
19
19
  type GlobalVariables,
20
20
  MAX_L2_GAS_PER_TX_PUBLIC_PORTION,
21
+ MAX_L2_TO_L1_MSGS_PER_TX,
21
22
  MAX_NOTE_HASHES_PER_TX,
22
23
  MAX_NULLIFIERS_PER_TX,
24
+ MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
25
+ PrivateToAvmAccumulatedData,
26
+ PrivateToAvmAccumulatedDataArrayLengths,
23
27
  type PrivateToPublicAccumulatedData,
24
- type PublicCallRequest,
25
- PublicCircuitPublicInputs,
28
+ PublicCallRequest,
29
+ PublicDataWrite,
26
30
  RevertCode,
27
31
  type StateReference,
28
32
  TreeSnapshots,
29
33
  computeTransactionFee,
30
34
  countAccumulatedItems,
35
+ mergeAccumulatedData,
31
36
  } from '@aztec/circuits.js';
37
+ import { padArrayEnd } from '@aztec/foundation/collection';
32
38
  import { type Logger, createLogger } from '@aztec/foundation/log';
39
+ import { assertLength } from '@aztec/foundation/serialize';
33
40
 
34
41
  import { strict as assert } from 'assert';
35
42
  import { inspect } from 'util';
36
43
 
37
44
  import { AvmPersistableStateManager } from '../avm/index.js';
38
- import { PublicEnqueuedCallSideEffectTrace, SideEffectArrayLengths } from './enqueued_call_side_effect_trace.js';
39
45
  import { type WorldStateDB } from './public_db_sources.js';
40
- import { generateAvmCircuitPublicInputs } from './transitional_adapters.js';
46
+ import { SideEffectArrayLengths, SideEffectTrace } from './side_effect_trace.js';
41
47
  import { getCallRequestsByPhase, getExecutionRequestsByPhase } from './utils.js';
42
48
 
43
49
  /**
@@ -77,7 +83,7 @@ export class PublicTxContext {
77
83
  public readonly nonRevertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData,
78
84
  public readonly revertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData,
79
85
  public readonly feePayer: AztecAddress,
80
- public trace: PublicEnqueuedCallSideEffectTrace, // FIXME(dbanks12): should be private
86
+ public trace: SideEffectTrace, // FIXME(dbanks12): should be private
81
87
  ) {
82
88
  this.log = createLogger(`simulator:public_tx_context`);
83
89
  }
@@ -99,17 +105,15 @@ export class PublicTxContext {
99
105
  countAccumulatedItems(nonRevertibleAccumulatedDataFromPrivate.l2ToL1Msgs),
100
106
  /*publicLogs*/ 0,
101
107
  );
102
- const enqueuedCallTrace = new PublicEnqueuedCallSideEffectTrace(
103
- /*startSideEffectCounter=*/ 0,
104
- previousAccumulatedDataArrayLengths,
105
- );
108
+
109
+ const trace = new SideEffectTrace(/*startSideEffectCounter=*/ 0, previousAccumulatedDataArrayLengths);
106
110
 
107
111
  const firstNullifier = nonRevertibleAccumulatedDataFromPrivate.nullifiers[0];
108
112
 
109
113
  // Transaction level state manager that will be forked for revertible phases.
110
114
  const txStateManager = await AvmPersistableStateManager.create(
111
115
  worldStateDB,
112
- enqueuedCallTrace,
116
+ trace,
113
117
  doMerkleOperations,
114
118
  firstNullifier,
115
119
  );
@@ -120,7 +124,7 @@ export class PublicTxContext {
120
124
  const gasAllocatedToPublic = applyMaxToAvailableGas(gasSettings.gasLimits.sub(gasUsedByPrivate));
121
125
 
122
126
  return new PublicTxContext(
123
- tx.getTxHash(),
127
+ await tx.getTxHash(),
124
128
  new PhaseStateManager(txStateManager),
125
129
  globalVariables,
126
130
  await db.getStateReference(),
@@ -136,7 +140,7 @@ export class PublicTxContext {
136
140
  tx.data.forPublic!.nonRevertibleAccumulatedData,
137
141
  tx.data.forPublic!.revertibleAccumulatedData,
138
142
  tx.data.feePayer,
139
- enqueuedCallTrace,
143
+ trace,
140
144
  );
141
145
  }
142
146
 
@@ -319,13 +323,14 @@ export class PublicTxContext {
319
323
  /**
320
324
  * Generate the public inputs for the AVM circuit.
321
325
  */
322
- private generateAvmCircuitPublicInputs(endStateReference: StateReference): AvmCircuitPublicInputs {
326
+ private async generateAvmCircuitPublicInputs(endStateReference: StateReference): Promise<AvmCircuitPublicInputs> {
323
327
  assert(this.halted, 'Can only get AvmCircuitPublicInputs after tx execution ends');
324
328
  const ephemeralTrees = this.state.getActiveStateManager().merkleTrees;
325
329
 
326
- const noteHashTree = ephemeralTrees.getTreeSnapshot(MerkleTreeId.NOTE_HASH_TREE);
327
- const nullifierTree = ephemeralTrees.getTreeSnapshot(MerkleTreeId.NULLIFIER_TREE);
328
- const publicDataTree = ephemeralTrees.getTreeSnapshot(MerkleTreeId.PUBLIC_DATA_TREE);
330
+ const noteHashTree = await ephemeralTrees.getTreeSnapshot(MerkleTreeId.NOTE_HASH_TREE);
331
+ const nullifierTree = await ephemeralTrees.getTreeSnapshot(MerkleTreeId.NULLIFIER_TREE);
332
+ const publicDataTree = await ephemeralTrees.getTreeSnapshot(MerkleTreeId.PUBLIC_DATA_TREE);
333
+
329
334
  // Pad the note hash and nullifier trees
330
335
  const paddedNoteHashTreeSize =
331
336
  this.startStateReference.partial.noteHashTree.nextAvailableLeafIndex + MAX_NOTE_HASHES_PER_TX;
@@ -352,38 +357,92 @@ export class PublicTxContext {
352
357
  publicDataTree,
353
358
  );
354
359
 
355
- return generateAvmCircuitPublicInputs(
356
- this.trace,
360
+ const startTreeSnapshots = new TreeSnapshots(
361
+ this.startStateReference.l1ToL2MessageTree,
362
+ this.startStateReference.partial.noteHashTree,
363
+ this.startStateReference.partial.nullifierTree,
364
+ this.startStateReference.partial.publicDataTree,
365
+ );
366
+
367
+ const avmCircuitPublicInputs = this.trace.toAvmCircuitPublicInputs(
357
368
  this.globalVariables,
358
- this.startStateReference,
369
+ startTreeSnapshots,
359
370
  /*startGasUsed=*/ this.gasUsedByPrivate,
360
371
  this.gasSettings,
361
372
  this.feePayer,
362
373
  this.setupCallRequests,
363
374
  this.appLogicCallRequests,
364
- this.teardownCallRequests,
365
- this.nonRevertibleAccumulatedDataFromPrivate,
366
- this.revertibleAccumulatedDataFromPrivate,
375
+ /*teardownCallRequest=*/ this.teardownCallRequests.length
376
+ ? this.teardownCallRequests[0]
377
+ : PublicCallRequest.empty(),
367
378
  endTreeSnapshots,
368
379
  /*endGasUsed=*/ this.getTotalGasUsed(),
369
- this.getTransactionFeeUnsafe(),
370
- this.revertCode,
380
+ /*transactionFee=*/ this.getTransactionFeeUnsafe(),
381
+ /*reverted=*/ !this.revertCode.isOK(),
382
+ );
383
+
384
+ const getArrayLengths = (from: PrivateToPublicAccumulatedData) =>
385
+ new PrivateToAvmAccumulatedDataArrayLengths(
386
+ countAccumulatedItems(from.noteHashes),
387
+ countAccumulatedItems(from.nullifiers),
388
+ countAccumulatedItems(from.l2ToL1Msgs),
389
+ );
390
+ const convertAccumulatedData = (from: PrivateToPublicAccumulatedData) =>
391
+ new PrivateToAvmAccumulatedData(from.noteHashes, from.nullifiers, from.l2ToL1Msgs);
392
+ // Temporary overrides as these entries aren't yet populated in trace
393
+ avmCircuitPublicInputs.previousNonRevertibleAccumulatedDataArrayLengths = getArrayLengths(
394
+ this.nonRevertibleAccumulatedDataFromPrivate,
395
+ );
396
+ avmCircuitPublicInputs.previousRevertibleAccumulatedDataArrayLengths = getArrayLengths(
397
+ this.revertibleAccumulatedDataFromPrivate,
398
+ );
399
+ avmCircuitPublicInputs.previousNonRevertibleAccumulatedData = convertAccumulatedData(
400
+ this.nonRevertibleAccumulatedDataFromPrivate,
401
+ );
402
+ avmCircuitPublicInputs.previousRevertibleAccumulatedData = convertAccumulatedData(
403
+ this.revertibleAccumulatedDataFromPrivate,
404
+ );
405
+
406
+ const msgsFromPrivate = this.revertCode.isOK()
407
+ ? mergeAccumulatedData(
408
+ avmCircuitPublicInputs.previousNonRevertibleAccumulatedData.l2ToL1Msgs,
409
+ avmCircuitPublicInputs.previousRevertibleAccumulatedData.l2ToL1Msgs,
410
+ )
411
+ : avmCircuitPublicInputs.previousNonRevertibleAccumulatedData.l2ToL1Msgs;
412
+ avmCircuitPublicInputs.accumulatedData.l2ToL1Msgs = assertLength(
413
+ mergeAccumulatedData(msgsFromPrivate, avmCircuitPublicInputs.accumulatedData.l2ToL1Msgs),
414
+ MAX_L2_TO_L1_MSGS_PER_TX,
415
+ );
416
+
417
+ // Maps slot to value. Maps in TS are iterable in insertion order, which is exactly what we want for
418
+ // squashing "to the left", where the first occurrence of a slot uses the value of the last write to it,
419
+ // and the rest occurrences are omitted
420
+ const squashedPublicDataWrites: Map<bigint, Fr> = new Map();
421
+ for (const publicDataWrite of avmCircuitPublicInputs.accumulatedData.publicDataWrites) {
422
+ squashedPublicDataWrites.set(publicDataWrite.leafSlot.toBigInt(), publicDataWrite.value);
423
+ }
424
+
425
+ avmCircuitPublicInputs.accumulatedData.publicDataWrites = padArrayEnd(
426
+ Array.from(squashedPublicDataWrites.entries()).map(([slot, value]) => new PublicDataWrite(new Fr(slot), value)),
427
+ PublicDataWrite.empty(),
428
+ MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
371
429
  );
430
+
431
+ return avmCircuitPublicInputs;
372
432
  }
373
433
 
374
434
  /**
375
435
  * Generate the proving request for the AVM circuit.
376
436
  */
377
- generateProvingRequest(endStateReference: StateReference): AvmProvingRequest {
437
+ async generateProvingRequest(endStateReference: StateReference): Promise<AvmProvingRequest> {
378
438
  const hints = this.trace.getAvmCircuitHints();
379
439
  return {
380
440
  type: ProvingRequestType.PUBLIC_VM,
381
441
  inputs: new AvmCircuitInputs(
382
442
  'public_dispatch',
383
443
  [],
384
- PublicCircuitPublicInputs.empty(),
385
444
  hints,
386
- this.generateAvmCircuitPublicInputs(endStateReference),
445
+ await this.generateAvmCircuitPublicInputs(endStateReference),
387
446
  ),
388
447
  };
389
448
  }
@@ -70,7 +70,7 @@ export class PublicTxSimulator {
70
70
  * @returns The result of the transaction's public execution.
71
71
  */
72
72
  public async simulate(tx: Tx): Promise<PublicTxResult> {
73
- const txHash = tx.getTxHash();
73
+ const txHash = await tx.getTxHash();
74
74
  this.log.debug(`Simulating ${tx.enqueuedPublicFunctionCalls.length} public calls for tx ${txHash}`, { txHash });
75
75
 
76
76
  const context = await PublicTxContext.create(
@@ -119,7 +119,7 @@ export class PublicTxSimulator {
119
119
 
120
120
  const endStateReference = await this.db.getStateReference();
121
121
 
122
- const avmProvingRequest = context.generateProvingRequest(endStateReference);
122
+ const avmProvingRequest = await context.generateProvingRequest(endStateReference);
123
123
 
124
124
  const revertCode = context.getFinalRevertCode();
125
125
  if (!revertCode.isOK()) {
@@ -127,7 +127,7 @@ export class PublicTxSimulator {
127
127
  // if so, this is removing contracts deployed in private setup
128
128
  // You can't submit contracts in public, so this is only relevant for private-created side effects
129
129
  // FIXME: we shouldn't need to directly modify worldStateDb here!
130
- await this.worldStateDB.removeNewContracts(tx);
130
+ await this.worldStateDB.removeNewContracts(tx, true);
131
131
  // FIXME(dbanks12): should not be changing immutable tx
132
132
  tx.filterRevertedLogs(tx.data.forPublic!.nonRevertibleAccumulatedData);
133
133
  }
@@ -384,7 +384,7 @@ export class PublicTxSimulator {
384
384
  }
385
385
  for (const noteHash of context.nonRevertibleAccumulatedDataFromPrivate.noteHashes) {
386
386
  if (!noteHash.isEmpty()) {
387
- stateManager.writeUniqueNoteHash(noteHash);
387
+ await stateManager.writeUniqueNoteHash(noteHash);
388
388
  }
389
389
  }
390
390
  }
@@ -409,7 +409,7 @@ export class PublicTxSimulator {
409
409
  for (const noteHash of context.revertibleAccumulatedDataFromPrivate.noteHashes) {
410
410
  if (!noteHash.isEmpty()) {
411
411
  // Revertible note hashes from private are not hashed with nonce, since private can't know their final position, only we can.
412
- stateManager.writeSiloedNoteHash(noteHash);
412
+ await stateManager.writeSiloedNoteHash(noteHash);
413
413
  }
414
414
  }
415
415
  }
@@ -423,7 +423,7 @@ export class PublicTxSimulator {
423
423
  }
424
424
 
425
425
  const feeJuiceAddress = ProtocolContractAddress.FeeJuice;
426
- const balanceSlot = computeFeePayerBalanceStorageSlot(context.feePayer);
426
+ const balanceSlot = await computeFeePayerBalanceStorageSlot(context.feePayer);
427
427
 
428
428
  this.log.debug(`Deducting ${txFee.toBigInt()} balance in Fee Juice for ${context.feePayer}`);
429
429
  const stateManager = context.state.getActiveStateManager();
@@ -97,10 +97,10 @@ export class SideEffectArrayLengths {
97
97
  }
98
98
 
99
99
  /**
100
- * Trace side effects for an entire enqueued call.
100
+ * Trace side effects for an enqueued public call's execution.
101
101
  */
102
- export class PublicEnqueuedCallSideEffectTrace implements PublicSideEffectTraceInterface {
103
- public log = createLogger('simulator:public_enqueued_call_side_effect_trace');
102
+ export class SideEffectTrace implements PublicSideEffectTraceInterface {
103
+ public log = createLogger('simulator:side_effect_trace');
104
104
 
105
105
  /** The side effect counter increments with every call to the trace. */
106
106
  private sideEffectCounter: number;
@@ -136,7 +136,7 @@ export class PublicEnqueuedCallSideEffectTrace implements PublicSideEffectTraceI
136
136
  }
137
137
 
138
138
  public fork() {
139
- return new PublicEnqueuedCallSideEffectTrace(
139
+ return new SideEffectTrace(
140
140
  this.sideEffectCounter,
141
141
  new SideEffectArrayLengths(
142
142
  this.previousSideEffectArrayLengths.publicDataWrites + this.userPublicDataWritesLength,
@@ -224,7 +224,7 @@ export class PublicEnqueuedCallSideEffectTrace implements PublicSideEffectTraceI
224
224
  this.incrementSideEffectCounter();
225
225
  }
226
226
 
227
- public tracePublicStorageWrite(
227
+ public async tracePublicStorageWrite(
228
228
  contractAddress: AztecAddress,
229
229
  slot: Fr,
230
230
  value: Fr,
@@ -234,7 +234,7 @@ export class PublicEnqueuedCallSideEffectTrace implements PublicSideEffectTraceI
234
234
  lowLeafPath: Fr[] = emptyPublicDataPath(),
235
235
  newLeafPreimage: PublicDataTreeLeafPreimage = PublicDataTreeLeafPreimage.empty(),
236
236
  insertionPath: Fr[] = emptyPublicDataPath(),
237
- ) {
237
+ ): Promise<void> {
238
238
  if (protocolWrite) {
239
239
  if (
240
240
  this.protocolPublicDataWritesLength + this.previousSideEffectArrayLengths.protocolPublicDataWrites >=
@@ -259,7 +259,7 @@ export class PublicEnqueuedCallSideEffectTrace implements PublicSideEffectTraceI
259
259
  this.userPublicDataWritesLength++;
260
260
  }
261
261
 
262
- const leafSlot = computePublicDataTreeLeafSlot(contractAddress, slot);
262
+ const leafSlot = await computePublicDataTreeLeafSlot(contractAddress, slot);
263
263
  this.publicDataWrites.push(new PublicDataUpdateRequest(leafSlot, value, this.sideEffectCounter));
264
264
 
265
265
  // New hinting
@@ -37,7 +37,7 @@ export interface PublicSideEffectTraceInterface {
37
37
  lowLeafPath?: Fr[],
38
38
  newLeafPreimage?: PublicDataTreeLeafPreimage,
39
39
  insertionPath?: Fr[],
40
- ): void;
40
+ ): Promise<void>;
41
41
  traceNoteHashCheck(contractAddress: AztecAddress, noteHash: Fr, leafIndex: Fr, exists: boolean, path?: Fr[]): void;
42
42
  traceNewNoteHash(uniqueNoteHash: Fr, leafIndex?: Fr, path?: Fr[]): void;
43
43
  getNoteHashCount(): number;
package/src/test/utils.ts CHANGED
@@ -11,7 +11,7 @@ import { sha256ToField } from '@aztec/foundation/crypto';
11
11
  * @param secret - The secret to unlock the message.
12
12
  * @returns The L1 to L2 message.
13
13
  */
14
- export const buildL1ToL2Message = (
14
+ export const buildL1ToL2Message = async (
15
15
  selector: string,
16
16
  contentPreimage: Fr[],
17
17
  targetContract: AztecAddress,
@@ -22,7 +22,7 @@ export const buildL1ToL2Message = (
22
22
  const selectorBuf = Buffer.from(selector, 'hex');
23
23
 
24
24
  const content = sha256ToField([selectorBuf, ...contentPreimage]);
25
- const secretHash = computeSecretHash(secret);
25
+ const secretHash = await computeSecretHash(secret);
26
26
 
27
27
  return new L1ToL2Message(
28
28
  new L1Actor(EthAddress.random(), 1),
@@ -1 +0,0 @@
1
- {"version":3,"file":"enqueued_call_side_effect_trace.d.ts","sourceRoot":"","sources":["../../src/public/enqueued_call_side_effect_trace.ts"],"names":[],"mappings":";;AAAA,OAAO,EAGL,sBAAsB,EAItB,iBAAiB,EAKjB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAE5B,GAAG,EACH,KAAK,WAAW,EAChB,KAAK,eAAe,EAapB,QAAQ,EACR,SAAS,EACT,qBAAqB,EAMrB,iBAAiB,EACjB,0BAA0B,EAC1B,uBAAuB,EAEvB,SAAS,EACT,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAM9C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,KAAK,gDAAgD,EAAE,KAAK,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEtH,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAOvD;;;;IAII;AACJ,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,iBAAiB,EAAE,CAAC;IAEnC,gBAAg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C,yBAAyB,EAAE,iBAAiB;IAC5C,0BAA0B;IAC1B,gBAAgB,EAAE,aAAa;IAC/B;;;OAGG;IACH,UAAU,EAAE,GAAG;IACf,uBAAuB;IACvB,cAAc,EAAE,EAAE;IAClB,yBAAyB;IACzB,QAAQ,EAAE,OAAO,GAChB,sBAAsB;IAsBlB,0BAA0B;IAC/B,oDAAoD;IACpD,eAAe,EAAE,uBAAuB;IACxC,4DAA4D;IAC5D,aAAa,EAAE,GAAG;IAClB,wCAAwC;IACxC,SAAS,EAAE,MAAM;IACjB,yBAAyB;IACzB,eAAe,EAAE,sBAAsB;IACvC,gCAAgC;IAChC,aAAa,GAAE,MAAkB,GAChC,wBAAwB;IAIpB,aAAa;IAIb,kBAAkB;IAIzB,OAAO,CAAC,qBAAqB;CAqB9B"}
@@ -1,4 +0,0 @@
1
- import { type AvmCircuitPublicInputs, type AztecAddress, Fr, type Gas, type GasSettings, type GlobalVariables, type PrivateToPublicAccumulatedData, PublicCallRequest, type RevertCode, type StateReference, TreeSnapshots } from '@aztec/circuits.js';
2
- import { type PublicEnqueuedCallSideEffectTrace } from './enqueued_call_side_effect_trace.js';
3
- export declare function generateAvmCircuitPublicInputs(trace: PublicEnqueuedCallSideEffectTrace, globalVariables: GlobalVariables, startStateReference: StateReference, startGasUsed: Gas, gasSettings: GasSettings, feePayer: AztecAddress, setupCallRequests: PublicCallRequest[], appLogicCallRequests: PublicCallRequest[], teardownCallRequests: PublicCallRequest[], nonRevertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData, revertibleAccumulatedDataFromPrivate: PrivateToPublicAccumulatedData, endTreeSnapshots: TreeSnapshots, endGasUsed: Gas, transactionFee: Fr, revertCode: RevertCode): AvmCircuitPublicInputs;
4
- //# sourceMappingURL=transitional_adapters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transitional_adapters.d.ts","sourceRoot":"","sources":["../../src/public/transitional_adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,EAAE,EACF,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,eAAe,EAKpB,KAAK,8BAA8B,EACnC,iBAAiB,EAEjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,aAAa,EAGd,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,KAAK,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAE9F,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,iCAAiC,EACxC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,cAAc,EACnC,YAAY,EAAE,GAAG,EACjB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,YAAY,EACtB,iBAAiB,EAAE,iBAAiB,EAAE,EACtC,oBAAoB,EAAE,iBAAiB,EAAE,EACzC,oBAAoB,EAAE,iBAAiB,EAAE,EACzC,uCAAuC,EAAE,8BAA8B,EACvE,oCAAoC,EAAE,8BAA8B,EACpE,gBAAgB,EAAE,aAAa,EAC/B,UAAU,EAAE,GAAG,EACf,cAAc,EAAE,EAAE,EAClB,UAAU,EAAE,UAAU,GACrB,sBAAsB,CAuExB"}