@aztec/txe 0.0.1-commit.b655e406 → 0.0.1-commit.fce3e4f

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 (53) hide show
  1. package/dest/bin/index.d.ts +1 -1
  2. package/dest/index.d.ts +1 -1
  3. package/dest/oracle/interfaces.d.ts +1 -1
  4. package/dest/oracle/txe_oracle_public_context.d.ts +1 -1
  5. package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
  6. package/dest/oracle/txe_oracle_top_level_context.d.ts +1 -1
  7. package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
  8. package/dest/oracle/txe_oracle_top_level_context.js +20 -11
  9. package/dest/rpc_translator.d.ts +9 -6
  10. package/dest/rpc_translator.d.ts.map +1 -1
  11. package/dest/rpc_translator.js +14 -7
  12. package/dest/state_machine/archiver.d.ts +7 -6
  13. package/dest/state_machine/archiver.d.ts.map +1 -1
  14. package/dest/state_machine/dummy_p2p_client.d.ts +4 -2
  15. package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
  16. package/dest/state_machine/dummy_p2p_client.js +3 -0
  17. package/dest/state_machine/global_variable_builder.d.ts +3 -2
  18. package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
  19. package/dest/state_machine/index.d.ts +1 -1
  20. package/dest/state_machine/index.d.ts.map +1 -1
  21. package/dest/state_machine/mock_epoch_cache.d.ts +6 -5
  22. package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
  23. package/dest/state_machine/mock_epoch_cache.js +8 -7
  24. package/dest/state_machine/synchronizer.d.ts +1 -1
  25. package/dest/state_machine/synchronizer.d.ts.map +1 -1
  26. package/dest/txe_session.d.ts +1 -1
  27. package/dest/txe_session.d.ts.map +1 -1
  28. package/dest/txe_session.js +5 -3
  29. package/dest/util/encoding.d.ts +15 -15
  30. package/dest/util/expected_failure_error.d.ts +1 -1
  31. package/dest/util/expected_failure_error.d.ts.map +1 -1
  32. package/dest/util/txe_account_data_provider.d.ts +1 -1
  33. package/dest/util/txe_account_data_provider.d.ts.map +1 -1
  34. package/dest/util/txe_contract_data_provider.d.ts +1 -1
  35. package/dest/util/txe_contract_data_provider.d.ts.map +1 -1
  36. package/dest/util/txe_public_contract_data_source.d.ts +1 -1
  37. package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
  38. package/dest/utils/block_creation.d.ts +1 -1
  39. package/dest/utils/block_creation.d.ts.map +1 -1
  40. package/dest/utils/block_creation.js +1 -1
  41. package/dest/utils/tx_effect_creation.d.ts +2 -2
  42. package/dest/utils/tx_effect_creation.d.ts.map +1 -1
  43. package/dest/utils/tx_effect_creation.js +5 -5
  44. package/package.json +18 -17
  45. package/src/oracle/txe_oracle_top_level_context.ts +19 -10
  46. package/src/rpc_translator.ts +10 -10
  47. package/src/state_machine/archiver.ts +6 -5
  48. package/src/state_machine/dummy_p2p_client.ts +6 -1
  49. package/src/state_machine/global_variable_builder.ts +2 -1
  50. package/src/state_machine/mock_epoch_cache.ts +12 -11
  51. package/src/txe_session.ts +6 -4
  52. package/src/utils/block_creation.ts +1 -0
  53. package/src/utils/tx_effect_creation.ts +5 -5
@@ -25,6 +25,7 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
25
25
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
26
26
  import { Body, L2Block } from '@aztec/stdlib/block';
27
27
  import { GasSettings } from '@aztec/stdlib/gas';
28
+ import { computeProtocolNullifier } from '@aztec/stdlib/hash';
28
29
  import { PrivateContextInputs } from '@aztec/stdlib/kernel';
29
30
  import { makeAppendOnlyTreeSnapshot, makeGlobalVariables } from '@aztec/stdlib/testing';
30
31
  import { CallContext, GlobalVariables, TxContext } from '@aztec/stdlib/tx';
@@ -66,7 +67,7 @@ type SessionState =
66
67
  | {
67
68
  name: 'PRIVATE';
68
69
  nextBlockGlobalVariables: GlobalVariables;
69
- txRequestHash: Fr;
70
+ protocolNullifier: Fr;
70
71
  noteCache: ExecutionNoteCache;
71
72
  taggingIndexCache: ExecutionTaggingIndexCache;
72
73
  }
@@ -295,7 +296,8 @@ export class TXESession implements TXESessionStateHandler {
295
296
  });
296
297
 
297
298
  const txRequestHash = getSingleTxBlockRequestHash(nextBlockGlobalVariables.blockNumber);
298
- const noteCache = new ExecutionNoteCache(txRequestHash);
299
+ const protocolNullifier = await computeProtocolNullifier(txRequestHash);
300
+ const noteCache = new ExecutionNoteCache(protocolNullifier);
299
301
  const taggingIndexCache = new ExecutionTaggingIndexCache();
300
302
 
301
303
  this.oracleHandler = new PrivateExecutionOracle(
@@ -316,7 +318,7 @@ export class TXESession implements TXESessionStateHandler {
316
318
  // difference resides in that the simulator has all information needed in order to run the simulation, while ours
317
319
  // will be ongoing as the different oracles will be invoked from the Noir test, until eventually the private
318
320
  // execution finishes.
319
- this.state = { name: 'PRIVATE', nextBlockGlobalVariables, txRequestHash, noteCache, taggingIndexCache };
321
+ this.state = { name: 'PRIVATE', nextBlockGlobalVariables, protocolNullifier, noteCache, taggingIndexCache };
320
322
  this.logger.debug(`Entered state ${this.state.name}`);
321
323
 
322
324
  return (this.oracleHandler as PrivateExecutionOracle).getPrivateContextInputs();
@@ -392,7 +394,7 @@ export class TXESession implements TXESessionStateHandler {
392
394
  // logs (other effects like enqueued public calls don't need to be considered since those are not allowed).
393
395
  const txEffect = await makeTxEffect(
394
396
  this.state.noteCache,
395
- this.state.txRequestHash,
397
+ this.state.protocolNullifier,
396
398
  this.state.nextBlockGlobalVariables.blockNumber,
397
399
  );
398
400
 
@@ -58,5 +58,6 @@ export async function makeTXEBlockHeader(
58
58
  Fr.ZERO,
59
59
  Fr.ZERO,
60
60
  Fr.ZERO,
61
+ Fr.ZERO,
61
62
  );
62
63
  }
@@ -5,13 +5,13 @@ import { TxEffect, TxHash } from '@aztec/stdlib/tx';
5
5
 
6
6
  export async function makeTxEffect(
7
7
  noteCache: ExecutionNoteCache,
8
- txRequestHash: Fr,
8
+ protocolNullifier: Fr,
9
9
  txBlockNumber: number,
10
10
  ): Promise<TxEffect> {
11
11
  const txEffect = TxEffect.empty();
12
12
 
13
- const { usedTxRequestHashForNonces } = noteCache.finish();
14
- const nonceGenerator = usedTxRequestHashForNonces ? txRequestHash : noteCache.getAllNullifiers()[0];
13
+ const { usedProtocolNullifierForNonces } = noteCache.finish();
14
+ const nonceGenerator = usedProtocolNullifierForNonces ? protocolNullifier : noteCache.getAllNullifiers()[0];
15
15
 
16
16
  txEffect.noteHashes = await Promise.all(
17
17
  noteCache
@@ -27,8 +27,8 @@ export async function makeTxEffect(
27
27
  // Nullifiers are already siloed
28
28
  txEffect.nullifiers = noteCache.getAllNullifiers();
29
29
 
30
- if (usedTxRequestHashForNonces) {
31
- txEffect.nullifiers.unshift(txRequestHash);
30
+ if (usedProtocolNullifierForNonces) {
31
+ txEffect.nullifiers.unshift(protocolNullifier);
32
32
  }
33
33
 
34
34
  txEffect.txHash = new TxHash(new Fr(txBlockNumber));