@aztec/txe 0.0.1-commit.d3ec352c → 0.0.1-commit.e6bd8901

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 (80) hide show
  1. package/dest/constants.d.ts +3 -0
  2. package/dest/constants.d.ts.map +1 -0
  3. package/dest/constants.js +2 -0
  4. package/dest/index.d.ts +1 -1
  5. package/dest/index.d.ts.map +1 -1
  6. package/dest/index.js +3 -2
  7. package/dest/oracle/interfaces.d.ts +6 -4
  8. package/dest/oracle/interfaces.d.ts.map +1 -1
  9. package/dest/oracle/txe_oracle_public_context.d.ts +4 -4
  10. package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
  11. package/dest/oracle/txe_oracle_public_context.js +7 -8
  12. package/dest/oracle/txe_oracle_top_level_context.d.ts +20 -11
  13. package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
  14. package/dest/oracle/txe_oracle_top_level_context.js +100 -63
  15. package/dest/rpc_translator.d.ts +23 -11
  16. package/dest/rpc_translator.d.ts.map +1 -1
  17. package/dest/rpc_translator.js +91 -38
  18. package/dest/state_machine/archiver.d.ts +21 -57
  19. package/dest/state_machine/archiver.d.ts.map +1 -1
  20. package/dest/state_machine/archiver.js +61 -107
  21. package/dest/state_machine/dummy_p2p_client.d.ts +8 -7
  22. package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
  23. package/dest/state_machine/dummy_p2p_client.js +16 -11
  24. package/dest/state_machine/global_variable_builder.d.ts +4 -3
  25. package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
  26. package/dest/state_machine/global_variable_builder.js +13 -1
  27. package/dest/state_machine/index.d.ts +5 -5
  28. package/dest/state_machine/index.d.ts.map +1 -1
  29. package/dest/state_machine/index.js +32 -20
  30. package/dest/state_machine/mock_epoch_cache.d.ts +7 -6
  31. package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
  32. package/dest/state_machine/mock_epoch_cache.js +10 -7
  33. package/dest/state_machine/synchronizer.d.ts +3 -3
  34. package/dest/state_machine/synchronizer.d.ts.map +1 -1
  35. package/dest/state_machine/synchronizer.js +2 -2
  36. package/dest/txe_session.d.ts +18 -10
  37. package/dest/txe_session.d.ts.map +1 -1
  38. package/dest/txe_session.js +91 -45
  39. package/dest/util/encoding.d.ts +618 -19
  40. package/dest/util/encoding.d.ts.map +1 -1
  41. package/dest/util/encoding.js +1 -1
  42. package/dest/util/txe_account_store.d.ts +10 -0
  43. package/dest/util/txe_account_store.d.ts.map +1 -0
  44. package/dest/util/{txe_account_data_provider.js → txe_account_store.js} +1 -1
  45. package/dest/util/txe_contract_store.d.ts +12 -0
  46. package/dest/util/txe_contract_store.d.ts.map +1 -0
  47. package/dest/util/{txe_contract_data_provider.js → txe_contract_store.js} +3 -3
  48. package/dest/util/txe_public_contract_data_source.d.ts +5 -5
  49. package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
  50. package/dest/util/txe_public_contract_data_source.js +11 -11
  51. package/dest/utils/block_creation.d.ts +19 -5
  52. package/dest/utils/block_creation.d.ts.map +1 -1
  53. package/dest/utils/block_creation.js +36 -4
  54. package/dest/utils/tx_effect_creation.d.ts +2 -3
  55. package/dest/utils/tx_effect_creation.d.ts.map +1 -1
  56. package/dest/utils/tx_effect_creation.js +4 -7
  57. package/package.json +16 -16
  58. package/src/constants.ts +3 -0
  59. package/src/index.ts +15 -12
  60. package/src/oracle/interfaces.ts +5 -3
  61. package/src/oracle/txe_oracle_public_context.ts +7 -12
  62. package/src/oracle/txe_oracle_top_level_context.ts +149 -88
  63. package/src/rpc_translator.ts +113 -49
  64. package/src/state_machine/archiver.ts +57 -131
  65. package/src/state_machine/dummy_p2p_client.ts +21 -14
  66. package/src/state_machine/global_variable_builder.ts +19 -2
  67. package/src/state_machine/index.ts +41 -18
  68. package/src/state_machine/mock_epoch_cache.ts +10 -11
  69. package/src/state_machine/synchronizer.ts +3 -4
  70. package/src/txe_session.ts +187 -76
  71. package/src/util/encoding.ts +1 -1
  72. package/src/util/{txe_account_data_provider.ts → txe_account_store.ts} +1 -1
  73. package/src/util/{txe_contract_data_provider.ts → txe_contract_store.ts} +3 -3
  74. package/src/util/txe_public_contract_data_source.ts +10 -10
  75. package/src/utils/block_creation.ts +46 -15
  76. package/src/utils/tx_effect_creation.ts +4 -12
  77. package/dest/util/txe_account_data_provider.d.ts +0 -10
  78. package/dest/util/txe_account_data_provider.d.ts.map +0 -1
  79. package/dest/util/txe_contract_data_provider.d.ts +0 -12
  80. package/dest/util/txe_contract_data_provider.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../src/util/encoding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,KAAK,2BAA2B,EAAqC,MAAM,wBAAwB,CAAC;AAE7G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,gBAAgB,GAAG,MAAM,EAAE,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG,CAAC,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,2BAA2B,CAAC,EAAE,CAAC;AAExH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,EAAE,CAAC;CAClD,CAAC;AAEF,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,MAEhD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,gBAEvD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,gBAAgB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { hexToBuffer } from '@aztec/foundation/string';
3
3
  import { ContractArtifactSchema } from '@aztec/stdlib/abi';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -0,0 +1,10 @@
1
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
+ import { CompleteAddress } from '@aztec/stdlib/contract';
4
+ export declare class TXEAccountStore {
5
+ #private;
6
+ constructor(store: AztecAsyncKVStore);
7
+ getAccount(key: AztecAddress): Promise<CompleteAddress>;
8
+ setAccount(key: AztecAddress, value: CompleteAddress): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX2FjY291bnRfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3R4ZV9hY2NvdW50X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFpQixNQUFNLGlCQUFpQixDQUFDO0FBQ3hFLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUV6RCxxQkFBYSxlQUFlOztJQUcxQixZQUFZLEtBQUssRUFBRSxpQkFBaUIsRUFFbkM7SUFFSyxVQUFVLENBQUMsR0FBRyxFQUFFLFlBQVksNEJBTWpDO0lBRUssVUFBVSxDQUFDLEdBQUcsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLGVBQWUsaUJBRXpEO0NBQ0YifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"txe_account_store.d.ts","sourceRoot":"","sources":["../../src/util/txe_account_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,eAAe;;IAG1B,YAAY,KAAK,EAAE,iBAAiB,EAEnC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,4BAMjC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,iBAEzD;CACF"}
@@ -1,5 +1,5 @@
1
1
  import { CompleteAddress } from '@aztec/stdlib/contract';
2
- export class TXEAccountDataProvider {
2
+ export class TXEAccountStore {
3
3
  #accounts;
4
4
  constructor(store){
5
5
  this.#accounts = store.openMap('accounts');
@@ -0,0 +1,12 @@
1
+ import type { ContractArtifact } from '@aztec/aztec.js/abi';
2
+ import { Fr } from '@aztec/aztec.js/fields';
3
+ import { ContractStore } from '@aztec/pxe/server';
4
+ export type ContractArtifactWithHash = ContractArtifact & {
5
+ artifactHash: Fr;
6
+ };
7
+ export declare class TXEContractStore extends ContractStore {
8
+ #private;
9
+ addContractArtifact(id: Fr, artifact: ContractArtifact | ContractArtifactWithHash): Promise<void>;
10
+ getContractArtifact(contractClassId: Fr): Promise<ContractArtifact | ContractArtifactWithHash | undefined>;
11
+ }
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX2NvbnRyYWN0X3N0b3JlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbC90eGVfY29udHJhY3Rfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM1RCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDNUMsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRWxELE1BQU0sTUFBTSx3QkFBd0IsR0FBRyxnQkFBZ0IsR0FBRztJQUFFLFlBQVksRUFBRSxFQUFFLENBQUE7Q0FBRSxDQUFDO0FBTy9FLHFCQUFhLGdCQUFpQixTQUFRLGFBQWE7O0lBRzNCLG1CQUFtQixDQUN2QyxFQUFFLEVBQUUsRUFBRSxFQUNOLFFBQVEsRUFBRSxnQkFBZ0IsR0FBRyx3QkFBd0IsR0FDcEQsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUtmO0lBRXFCLG1CQUFtQixDQUN2QyxlQUFlLEVBQUUsRUFBRSxHQUNsQixPQUFPLENBQUMsZ0JBQWdCLEdBQUcsd0JBQXdCLEdBQUcsU0FBUyxDQUFDLENBUWxFO0NBQ0YifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"txe_contract_store.d.ts","sourceRoot":"","sources":["../../src/util/txe_contract_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IAAE,YAAY,EAAE,EAAE,CAAA;CAAE,CAAC;AAO/E,qBAAa,gBAAiB,SAAQ,aAAa;;IAG3B,mBAAmB,CACvC,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,GACpD,OAAO,CAAC,IAAI,CAAC,CAKf;IAEqB,mBAAmB,CACvC,eAAe,EAAE,EAAE,GAClB,OAAO,CAAC,gBAAgB,GAAG,wBAAwB,GAAG,SAAS,CAAC,CAQlE;CACF"}
@@ -1,10 +1,10 @@
1
1
  import { Fr } from '@aztec/aztec.js/fields';
2
- import { ContractDataProvider } from '@aztec/pxe/server';
2
+ import { ContractStore } from '@aztec/pxe/server';
3
3
  /*
4
- * A contract data provider that stores contract artifacts with their hashes. Since
4
+ * A contract store that stores contract artifacts with their hashes. Since
5
5
  * TXE typically deploys the same contract again and again for multiple tests, caching
6
6
  * the *very* expensive artifact hash computation improves testing speed significantly.
7
- */ export class TXEContractDataProvider extends ContractDataProvider {
7
+ */ export class TXEContractStore extends ContractStore {
8
8
  #artifactHashes = new Map();
9
9
  async addContractArtifact(id, artifact) {
10
10
  if ('artifactHash' in artifact) {
@@ -1,14 +1,14 @@
1
1
  import { BlockNumber } from '@aztec/foundation/branded-types';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import type { ContractDataProvider } from '@aztec/pxe/server';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import type { ContractStore } from '@aztec/pxe/server';
4
4
  import { type ContractArtifact, FunctionSelector } from '@aztec/stdlib/abi';
5
5
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
6
6
  import { type ContractClassPublic, type ContractDataSource, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
7
7
  export declare class TXEPublicContractDataSource implements ContractDataSource {
8
8
  #private;
9
9
  private blockNumber;
10
- private contractDataProvider;
11
- constructor(blockNumber: BlockNumber, contractDataProvider: ContractDataProvider);
10
+ private contractStore;
11
+ constructor(blockNumber: BlockNumber, contractStore: ContractStore);
12
12
  getBlockNumber(): Promise<BlockNumber>;
13
13
  getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
14
14
  getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
@@ -18,4 +18,4 @@ export declare class TXEPublicContractDataSource implements ContractDataSource {
18
18
  getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
19
19
  registerContractFunctionSignatures(_signatures: []): Promise<void>;
20
20
  }
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvdHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzlDLE9BQU8sS0FBSyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDOUQsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQWdCLE1BQU0sbUJBQW1CLENBQUM7QUFDMUYsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxFQUNMLEtBQUssbUJBQW1CLEVBQ3hCLEtBQUssa0JBQWtCLEVBQ3ZCLEtBQUssMkJBQTJCLEVBSWpDLE1BQU0sd0JBQXdCLENBQUM7QUFFaEMscUJBQWEsMkJBQTRCLFlBQVcsa0JBQWtCOztJQUdsRSxPQUFPLENBQUMsV0FBVztJQUNuQixPQUFPLENBQUMsb0JBQW9CO0lBRjlCLFlBQ1UsV0F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AE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAG3D;IAEK,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAGzF;IAED,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAEnC;IAEK,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAGtF;IAEK,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEzG;IAED,kCAAkC,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACF"}
@@ -1,24 +1,24 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { FunctionType } from '@aztec/stdlib/abi';
3
3
  import { computePrivateFunctionsRoot, computePublicBytecodeCommitment, getContractClassPrivateFunctionFromArtifact } from '@aztec/stdlib/contract';
4
4
  export class TXEPublicContractDataSource {
5
5
  blockNumber;
6
- contractDataProvider;
6
+ contractStore;
7
7
  #privateFunctionsRoot;
8
- constructor(blockNumber, contractDataProvider){
8
+ constructor(blockNumber, contractStore){
9
9
  this.blockNumber = blockNumber;
10
- this.contractDataProvider = contractDataProvider;
10
+ this.contractStore = contractStore;
11
11
  this.#privateFunctionsRoot = new Map();
12
12
  }
13
13
  getBlockNumber() {
14
14
  return Promise.resolve(this.blockNumber);
15
15
  }
16
16
  async getContractClass(id) {
17
- const contractClass = await this.contractDataProvider.getContractClass(id);
17
+ const contractClass = await this.contractStore.getContractClass(id);
18
18
  if (!contractClass) {
19
19
  return;
20
20
  }
21
- const artifact = await this.contractDataProvider.getContractArtifact(id);
21
+ const artifact = await this.contractStore.getContractArtifact(id);
22
22
  if (!artifact) {
23
23
  return;
24
24
  }
@@ -41,11 +41,11 @@ export class TXEPublicContractDataSource {
41
41
  };
42
42
  }
43
43
  async getBytecodeCommitment(id) {
44
- const contractClass = await this.contractDataProvider.getContractClass(id);
44
+ const contractClass = await this.contractStore.getContractClass(id);
45
45
  return contractClass && computePublicBytecodeCommitment(contractClass.packedBytecode);
46
46
  }
47
47
  async getContract(address) {
48
- const instance = await this.contractDataProvider.getContractInstance(address);
48
+ const instance = await this.contractStore.getContractInstance(address);
49
49
  return instance && {
50
50
  ...instance,
51
51
  address
@@ -55,11 +55,11 @@ export class TXEPublicContractDataSource {
55
55
  throw new Error('Method not implemented.');
56
56
  }
57
57
  async getContractArtifact(address) {
58
- const instance = await this.contractDataProvider.getContractInstance(address);
59
- return instance && this.contractDataProvider.getContractArtifact(instance.currentContractClassId);
58
+ const instance = await this.contractStore.getContractInstance(address);
59
+ return instance && this.contractStore.getContractArtifact(instance.currentContractClassId);
60
60
  }
61
61
  async getDebugFunctionName(address, selector) {
62
- return await this.contractDataProvider.getDebugFunctionName(address, selector);
62
+ return await this.contractStore.getDebugFunctionName(address, selector);
63
63
  }
64
64
  registerContractFunctionSignatures(_signatures) {
65
65
  return Promise.resolve();
@@ -1,8 +1,8 @@
1
1
  import { BlockNumber } from '@aztec/foundation/branded-types';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { L2BlockHeader } from '@aztec/stdlib/block';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { L2Block } from '@aztec/stdlib/block';
4
4
  import { type MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
5
- import { GlobalVariables, TxEffect } from '@aztec/stdlib/tx';
5
+ import { BlockHeader, GlobalVariables, TxEffect } from '@aztec/stdlib/tx';
6
6
  /**
7
7
  * Returns a transaction request hash that is valid for transactions that are the only ones in a block.
8
8
  * @param blockNumber The number for the block in which there is a single transaction.
@@ -10,5 +10,19 @@ import { GlobalVariables, TxEffect } from '@aztec/stdlib/tx';
10
10
  */
11
11
  export declare function getSingleTxBlockRequestHash(blockNumber: BlockNumber): Fr;
12
12
  export declare function insertTxEffectIntoWorldTrees(txEffect: TxEffect, worldTrees: MerkleTreeWriteOperations): Promise<void>;
13
- export declare function makeTXEBlockHeader(worldTrees: MerkleTreeWriteOperations, globalVariables: GlobalVariables): Promise<L2BlockHeader>;
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfY3JlYXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9ibG9ja19jcmVhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzlDLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVwRCxPQUFPLEVBQXdDLEtBQUsseUJBQXlCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUMzRyxPQUFPLEVBQUUsZUFBZSxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRTdEOzs7O0dBSUc7QUFDSCx3QkFBZ0IsMkJBQTJCLENBQUMsV0FBVyxFQUFFLFdBQVcsR0FBRyxFQUFFLENBRXhFO0FBRUQsd0JBQXNCLDRCQUE0QixDQUNoRCxRQUFRLEVBQUUsUUFBUSxFQUNsQixVQUFVLEVBQUUseUJBQXlCLEdBQ3BDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FrQmY7QUFFRCx3QkFBc0Isa0JBQWtCLENBQ3RDLFVBQVUsRUFBRSx5QkFBeUIsRUFDckMsZUFBZSxFQUFFLGVBQWUsR0FDL0IsT0FBTyxDQUFDLGFBQWEsQ0FBQyxDQWN4QiJ9
13
+ export declare function makeTXEBlockHeader(worldTrees: MerkleTreeWriteOperations, globalVariables: GlobalVariables): Promise<BlockHeader>;
14
+ /**
15
+ * Creates an L2Block with proper archive chaining.
16
+ * This function:
17
+ * 1. Gets the current archive state as lastArchive for the header
18
+ * 2. Creates the block header
19
+ * 3. Updates the archive tree with the header hash
20
+ * 4. Gets the new archive state for the block's archive
21
+ *
22
+ * @param worldTrees - The world trees to read/write from
23
+ * @param globalVariables - Global variables for the block
24
+ * @param txEffects - Transaction effects to include in the block
25
+ * @returns The created L2Block with proper archive chaining
26
+ */
27
+ export declare function makeTXEBlock(worldTrees: MerkleTreeWriteOperations, globalVariables: GlobalVariables, txEffects: TxEffect[]): Promise<L2Block>;
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfY3JlYXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9ibG9ja19jcmVhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxPQUFPLEVBQUUsV0FBVyxFQUEyQyxNQUFNLGlDQUFpQyxDQUFDO0FBRXZHLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQVEsT0FBTyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDcEQsT0FBTyxFQUF3QyxLQUFLLHlCQUF5QixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDM0csT0FBTyxFQUFFLFdBQVcsRUFBRSxlQUFlLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFMUU7Ozs7R0FJRztBQUNILHdCQUFnQiwyQkFBMkIsQ0FBQyxXQUFXLEVBQUUsV0FBVyxHQUFHLEVBQUUsQ0FFeEU7QUFFRCx3QkFBc0IsNEJBQTRCLENBQ2hELFFBQVEsRUFBRSxRQUFRLEVBQ2xCLFVBQVUsRUFBRSx5QkFBeUIsR0FDcEMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQWtCZjtBQUVELHdCQUFzQixrQkFBa0IsQ0FDdEMsVUFBVSxFQUFFLHlCQUF5QixFQUNyQyxlQUFlLEVBQUUsZUFBZSxHQUMvQixPQUFPLENBQUMsV0FBVyxDQUFDLENBWXRCO0FBRUQ7Ozs7Ozs7Ozs7OztHQVlHO0FBQ0gsd0JBQXNCLFlBQVksQ0FDaEMsVUFBVSxFQUFFLHlCQUF5QixFQUNyQyxlQUFlLEVBQUUsZUFBZSxFQUNoQyxTQUFTLEVBQUUsUUFBUSxFQUFFLEdBQ3BCLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FlbEIifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"block_creation.d.ts","sourceRoot":"","sources":["../../src/utils/block_creation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAwC,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,WAAW,GAAG,EAAE,CAExE;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,aAAa,CAAC,CAcxB"}
1
+ {"version":3,"file":"block_creation.d.ts","sourceRoot":"","sources":["../../src/utils/block_creation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAA2C,MAAM,iCAAiC,CAAC;AAEvG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAQ,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAwC,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,WAAW,GAAG,EAAE,CAExE;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAAC,OAAO,CAAC,CAelB"}
@@ -1,9 +1,10 @@
1
1
  import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
2
+ import { CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
2
3
  import { padArrayEnd } from '@aztec/foundation/collection';
3
- import { Fr } from '@aztec/foundation/fields';
4
- import { L2BlockHeader } from '@aztec/stdlib/block';
5
- import { makeContentCommitment } from '@aztec/stdlib/testing';
4
+ import { Fr } from '@aztec/foundation/curves/bn254';
5
+ import { Body, L2Block } from '@aztec/stdlib/block';
6
6
  import { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
7
+ import { BlockHeader } from '@aztec/stdlib/tx';
7
8
  /**
8
9
  * Returns a transaction request hash that is valid for transactions that are the only ones in a block.
9
10
  * @param blockNumber The number for the block in which there is a single transaction.
@@ -20,5 +21,36 @@ export async function insertTxEffectIntoWorldTrees(txEffect, worldTrees) {
20
21
  export async function makeTXEBlockHeader(worldTrees, globalVariables) {
21
22
  const stateReference = await worldTrees.getStateReference();
22
23
  const archiveInfo = await worldTrees.getTreeInfo(MerkleTreeId.ARCHIVE);
23
- return new L2BlockHeader(new AppendOnlyTreeSnapshot(new Fr(archiveInfo.root), Number(archiveInfo.size)), makeContentCommitment(), stateReference, globalVariables, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO);
24
+ return BlockHeader.from({
25
+ lastArchive: new AppendOnlyTreeSnapshot(new Fr(archiveInfo.root), Number(archiveInfo.size)),
26
+ spongeBlobHash: Fr.ZERO,
27
+ state: stateReference,
28
+ globalVariables,
29
+ totalFees: Fr.ZERO,
30
+ totalManaUsed: Fr.ZERO
31
+ });
32
+ }
33
+ /**
34
+ * Creates an L2Block with proper archive chaining.
35
+ * This function:
36
+ * 1. Gets the current archive state as lastArchive for the header
37
+ * 2. Creates the block header
38
+ * 3. Updates the archive tree with the header hash
39
+ * 4. Gets the new archive state for the block's archive
40
+ *
41
+ * @param worldTrees - The world trees to read/write from
42
+ * @param globalVariables - Global variables for the block
43
+ * @param txEffects - Transaction effects to include in the block
44
+ * @returns The created L2Block with proper archive chaining
45
+ */ export async function makeTXEBlock(worldTrees, globalVariables, txEffects) {
46
+ const header = await makeTXEBlockHeader(worldTrees, globalVariables);
47
+ // Update the archive tree with this block's header hash
48
+ await worldTrees.updateArchive(header);
49
+ // Get the new archive state after updating
50
+ const newArchiveInfo = await worldTrees.getTreeInfo(MerkleTreeId.ARCHIVE);
51
+ const newArchive = new AppendOnlyTreeSnapshot(new Fr(newArchiveInfo.root), Number(newArchiveInfo.size));
52
+ // L2Block requires checkpointNumber and indexWithinCheckpoint
53
+ const checkpointNumber = CheckpointNumber.fromBlockNumber(globalVariables.blockNumber);
54
+ const indexWithinCheckpoint = IndexWithinCheckpoint(0);
55
+ return new L2Block(newArchive, header, new Body(txEffects), checkpointNumber, indexWithinCheckpoint);
24
56
  }
@@ -1,6 +1,5 @@
1
1
  import { BlockNumber } from '@aztec/foundation/branded-types';
2
- import { Fr } from '@aztec/foundation/fields';
3
2
  import type { ExecutionNoteCache } from '@aztec/pxe/simulator';
4
3
  import { TxEffect } from '@aztec/stdlib/tx';
5
- export declare function makeTxEffect(noteCache: ExecutionNoteCache, protocolNullifier: Fr, txBlockNumber: BlockNumber): Promise<TxEffect>;
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfZWZmZWN0X2NyZWF0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvdHhfZWZmZWN0X2NyZWF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUM5RCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDOUMsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUUvRCxPQUFPLEVBQUUsUUFBUSxFQUFVLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQsd0JBQXNCLFlBQVksQ0FDaEMsU0FBUyxFQUFFLGtCQUFrQixFQUM3QixpQkFBaUIsRUFBRSxFQUFFLEVBQ3JCLGFBQWEsRUFBRSxXQUFXLEdBQ3pCLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0EyQm5CIn0=
4
+ export declare function makeTxEffect(noteCache: ExecutionNoteCache, txBlockNumber: BlockNumber): Promise<TxEffect>;
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfZWZmZWN0X2NyZWF0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvdHhfZWZmZWN0X2NyZWF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUU5RCxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRS9ELE9BQU8sRUFBRSxRQUFRLEVBQVUsTUFBTSxrQkFBa0IsQ0FBQztBQUVwRCx3QkFBc0IsWUFBWSxDQUFDLFNBQVMsRUFBRSxrQkFBa0IsRUFBRSxhQUFhLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0F1Qi9HIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"tx_effect_creation.d.ts","sourceRoot":"","sources":["../../src/utils/tx_effect_creation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAU,MAAM,kBAAkB,CAAC;AAEpD,wBAAsB,YAAY,CAChC,SAAS,EAAE,kBAAkB,EAC7B,iBAAiB,EAAE,EAAE,EACrB,aAAa,EAAE,WAAW,GACzB,OAAO,CAAC,QAAQ,CAAC,CA2BnB"}
1
+ {"version":3,"file":"tx_effect_creation.d.ts","sourceRoot":"","sources":["../../src/utils/tx_effect_creation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAU,MAAM,kBAAkB,CAAC;AAEpD,wBAAsB,YAAY,CAAC,SAAS,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuB/G"}
@@ -1,16 +1,13 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash } from '@aztec/stdlib/hash';
3
3
  import { TxEffect, TxHash } from '@aztec/stdlib/tx';
4
- export async function makeTxEffect(noteCache, protocolNullifier, txBlockNumber) {
4
+ export async function makeTxEffect(noteCache, txBlockNumber) {
5
5
  const txEffect = TxEffect.empty();
6
- const { usedProtocolNullifierForNonces } = noteCache.finish();
7
- const nonceGenerator = usedProtocolNullifierForNonces ? protocolNullifier : noteCache.getAllNullifiers()[0];
6
+ noteCache.finish();
7
+ const nonceGenerator = noteCache.getNonceGenerator();
8
8
  txEffect.noteHashes = await Promise.all(noteCache.getAllNotes().map(async (pendingNote, i)=>computeUniqueNoteHash(await computeNoteHashNonce(nonceGenerator, i), await siloNoteHash(pendingNote.note.contractAddress, pendingNote.noteHashForConsumption))));
9
9
  // Nullifiers are already siloed
10
10
  txEffect.nullifiers = noteCache.getAllNullifiers();
11
- if (usedProtocolNullifierForNonces) {
12
- txEffect.nullifiers.unshift(protocolNullifier);
13
- }
14
11
  txEffect.txHash = new TxHash(new Fr(txBlockNumber));
15
12
  return txEffect;
16
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/txe",
3
- "version": "0.0.1-commit.d3ec352c",
3
+ "version": "0.0.1-commit.e6bd8901",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "bin": "./dest/bin/index.js",
@@ -61,27 +61,27 @@
61
61
  ]
62
62
  },
63
63
  "dependencies": {
64
- "@aztec/accounts": "0.0.1-commit.d3ec352c",
65
- "@aztec/archiver": "0.0.1-commit.d3ec352c",
66
- "@aztec/aztec-node": "0.0.1-commit.d3ec352c",
67
- "@aztec/aztec.js": "0.0.1-commit.d3ec352c",
68
- "@aztec/bb-prover": "0.0.1-commit.d3ec352c",
69
- "@aztec/constants": "0.0.1-commit.d3ec352c",
70
- "@aztec/foundation": "0.0.1-commit.d3ec352c",
71
- "@aztec/key-store": "0.0.1-commit.d3ec352c",
72
- "@aztec/kv-store": "0.0.1-commit.d3ec352c",
73
- "@aztec/protocol-contracts": "0.0.1-commit.d3ec352c",
74
- "@aztec/pxe": "0.0.1-commit.d3ec352c",
75
- "@aztec/simulator": "0.0.1-commit.d3ec352c",
76
- "@aztec/stdlib": "0.0.1-commit.d3ec352c",
77
- "@aztec/world-state": "0.0.1-commit.d3ec352c",
64
+ "@aztec/accounts": "0.0.1-commit.e6bd8901",
65
+ "@aztec/archiver": "0.0.1-commit.e6bd8901",
66
+ "@aztec/aztec-node": "0.0.1-commit.e6bd8901",
67
+ "@aztec/aztec.js": "0.0.1-commit.e6bd8901",
68
+ "@aztec/bb-prover": "0.0.1-commit.e6bd8901",
69
+ "@aztec/constants": "0.0.1-commit.e6bd8901",
70
+ "@aztec/foundation": "0.0.1-commit.e6bd8901",
71
+ "@aztec/key-store": "0.0.1-commit.e6bd8901",
72
+ "@aztec/kv-store": "0.0.1-commit.e6bd8901",
73
+ "@aztec/protocol-contracts": "0.0.1-commit.e6bd8901",
74
+ "@aztec/pxe": "0.0.1-commit.e6bd8901",
75
+ "@aztec/simulator": "0.0.1-commit.e6bd8901",
76
+ "@aztec/stdlib": "0.0.1-commit.e6bd8901",
77
+ "@aztec/world-state": "0.0.1-commit.e6bd8901",
78
78
  "zod": "^3.23.8"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@jest/globals": "^30.0.0",
82
82
  "@types/jest": "^30.0.0",
83
83
  "@types/node": "^22.15.17",
84
- "@typescript/native-preview": "7.0.0-dev.20251126.1",
84
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
85
85
  "jest": "^30.0.0",
86
86
  "jest-mock-extended": "^4.0.0",
87
87
  "ts-node": "^10.9.1",
@@ -0,0 +1,3 @@
1
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+
3
+ export const DEFAULT_ADDRESS = AztecAddress.fromNumber(42);
package/src/index.ts CHANGED
@@ -12,7 +12,8 @@ import type { Logger } from '@aztec/foundation/log';
12
12
  import { type ProtocolContract, protocolContractNames } from '@aztec/protocol-contracts';
13
13
  import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
14
14
  import { computeArtifactHash } from '@aztec/stdlib/contract';
15
- import type { ApiSchemaFor, ZodFor } from '@aztec/stdlib/schemas';
15
+ import type { ApiSchemaFor } from '@aztec/stdlib/schemas';
16
+ import { zodFor } from '@aztec/stdlib/schemas';
16
17
 
17
18
  import { createHash } from 'crypto';
18
19
  import { createReadStream } from 'fs';
@@ -32,7 +33,7 @@ import {
32
33
  fromSingle,
33
34
  toSingle,
34
35
  } from './util/encoding.js';
35
- import type { ContractArtifactWithHash } from './util/txe_contract_data_provider.js';
36
+ import type { ContractArtifactWithHash } from './util/txe_contract_store.js';
36
37
 
37
38
  const sessions = new Map<number, TXESession>();
38
39
 
@@ -53,16 +54,18 @@ type TXEForeignCallInput = {
53
54
  inputs: ForeignCallArgs;
54
55
  };
55
56
 
56
- const TXEForeignCallInputSchema = z.object({
57
- // eslint-disable-next-line camelcase
58
- session_id: z.number().int().nonnegative(),
59
- function: z.string() as ZodFor<TXEOracleFunctionName>,
60
- // eslint-disable-next-line camelcase
61
- root_path: z.string(),
62
- // eslint-disable-next-line camelcase
63
- package_name: z.string(),
64
- inputs: ForeignCallArgsSchema,
65
- }) satisfies ZodFor<TXEForeignCallInput>;
57
+ const TXEForeignCallInputSchema = zodFor<TXEForeignCallInput>()(
58
+ z.object({
59
+ // eslint-disable-next-line camelcase
60
+ session_id: z.number().int().nonnegative(),
61
+ function: z.string() as z.ZodType<TXEOracleFunctionName>,
62
+ // eslint-disable-next-line camelcase
63
+ root_path: z.string(),
64
+ // eslint-disable-next-line camelcase
65
+ package_name: z.string(),
66
+ inputs: ForeignCallArgsSchema,
67
+ }),
68
+ );
66
69
 
67
70
  class TXEDispatcher {
68
71
  private protocolContracts!: ProtocolContract[];
@@ -3,8 +3,8 @@ import { CompleteAddress } from '@aztec/aztec.js/addresses';
3
3
  import type { ContractInstanceWithAddress } from '@aztec/aztec.js/contracts';
4
4
  import { TxHash } from '@aztec/aztec.js/tx';
5
5
  import { BlockNumber } from '@aztec/foundation/branded-types';
6
- import type { Fr } from '@aztec/foundation/fields';
7
- import type { FunctionSelector } from '@aztec/stdlib/abi';
6
+ import type { Fr } from '@aztec/foundation/curves/bn254';
7
+ import type { EventSelector, FunctionSelector } from '@aztec/stdlib/abi';
8
8
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
9
9
  import type { UInt64 } from '@aztec/stdlib/types';
10
10
 
@@ -35,7 +35,7 @@ export interface IAvmExecutionOracle {
35
35
  avmOpcodeEmitNoteHash(noteHash: Fr): Promise<void>;
36
36
  avmOpcodeNullifierExists(innerNullifier: Fr, targetAddress: AztecAddress): Promise<boolean>;
37
37
  avmOpcodeStorageWrite(slot: Fr, value: Fr): Promise<void>;
38
- avmOpcodeStorageRead(slot: Fr): Promise<Fr>;
38
+ avmOpcodeStorageRead(slot: Fr, contractAddress: AztecAddress): Promise<Fr>;
39
39
  }
40
40
 
41
41
  /**
@@ -44,6 +44,7 @@ export interface IAvmExecutionOracle {
44
44
  export interface ITxeExecutionOracle {
45
45
  isTxe: true;
46
46
 
47
+ txeGetDefaultAddress(): AztecAddress;
47
48
  txeGetNextBlockNumber(): Promise<BlockNumber>;
48
49
  txeGetNextBlockTimestamp(): Promise<UInt64>;
49
50
  txeAdvanceBlocksBy(blocks: number): Promise<void>;
@@ -62,6 +63,7 @@ export interface ITxeExecutionOracle {
62
63
  noteHashes: Fr[];
63
64
  nullifiers: Fr[];
64
65
  }>;
66
+ txeGetPrivateEvents(selector: EventSelector, contractAddress: AztecAddress, scope: AztecAddress): Promise<Fr[][]>;
65
67
  txePrivateCallNewFlow(
66
68
  from: AztecAddress,
67
69
  targetContractAddress: AztecAddress,
@@ -1,11 +1,10 @@
1
1
  import { BlockNumber } from '@aztec/foundation/branded-types';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { type Logger, createLogger } from '@aztec/foundation/log';
4
4
  import { PublicDataWrite } from '@aztec/stdlib/avm';
5
5
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
6
- import { Body, L2Block } from '@aztec/stdlib/block';
6
+ import type { L2Block } from '@aztec/stdlib/block';
7
7
  import { computePublicDataTreeLeafSlot, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
8
- import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
9
8
  import {
10
9
  MerkleTreeId,
11
10
  type MerkleTreeWriteOperations,
@@ -14,7 +13,7 @@ import {
14
13
  } from '@aztec/stdlib/trees';
15
14
  import { GlobalVariables, TxEffect, TxHash } from '@aztec/stdlib/tx';
16
15
 
17
- import { insertTxEffectIntoWorldTrees, makeTXEBlockHeader } from '../utils/block_creation.js';
16
+ import { insertTxEffectIntoWorldTrees, makeTXEBlock } from '../utils/block_creation.js';
18
17
  import type { IAvmExecutionOracle } from './interfaces.js';
19
18
 
20
19
  export class TXEOraclePublicContext implements IAvmExecutionOracle {
@@ -102,8 +101,8 @@ export class TXEOraclePublicContext implements IAvmExecutionOracle {
102
101
  ]);
103
102
  }
104
103
 
105
- async avmOpcodeStorageRead(slot: Fr): Promise<Fr> {
106
- const leafSlot = await computePublicDataTreeLeafSlot(this.contractAddress, slot);
104
+ async avmOpcodeStorageRead(slot: Fr, contractAddress: AztecAddress): Promise<Fr> {
105
+ const leafSlot = await computePublicDataTreeLeafSlot(contractAddress, slot);
107
106
 
108
107
  const lowLeafResult = await this.forkedWorldTrees.getPreviousValueIndex(
109
108
  MerkleTreeId.PUBLIC_DATA_TREE,
@@ -120,7 +119,7 @@ export class TXEOraclePublicContext implements IAvmExecutionOracle {
120
119
  )) as PublicDataTreeLeafPreimage
121
120
  ).leaf.value;
122
121
 
123
- this.logger.debug('AVM storage read', { slot, value });
122
+ this.logger.debug('AVM storage read', { slot, contractAddress, value });
124
123
 
125
124
  return value;
126
125
  }
@@ -133,11 +132,7 @@ export class TXEOraclePublicContext implements IAvmExecutionOracle {
133
132
  const txEffect = this.makeTxEffect();
134
133
  await insertTxEffectIntoWorldTrees(txEffect, this.forkedWorldTrees);
135
134
 
136
- const block = new L2Block(
137
- makeAppendOnlyTreeSnapshot(),
138
- await makeTXEBlockHeader(this.forkedWorldTrees, this.globalVariables),
139
- new Body([txEffect]),
140
- );
135
+ const block = await makeTXEBlock(this.forkedWorldTrees, this.globalVariables, [txEffect]);
141
136
 
142
137
  await this.forkedWorldTrees.close();
143
138