@aztec/simulator 0.87.5 → 0.87.6

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 (129) hide show
  1. package/dest/client.d.ts +5 -3
  2. package/dest/client.d.ts.map +1 -1
  3. package/dest/client.js +4 -2
  4. package/dest/private/acvm/acvm.d.ts +5 -2
  5. package/dest/private/acvm/acvm.d.ts.map +1 -1
  6. package/dest/private/acvm/index.d.ts +0 -1
  7. package/dest/private/acvm/index.d.ts.map +1 -1
  8. package/dest/private/acvm/index.js +0 -1
  9. package/dest/private/{providers/acvm_native.d.ts → acvm_native.d.ts} +4 -4
  10. package/dest/private/acvm_native.d.ts.map +1 -0
  11. package/dest/private/{providers/acvm_wasm.d.ts → acvm_wasm.d.ts} +4 -4
  12. package/dest/private/acvm_wasm.d.ts.map +1 -0
  13. package/dest/private/{providers/acvm_wasm.js → acvm_wasm.js} +2 -2
  14. package/dest/private/{providers/acvm_wasm_with_blobs.d.ts → acvm_wasm_with_blobs.d.ts} +5 -5
  15. package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -0
  16. package/dest/private/{providers/acvm_wasm_with_blobs.js → acvm_wasm_with_blobs.js} +2 -2
  17. package/dest/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.d.ts +41 -21
  18. package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -0
  19. package/dest/private/circuit_recording/circuit_recorder.js +209 -0
  20. package/dest/private/circuit_recording/file_circuit_recorder.d.ts +31 -0
  21. package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -0
  22. package/dest/private/circuit_recording/file_circuit_recorder.js +135 -0
  23. package/dest/private/circuit_recording/memory_circuit_recorder.d.ts +5 -0
  24. package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -0
  25. package/dest/private/circuit_recording/memory_circuit_recorder.js +9 -0
  26. package/dest/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.d.ts → circuit_recording/simulator_recorder_wrapper.d.ts} +9 -7
  27. package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -0
  28. package/dest/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.js → circuit_recording/simulator_recorder_wrapper.js} +18 -13
  29. package/dest/private/{providers/simulation_provider.d.ts → circuit_simulator.d.ts} +4 -4
  30. package/dest/private/circuit_simulator.d.ts.map +1 -0
  31. package/dest/private/{providers/simulation_provider.js → circuit_simulator.js} +1 -1
  32. package/dest/private/factory.d.ts +12 -0
  33. package/dest/private/factory.d.ts.map +1 -0
  34. package/dest/private/{providers/factory.js → factory.js} +2 -2
  35. package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts +1 -0
  36. package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +1 -1
  37. package/dest/public/avm/fixtures/base_avm_simulation_tester.js +6 -0
  38. package/dest/public/public_tx_simulator/apps_tests/amm_test.d.ts.map +1 -1
  39. package/dest/public/public_tx_simulator/apps_tests/amm_test.js +27 -55
  40. package/dest/server.d.ts +6 -3
  41. package/dest/server.d.ts.map +1 -1
  42. package/dest/server.js +5 -2
  43. package/dest/testing.d.ts +1 -1
  44. package/dest/testing.d.ts.map +1 -1
  45. package/dest/testing.js +1 -1
  46. package/package.json +15 -15
  47. package/src/client.ts +5 -3
  48. package/src/private/acvm/acvm.ts +5 -3
  49. package/src/private/acvm/index.ts +0 -1
  50. package/src/private/{providers/acvm_native.ts → acvm_native.ts} +4 -4
  51. package/src/private/{providers/acvm_wasm.ts → acvm_wasm.ts} +4 -4
  52. package/src/private/{providers/acvm_wasm_with_blobs.ts → acvm_wasm_with_blobs.ts} +5 -5
  53. package/src/private/circuit_recording/circuit_recorder.ts +260 -0
  54. package/src/private/circuit_recording/file_circuit_recorder.ts +158 -0
  55. package/src/private/circuit_recording/memory_circuit_recorder.ts +11 -0
  56. package/src/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.ts → circuit_recording/simulator_recorder_wrapper.ts} +26 -18
  57. package/src/private/{providers/simulation_provider.ts → circuit_simulator.ts} +3 -3
  58. package/src/private/{providers/factory.ts → factory.ts} +6 -6
  59. package/src/public/avm/fixtures/base_avm_simulation_tester.ts +5 -0
  60. package/src/public/public_tx_simulator/apps_tests/amm_test.ts +49 -44
  61. package/src/server.ts +6 -3
  62. package/src/testing.ts +1 -1
  63. package/dest/private/acvm/oracle/index.d.ts +0 -14
  64. package/dest/private/acvm/oracle/index.d.ts.map +0 -1
  65. package/dest/private/acvm/oracle/index.js +0 -2
  66. package/dest/private/acvm/oracle/oracle.d.ts +0 -52
  67. package/dest/private/acvm/oracle/oracle.d.ts.map +0 -1
  68. package/dest/private/acvm/oracle/oracle.js +0 -312
  69. package/dest/private/acvm/oracle/typed_oracle.d.ts +0 -83
  70. package/dest/private/acvm/oracle/typed_oracle.d.ts.map +0 -1
  71. package/dest/private/acvm/oracle/typed_oracle.js +0 -138
  72. package/dest/private/execution_data_provider.d.ts +0 -301
  73. package/dest/private/execution_data_provider.d.ts.map +0 -1
  74. package/dest/private/execution_data_provider.js +0 -14
  75. package/dest/private/execution_note_cache.d.ts +0 -93
  76. package/dest/private/execution_note_cache.d.ts.map +0 -1
  77. package/dest/private/execution_note_cache.js +0 -180
  78. package/dest/private/hashed_values_cache.d.ts +0 -28
  79. package/dest/private/hashed_values_cache.d.ts.map +0 -1
  80. package/dest/private/hashed_values_cache.js +0 -36
  81. package/dest/private/index.d.ts +0 -16
  82. package/dest/private/index.d.ts.map +0 -1
  83. package/dest/private/index.js +0 -15
  84. package/dest/private/message_load_oracle_inputs.d.ts +0 -19
  85. package/dest/private/message_load_oracle_inputs.d.ts.map +0 -1
  86. package/dest/private/message_load_oracle_inputs.js +0 -24
  87. package/dest/private/pick_notes.d.ts +0 -85
  88. package/dest/private/pick_notes.d.ts.map +0 -1
  89. package/dest/private/pick_notes.js +0 -51
  90. package/dest/private/private_execution.d.ts +0 -25
  91. package/dest/private/private_execution.d.ts.map +0 -1
  92. package/dest/private/private_execution.js +0 -95
  93. package/dest/private/private_execution_oracle.d.ts +0 -187
  94. package/dest/private/private_execution_oracle.d.ts.map +0 -1
  95. package/dest/private/private_execution_oracle.js +0 -318
  96. package/dest/private/providers/acvm_native.d.ts.map +0 -1
  97. package/dest/private/providers/acvm_wasm.d.ts.map +0 -1
  98. package/dest/private/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
  99. package/dest/private/providers/circuit_recording/circuit_recorder.d.ts.map +0 -1
  100. package/dest/private/providers/circuit_recording/circuit_recorder.js +0 -246
  101. package/dest/private/providers/circuit_recording/simulation_provider_recorder_wrapper.d.ts.map +0 -1
  102. package/dest/private/providers/factory.d.ts +0 -12
  103. package/dest/private/providers/factory.d.ts.map +0 -1
  104. package/dest/private/providers/simulation_provider.d.ts.map +0 -1
  105. package/dest/private/simulator.d.ts +0 -36
  106. package/dest/private/simulator.d.ts.map +0 -1
  107. package/dest/private/simulator.js +0 -104
  108. package/dest/private/utility_execution_oracle.d.ts +0 -163
  109. package/dest/private/utility_execution_oracle.d.ts.map +0 -1
  110. package/dest/private/utility_execution_oracle.js +0 -257
  111. package/dest/test/utils.d.ts +0 -13
  112. package/dest/test/utils.d.ts.map +0 -1
  113. package/dest/test/utils.js +0 -22
  114. package/src/private/acvm/oracle/index.ts +0 -16
  115. package/src/private/acvm/oracle/oracle.ts +0 -523
  116. package/src/private/acvm/oracle/typed_oracle.ts +0 -273
  117. package/src/private/execution_data_provider.ts +0 -388
  118. package/src/private/execution_note_cache.ts +0 -217
  119. package/src/private/hashed_values_cache.ts +0 -47
  120. package/src/private/index.ts +0 -19
  121. package/src/private/message_load_oracle_inputs.ts +0 -23
  122. package/src/private/pick_notes.ts +0 -141
  123. package/src/private/private_execution.ts +0 -159
  124. package/src/private/private_execution_oracle.ts +0 -508
  125. package/src/private/providers/circuit_recording/circuit_recorder.ts +0 -283
  126. package/src/private/simulator.ts +0 -170
  127. package/src/private/utility_execution_oracle.ts +0 -384
  128. package/src/test/utils.ts +0 -36
  129. /package/dest/private/{providers/acvm_native.js → acvm_native.js} +0 -0
@@ -1,83 +0,0 @@
1
- import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
2
- import { Fr, Point } from '@aztec/foundation/fields';
3
- import type { EventSelector, FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
4
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
6
- import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
7
- import type { ContractClassLog, IndexedTaggingSecret, LogWithTxData } from '@aztec/stdlib/logs';
8
- import type { Note, NoteStatus } from '@aztec/stdlib/note';
9
- import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
10
- import type { BlockHeader, TxHash } from '@aztec/stdlib/tx';
11
- import type { MessageLoadOracleInputs } from '../../message_load_oracle_inputs.js';
12
- /**
13
- * Information about a note needed during execution.
14
- */
15
- export interface NoteData {
16
- /** The note. */
17
- note: Note;
18
- /** The contract address of the note. */
19
- contractAddress: AztecAddress;
20
- /** The storage slot of the note. */
21
- storageSlot: Fr;
22
- /** The nonce of the note. */
23
- nonce: Fr;
24
- /** A hash of the note. */
25
- noteHash: Fr;
26
- /** The corresponding nullifier of the note. Undefined for pending notes. */
27
- siloedNullifier?: Fr;
28
- /** The note's leaf index in the note hash tree. Undefined for pending notes. */
29
- index?: bigint;
30
- }
31
- /**
32
- * Oracle with typed parameters and typed return values.
33
- * Methods that require read and/or write will have to be implemented based on the context (public, private, or view)
34
- * and are unavailable by default.
35
- */
36
- export declare abstract class TypedOracle {
37
- getRandomField(): Fr;
38
- storeInExecutionCache(_values: Fr[], _hash: Fr): void;
39
- loadFromExecutionCache(_hash: Fr): Promise<Fr[]>;
40
- getBlockNumber(): Promise<number>;
41
- getContractAddress(): Promise<AztecAddress>;
42
- getChainId(): Promise<Fr>;
43
- getVersion(): Promise<Fr>;
44
- getKeyValidationRequest(_pkMHash: Fr): Promise<KeyValidationRequest>;
45
- getContractInstance(_address: AztecAddress): Promise<ContractInstance>;
46
- getMembershipWitness(_blockNumber: number, _treeId: MerkleTreeId, _leafValue: Fr): Promise<Fr[] | undefined>;
47
- getNullifierMembershipWitness(_blockNumber: number, _nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
48
- getPublicDataWitness(_blockNumber: number, _leafSlot: Fr): Promise<PublicDataWitness | undefined>;
49
- getLowNullifierMembershipWitness(_blockNumber: number, _nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
50
- getBlockHeader(_blockNumber: number): Promise<BlockHeader | undefined>;
51
- getCompleteAddress(_account: AztecAddress): Promise<CompleteAddress>;
52
- getAuthWitness(_messageHash: Fr): Promise<Fr[] | undefined>;
53
- getNotes(_storageSlot: Fr, _numSelects: number, _selectByIndexes: number[], _selectByOffsets: number[], _selectByLengths: number[], _selectValues: Fr[], _selectComparators: number[], _sortByIndexes: number[], _sortByOffsets: number[], _sortByLengths: number[], _sortOrder: number[], _limit: number, _offset: number, _status: NoteStatus): Promise<NoteData[]>;
54
- notifyCreatedNote(_storageSlot: Fr, _noteTypeId: NoteSelector, _note: Fr[], _noteHash: Fr, _counter: number): void;
55
- notifyNullifiedNote(_innerNullifier: Fr, _noteHash: Fr, _counter: number): Promise<void>;
56
- notifyCreatedNullifier(_innerNullifier: Fr): Promise<void>;
57
- checkNullifierExists(_innerNullifier: Fr): Promise<boolean>;
58
- getL1ToL2MembershipWitness(_contractAddress: AztecAddress, _messageHash: Fr, _secret: Fr): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>>;
59
- storageRead(_contractAddress: AztecAddress, _startStorageSlot: Fr, _blockNumber: number, _numberOfElements: number): Promise<Fr[]>;
60
- storageWrite(_startStorageSlot: Fr, _values: Fr[]): Promise<Fr[]>;
61
- notifyCreatedContractClassLog(_log: ContractClassLog, _counter: number): void;
62
- callPrivateFunction(_targetContractAddress: AztecAddress, _functionSelector: FunctionSelector, _argsHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<{
63
- endSideEffectCounter: Fr;
64
- returnsHash: Fr;
65
- }>;
66
- notifyEnqueuedPublicFunctionCall(_targetContractAddress: AztecAddress, _calldataHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<void>;
67
- notifySetPublicTeardownFunctionCall(_targetContractAddress: AztecAddress, _calldataHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<void>;
68
- notifySetMinRevertibleSideEffectCounter(_minRevertibleSideEffectCounter: number): Promise<void>;
69
- debugLog(_message: string, _fields: Fr[]): void;
70
- getIndexedTaggingSecretAsSender(_sender: AztecAddress, _recipient: AztecAddress): Promise<IndexedTaggingSecret>;
71
- incrementAppTaggingSecretIndexAsSender(_sender: AztecAddress, _recipient: AztecAddress): Promise<void>;
72
- syncPrivateState(_pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
73
- deliverNote(_contractAddress: AztecAddress, _storageSlot: Fr, _nonce: Fr, _content: Fr[], _noteHash: Fr, _nullifier: Fr, _txHash: TxHash, _recipient: AztecAddress): Promise<void>;
74
- getLogByTag(_tag: Fr): Promise<LogWithTxData | null>;
75
- storeCapsule(_contractAddress: AztecAddress, _key: Fr, _capsule: Fr[]): Promise<void>;
76
- loadCapsule(_contractAddress: AztecAddress, _key: Fr): Promise<Fr[] | null>;
77
- deleteCapsule(_contractAddress: AztecAddress, _key: Fr): Promise<void>;
78
- copyCapsule(_contractAddress: AztecAddress, _srcKey: Fr, _dstKey: Fr, _numEntries: number): Promise<void>;
79
- aes128Decrypt(_ciphertext: Buffer, _iv: Buffer, _symKey: Buffer): Promise<Buffer>;
80
- getSharedSecret(_address: AztecAddress, _ephPk: Point): Promise<Point>;
81
- storePrivateEventLog(_contractAddress: AztecAddress, _recipient: AztecAddress, _eventSelector: EventSelector, _logContent: Fr[], _txHash: TxHash, _logIndexInTx: number, _txIndexInBlock: number): Promise<void>;
82
- }
83
- //# sourceMappingURL=typed_oracle.d.ts.map
@@ -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U,EAAE,EAAE,EACd,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,YAAY,GACvB,OAAO,CAAC,IAAI,CAAC;IAIhB,WAAW,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAIpD,YAAY,CAAC,gBAAgB,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrF,WAAW,CAAC,gBAAgB,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAI3E,aAAa,CAAC,gBAAgB,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE,WAAW,CAAC,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzG,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIjF,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAItE,oBAAoB,CAClB,gBAAgB,EAAE,YAAY,EAC9B,UAAU,EAAE,YAAY,EACxB,cAAc,EAAE,aAAa,EAC7B,WAAW,EAAE,EAAE,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;CAGjB"}
@@ -1,138 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- class OracleMethodNotAvailableError extends Error {
3
- constructor(methodName){
4
- super(`Oracle method ${methodName} is not available.`);
5
- }
6
- }
7
- /**
8
- * Oracle with typed parameters and typed return values.
9
- * Methods that require read and/or write will have to be implemented based on the context (public, private, or view)
10
- * and are unavailable by default.
11
- */ export class TypedOracle {
12
- getRandomField() {
13
- return Fr.random();
14
- }
15
- storeInExecutionCache(_values, _hash) {
16
- throw new OracleMethodNotAvailableError('storeInExecutionCache');
17
- }
18
- loadFromExecutionCache(_hash) {
19
- return Promise.reject(new OracleMethodNotAvailableError('loadFromExecutionCache'));
20
- }
21
- getBlockNumber() {
22
- return Promise.reject(new OracleMethodNotAvailableError('getBlockNumber'));
23
- }
24
- getContractAddress() {
25
- return Promise.reject(new OracleMethodNotAvailableError('getContractAddress'));
26
- }
27
- getChainId() {
28
- return Promise.reject(new OracleMethodNotAvailableError('getChainId'));
29
- }
30
- getVersion() {
31
- return Promise.reject(new OracleMethodNotAvailableError('getVersion'));
32
- }
33
- getKeyValidationRequest(_pkMHash) {
34
- return Promise.reject(new OracleMethodNotAvailableError('getKeyValidationRequest'));
35
- }
36
- getContractInstance(_address) {
37
- return Promise.reject(new OracleMethodNotAvailableError('getContractInstance'));
38
- }
39
- getMembershipWitness(_blockNumber, _treeId, _leafValue) {
40
- return Promise.reject(new OracleMethodNotAvailableError('getMembershipWitness'));
41
- }
42
- getNullifierMembershipWitness(_blockNumber, _nullifier) {
43
- return Promise.reject(new OracleMethodNotAvailableError('getNullifierMembershipWitness'));
44
- }
45
- getPublicDataWitness(_blockNumber, _leafSlot) {
46
- return Promise.reject(new OracleMethodNotAvailableError('getPublicDataWitness'));
47
- }
48
- getLowNullifierMembershipWitness(_blockNumber, _nullifier) {
49
- return Promise.reject(new OracleMethodNotAvailableError('getLowNullifierMembershipWitness'));
50
- }
51
- getBlockHeader(_blockNumber) {
52
- return Promise.reject(new OracleMethodNotAvailableError('getBlockHeader'));
53
- }
54
- getCompleteAddress(_account) {
55
- return Promise.reject(new OracleMethodNotAvailableError('getCompleteAddress'));
56
- }
57
- getAuthWitness(_messageHash) {
58
- return Promise.reject(new OracleMethodNotAvailableError('getAuthWitness'));
59
- }
60
- getNotes(_storageSlot, _numSelects, _selectByIndexes, _selectByOffsets, _selectByLengths, _selectValues, _selectComparators, _sortByIndexes, _sortByOffsets, _sortByLengths, _sortOrder, _limit, _offset, _status) {
61
- return Promise.reject(new OracleMethodNotAvailableError('getNotes'));
62
- }
63
- notifyCreatedNote(_storageSlot, _noteTypeId, _note, _noteHash, _counter) {
64
- throw new OracleMethodNotAvailableError('notifyCreatedNote');
65
- }
66
- notifyNullifiedNote(_innerNullifier, _noteHash, _counter) {
67
- return Promise.reject(new OracleMethodNotAvailableError('notifyNullifiedNote'));
68
- }
69
- notifyCreatedNullifier(_innerNullifier) {
70
- return Promise.reject(new OracleMethodNotAvailableError('notifyCreatedNullifier'));
71
- }
72
- checkNullifierExists(_innerNullifier) {
73
- return Promise.reject(new OracleMethodNotAvailableError('checkNullifierExists'));
74
- }
75
- getL1ToL2MembershipWitness(_contractAddress, _messageHash, _secret) {
76
- return Promise.reject(new OracleMethodNotAvailableError('getL1ToL2MembershipWitness'));
77
- }
78
- storageRead(_contractAddress, _startStorageSlot, _blockNumber, _numberOfElements) {
79
- return Promise.reject(new OracleMethodNotAvailableError('storageRead'));
80
- }
81
- storageWrite(_startStorageSlot, _values) {
82
- return Promise.reject(new OracleMethodNotAvailableError('storageWrite'));
83
- }
84
- notifyCreatedContractClassLog(_log, _counter) {
85
- throw new OracleMethodNotAvailableError('notifyCreatedContractClassLog');
86
- }
87
- callPrivateFunction(_targetContractAddress, _functionSelector, _argsHash, _sideEffectCounter, _isStaticCall) {
88
- return Promise.reject(new OracleMethodNotAvailableError('callPrivateFunction'));
89
- }
90
- notifyEnqueuedPublicFunctionCall(_targetContractAddress, _calldataHash, _sideEffectCounter, _isStaticCall) {
91
- return Promise.reject(new OracleMethodNotAvailableError('notifyEnqueuedPublicFunctionCall'));
92
- }
93
- notifySetPublicTeardownFunctionCall(_targetContractAddress, _calldataHash, _sideEffectCounter, _isStaticCall) {
94
- return Promise.reject(new OracleMethodNotAvailableError('notifySetPublicTeardownFunctionCall'));
95
- }
96
- notifySetMinRevertibleSideEffectCounter(_minRevertibleSideEffectCounter) {
97
- throw new OracleMethodNotAvailableError('notifySetMinRevertibleSideEffectCounter');
98
- }
99
- debugLog(_message, _fields) {
100
- throw new OracleMethodNotAvailableError('debugLog');
101
- }
102
- getIndexedTaggingSecretAsSender(_sender, _recipient) {
103
- return Promise.reject(new OracleMethodNotAvailableError('getIndexedTaggingSecretAsSender'));
104
- }
105
- incrementAppTaggingSecretIndexAsSender(_sender, _recipient) {
106
- return Promise.reject(new OracleMethodNotAvailableError('incrementAppTaggingSecretIndexAsSender'));
107
- }
108
- syncPrivateState(_pendingTaggedLogArrayBaseSlot) {
109
- return Promise.reject(new OracleMethodNotAvailableError('syncPrivateState'));
110
- }
111
- deliverNote(_contractAddress, _storageSlot, _nonce, _content, _noteHash, _nullifier, _txHash, _recipient) {
112
- return Promise.reject(new OracleMethodNotAvailableError('deliverNote'));
113
- }
114
- getLogByTag(_tag) {
115
- throw new OracleMethodNotAvailableError('getLogByTag');
116
- }
117
- storeCapsule(_contractAddress, _key, _capsule) {
118
- return Promise.reject(new OracleMethodNotAvailableError('storeCapsule'));
119
- }
120
- loadCapsule(_contractAddress, _key) {
121
- return Promise.reject(new OracleMethodNotAvailableError('loadCapsule'));
122
- }
123
- deleteCapsule(_contractAddress, _key) {
124
- return Promise.reject(new OracleMethodNotAvailableError('deleteCapsule'));
125
- }
126
- copyCapsule(_contractAddress, _srcKey, _dstKey, _numEntries) {
127
- return Promise.reject(new OracleMethodNotAvailableError('copyCapsule'));
128
- }
129
- aes128Decrypt(_ciphertext, _iv, _symKey) {
130
- return Promise.reject(new OracleMethodNotAvailableError('aes128Decrypt'));
131
- }
132
- getSharedSecret(_address, _ephPk) {
133
- return Promise.reject(new OracleMethodNotAvailableError('getSharedSecret'));
134
- }
135
- storePrivateEventLog(_contractAddress, _recipient, _eventSelector, _logContent, _txHash, _logIndexInTx, _txIndexInBlock) {
136
- return Promise.reject(new OracleMethodNotAvailableError('storePrivateEventLog'));
137
- }
138
- }
@@ -1,301 +0,0 @@
1
- import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
2
- import type { Fr, Point } from '@aztec/foundation/fields';
3
- import type { EventSelector, FunctionArtifact, FunctionArtifactWithContractName, FunctionSelector } from '@aztec/stdlib/abi';
4
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { L2Block } from '@aztec/stdlib/block';
6
- import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
7
- import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
8
- import { IndexedTaggingSecret, LogWithTxData } from '@aztec/stdlib/logs';
9
- import type { NoteStatus } from '@aztec/stdlib/note';
10
- import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
11
- import type { BlockHeader, TxHash } from '@aztec/stdlib/tx';
12
- import type { NoteData } from './acvm/index.js';
13
- import type { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
14
- /**
15
- * Error thrown when a contract is not found in the database.
16
- */
17
- export declare class ContractNotFoundError extends Error {
18
- constructor(contractAddress: string);
19
- }
20
- /**
21
- * Error thrown when a contract class is not found in the database.
22
- */
23
- export declare class ContractClassNotFoundError extends Error {
24
- constructor(contractClassId: string);
25
- }
26
- /**
27
- * The interface for the data layer required to perform private and utility execution.
28
- */
29
- export interface ExecutionDataProvider {
30
- /**
31
- * Returns a contract instance associated with an address, if available.
32
- * @param address - Address.
33
- * @returns A contract instance.
34
- */
35
- getContractInstance(address: AztecAddress): Promise<ContractInstance>;
36
- /**
37
- * Retrieve the complete address associated to a given address.
38
- * @param account - The account address.
39
- * @returns A complete address associated with the input address.
40
- * @throws An error if the account is not registered in the database.
41
- */
42
- getCompleteAddress(account: AztecAddress): Promise<CompleteAddress>;
43
- /**
44
- * Retrieve keys associated with a specific master public key and app address.
45
- * @param pkMHash - The master public key hash.
46
- * @returns A Promise that resolves to nullifier keys.
47
- * @throws If the keys are not registered in the key store.
48
- */
49
- getKeyValidationRequest(pkMHash: Fr, contractAddress: AztecAddress): Promise<KeyValidationRequest>;
50
- /**
51
- * Retrieves a set of notes stored in the database for a given contract address and storage slot.
52
- * The query result is paginated using 'limit' and 'offset' values.
53
- * Returns an object containing an array of note data.
54
- *
55
- * @param contractAddress - The contract address of the notes.
56
- * @param storageSlot - The storage slot of the notes.
57
- * @param status - The status of notes to fetch.
58
- * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
59
- * @returns A Promise that resolves to an array of note data.
60
- */
61
- getNotes(contractAddress: AztecAddress, storageSlot: Fr, status: NoteStatus, scopes?: AztecAddress[]): Promise<NoteData[]>;
62
- /**
63
- * Retrieve the artifact information of a specific function within a contract.
64
- * The function is identified by its selector, which is a unique identifier generated from the function signature.
65
- *
66
- * @param contractAddress - The contract address.
67
- * @param selector - The corresponding function selector.
68
- * @returns A Promise that resolves to a FunctionArtifact object.
69
- */
70
- getFunctionArtifact(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionArtifactWithContractName>;
71
- /**
72
- * Generates a stable function name for debug purposes.
73
- * @param contractAddress - The contract address.
74
- * @param selector - The corresponding function selector.
75
- */
76
- getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
77
- /**
78
- * Retrieves the artifact of a specified function within a given contract.
79
- * The function is identified by its name, which is unique within a contract.
80
- *
81
- * @param contractAddress - The AztecAddress representing the contract containing the function.
82
- * @param functionName - The name of the function.
83
- * @returns The corresponding function's artifact as an object.
84
- */
85
- getFunctionArtifactByName(contractAddress: AztecAddress, functionName: string): Promise<FunctionArtifact | undefined>;
86
- /**
87
- * Gets the index of a nullifier in the nullifier tree.
88
- * @param nullifier - The nullifier.
89
- * @returns - The index of the nullifier. Undefined if it does not exist in the tree.
90
- */
91
- getNullifierIndex(nullifier: Fr): Promise<bigint | undefined>;
92
- /**
93
- * Gets the index of a nullifier in the nullifier tree.
94
- * @param nullifier - The nullifier.
95
- * @returns - The index of the nullifier. Undefined if it does not exist in the tree.
96
- */
97
- getNullifierIndex(nullifier: Fr): Promise<bigint | undefined>;
98
- /**
99
- * Returns a nullifier membership witness for the given nullifier or undefined if not found.
100
- * REFACTOR: Same as getL1ToL2MembershipWitness, can be combined with aztec-node method that does almost the same thing.
101
- * @param nullifier - Nullifier we're looking for.
102
- */
103
- getNullifierMembershipWitnessAtLatestBlock(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
104
- /**
105
- * Fetches a message from the db, given its key.
106
- * @param contractAddress - Address of a contract by which the message was emitted.
107
- * @param messageHash - Hash of the message.
108
- * @param secret - Secret used to compute a nullifier.
109
- * @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
110
- * @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
111
- */
112
- getL1ToL2MembershipWitness(contractAddress: AztecAddress, messageHash: Fr, secret: Fr): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>>;
113
- /**
114
- * @param leafIndex the leaf to look up
115
- * @returns The l1 to l2 leaf message hash or undefined if not found.
116
- */
117
- getL1ToL2MessageHash(leafIndex: bigint): Promise<Fr | undefined>;
118
- /**
119
- * Retrieve the databases view of the Block Header object.
120
- * This structure is fed into the circuits simulator and is used to prove against certain historical roots.
121
- *
122
- * @returns A Promise that resolves to a Header object.
123
- */
124
- getBlockHeader(): Promise<BlockHeader>;
125
- /**
126
- * Fetches the index and sibling path of a leaf at a given block from a given tree.
127
- * @param blockNumber - The block number at which to get the membership witness.
128
- * @param treeId - Id of the tree to get the sibling path from.
129
- * @param leafValue - The leaf value
130
- * @returns The index and sibling path concatenated [index, sibling_path]
131
- */
132
- getMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]>;
133
- /**
134
- * Returns a nullifier membership witness for a given nullifier at a given block.
135
- * @param blockNumber - The block number at which to get the index.
136
- * @param nullifier - Nullifier we try to find witness for.
137
- * @returns The nullifier membership witness (if found).
138
- */
139
- getNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
140
- /**
141
- * Returns a low nullifier membership witness for a given nullifier at a given block.
142
- * @param blockNumber - The block number at which to get the index.
143
- * @param nullifier - Nullifier we try to find the low nullifier witness for.
144
- * @returns The low nullifier membership witness (if found).
145
- * @remarks Low nullifier witness can be used to perform a nullifier non-inclusion proof by leveraging the "linked
146
- * list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
147
- * we are trying to prove non-inclusion for.
148
- */
149
- getLowNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
150
- /**
151
- * Returns a witness for a given slot of the public data tree at a given block.
152
- * @param blockNumber - The block number at which to get the witness.
153
- * @param leafSlot - The slot of the public data in the public data tree.
154
- */
155
- getPublicDataWitness(blockNumber: number, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
156
- /**
157
- * Gets the storage value at the given contract storage slot.
158
- *
159
- * @remarks The storage slot here refers to the slot as it is defined in Noir not the index in the merkle tree.
160
- * Aztec's version of `eth_getStorageAt`.
161
- *
162
- * @param blockNumber - The block number at which to get the data.
163
- * @param contract - Address of the contract to query.
164
- * @param slot - Slot to query.
165
- * @returns Storage value at the given contract slot.
166
- * @throws If the contract is not deployed.
167
- */
168
- getPublicStorageAt(blockNumber: number, contract: AztecAddress, slot: Fr): Promise<Fr>;
169
- /**
170
- * Fetch a block corresponding to the given block number.
171
- * @param blockNumber - The block number of a block to fetch.
172
- * @returns - The block corresponding to the given block number. Undefined if it does not exist.
173
- */
174
- getBlock(blockNumber: number): Promise<L2Block | undefined>;
175
- /**
176
- * Fetches the current block number.
177
- * @returns The block number.
178
- */
179
- getBlockNumber(): Promise<number>;
180
- /**
181
- * Fetches the current chain id.
182
- * @returns The chain id.
183
- */
184
- getChainId(): Promise<number>;
185
- /**
186
- * Fetches the current chain id.
187
- * @returns The chain id.
188
- */
189
- getVersion(): Promise<number>;
190
- /**
191
- * Returns the tagging secret for a given sender and recipient pair. For this to work, the ivsk_m of the sender must be known.
192
- * Includes the next index to be used used for tagging with this secret.
193
- * @param contractAddress - The contract address to silo the secret for
194
- * @param sender - The address sending the note
195
- * @param recipient - The address receiving the note
196
- * @returns A tagging secret that can be used to tag notes.
197
- */
198
- getIndexedTaggingSecretAsSender(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<IndexedTaggingSecret>;
199
- /**
200
- * Increments the tagging secret for a given sender and recipient pair. For this to work, the ivsk_m of the sender must be known.
201
- * @param contractAddress - The contract address to silo the secret for
202
- * @param sender - The address sending the note
203
- * @param recipient - The address receiving the note
204
- */
205
- incrementAppTaggingSecretIndexAsSender(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<void>;
206
- /**
207
- * Synchronizes the logs tagged with scoped addresses and all the senders in the address book. Stores the found logs
208
- * in CapsuleArray ready for a later retrieval in Aztec.nr.
209
- * @param contractAddress - The address of the contract that the logs are tagged for.
210
- * @param pendingTaggedLogArrayBaseSlot - The base slot of the pending tagged log capsule array in which found logs will be stored.
211
- * @param scopes - The scoped addresses to sync logs for. If not provided, all accounts in the address book will be
212
- * synced.
213
- */
214
- syncTaggedLogs(contractAddress: AztecAddress, pendingTaggedLogArrayBaseSlot: Fr, scopes?: AztecAddress[]): Promise<void>;
215
- /**
216
- * Delivers the preimage and metadata of a committed note so that it can be later requested via the `getNotes`
217
- * oracle.
218
- *
219
- * @param contractAddress - The address of the contract that created the note (i.e. the siloing contract)
220
- * @param storageSlot - The storage slot of the note - used for indexing in `getNotes`
221
- * @param nonce - The nonce of the note used by the kernel to compute the unique note hash
222
- * @param content - The note's content: this is the primary item to return in `getNotes`
223
- * @param noteHash - The non-unique non-siloed note hash
224
- * @param nullifier - The inner (non-siloed) note nullifier
225
- * @param txHash - The transaction in which the note was added to the note hash tree
226
- * @param recipient - The account that discovered the note
227
- */
228
- deliverNote(contractAddress: AztecAddress, storageSlot: Fr, nonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: TxHash, recipient: AztecAddress): Promise<void>;
229
- /**
230
- * Gets note hash in the note hash tree at the given leaf index.
231
- * @param leafIndex - the leaf to look up.
232
- * @returns - The note hash at that index. Undefined if leaf index is not found.
233
- */
234
- getNoteHash(leafIndex: bigint): Promise<Fr | undefined>;
235
- /**
236
- * Searches for a log with the corresponding `tag` and returns it along with contextual transaction information.
237
- * Returns null if no such log exists, and throws if more than one exists.
238
- *
239
- * @param tag - The log tag to search for.
240
- */
241
- getLogByTag(tag: Fr): Promise<LogWithTxData | null>;
242
- /**
243
- * Removes all of a contract's notes that have been nullified from the note database.
244
- */
245
- removeNullifiedNotes(contractAddress: AztecAddress): Promise<void>;
246
- /**
247
- * Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `loadCapsule`.
248
- * * If data was already stored at this slot, it is overwritten.
249
- * @param contractAddress - The contract address to scope the data under.
250
- * @param slot - The slot in the database in which to store the value. Slots need not be contiguous.
251
- * @param capsule - An array of field elements representing the capsule.
252
- * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. It works similarly
253
- * to public contract storage in that it's indexed by the contract address and storage slot but instead of the global
254
- * network state it's backed by local PXE db.
255
- */
256
- storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void>;
257
- /**
258
- * Returns data previously stored via `storeCapsule` in the per-contract non-volatile database.
259
- * @param contractAddress - The contract address under which the data is scoped.
260
- * @param slot - The slot in the database to read.
261
- * @returns The stored data or `null` if no data is stored under the slot.
262
- */
263
- loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
264
- /**
265
- * Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
266
- * @param contractAddress - The contract address under which the data is scoped.
267
- * @param slot - The slot in the database to delete.
268
- */
269
- deleteCapsule(contractAddress: AztecAddress, slot: Fr): Promise<void>;
270
- /**
271
- * Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data
272
- * structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`.
273
- * Supports overlapping source and destination regions (which will result in the overlapped source values being
274
- * overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)
275
- *
276
- * @param contractAddress - The contract address under which the data is scoped.
277
- * @param srcSlot - The first slot to copy from.
278
- * @param dstSlot - The first slot to copy to.
279
- * @param numEntries - The number of entries to copy.
280
- */
281
- copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
282
- /**
283
- * Retrieves the shared secret for a given address and ephemeral public key.
284
- * @param address - The address to get the secret for.
285
- * @param ephPk - The ephemeral public key to get the secret for.
286
- * @returns The secret for the given address.
287
- */
288
- getSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
289
- /**
290
- * Stores an event log in the database.
291
- * @param contractAddress - The address of the contract that emitted the log.
292
- * @param recipient - The address of the recipient.
293
- * @param eventSelector - The event selector of the event.
294
- * @param msgContent - The content of the private event message.
295
- * @param txHash - The hash of the transaction that emitted the log.
296
- * @param logIndexInTx - The index of the log within the transaction.
297
- * @param txIndexInBlock - The index of the transaction in which the log was emitted in the block.
298
- */
299
- storePrivateEventLog(contractAddress: AztecAddress, recipient: AztecAddress, eventSelector: EventSelector, msgContent: Fr[], txHash: TxHash, logIndexInTx: number, txIndexInBlock: number): Promise<void>;
300
- }
301
- //# sourceMappingURL=execution_data_provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution_data_provider.d.ts","sourceRoot":"","sources":["../../src/private/execution_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,gCAAgC,EAChC,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B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AAC,CAAC;IAErE;;;;;;;;;OASG;IACH,oBAAoB,CAClB,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,YAAY,EACvB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,EAAE,EAAE,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Error thrown when a contract is not found in the database.
3
- */ export class ContractNotFoundError extends Error {
4
- constructor(contractAddress){
5
- super(`DB has no contract with address ${contractAddress}`);
6
- }
7
- }
8
- /**
9
- * Error thrown when a contract class is not found in the database.
10
- */ export class ContractClassNotFoundError extends Error {
11
- constructor(contractClassId){
12
- super(`DB has no contract class with id ${contractClassId}`);
13
- }
14
- }
@@ -1,93 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
- import type { NoteData } from './acvm/index.js';
4
- interface PendingNote {
5
- note: NoteData;
6
- counter: number;
7
- noteHashForConsumption: Fr;
8
- }
9
- /**
10
- * Data that's accessible by all the function calls in an execution.
11
- */
12
- export declare class ExecutionNoteCache {
13
- #private;
14
- private readonly txRequestHash;
15
- /**
16
- * New notes created in this transaction.
17
- * They are pushed to this array in the same order as they are emitted.
18
- */
19
- private notes;
20
- /**
21
- * This mapping maps from a contract address to the notes in the contract.
22
- */
23
- private noteMap;
24
- /**
25
- * This maps from a contract address to the nullifiers emitted from the contract.
26
- * The note which is nullified might be new or not (i.e., was generated in a previous transaction).
27
- * Note that their value (bigint representation) is used because Frs cannot be looked up in Sets.
28
- */
29
- private nullifierMap;
30
- /**
31
- * All nullifiers emitted in this transaction.
32
- */
33
- private allNullifiers;
34
- private minRevertibleSideEffectCounter;
35
- private inRevertiblePhase;
36
- /**
37
- * We don't need to use the tx request hash for nonces if another non revertible nullifier is emitted.
38
- * In that case we disable injecting the tx request hash as a nullifier.
39
- */
40
- private usedTxRequestHashForNonces;
41
- constructor(txRequestHash: Fr);
42
- /**
43
- * Enters the revertible phase of the transaction.
44
- * @param minRevertibleSideEffectCounter - The counter at which the transaction enters the revertible phase.
45
- */
46
- setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
47
- finish(): {
48
- usedTxRequestHashForNonces: boolean;
49
- };
50
- /**
51
- * Add a new note to cache.
52
- * @param note - New note created during execution.
53
- */
54
- addNewNote(note: NoteData, counter: number): void;
55
- /**
56
- * Add a nullifier to cache. It could be for a db note or a new note created during execution.
57
- * @param contractAddress - Contract address of the note.
58
- * @param innerNullifier - Inner nullifier of the note.
59
- * @param noteHash - A hash of the note. If this value equals 0, it means the note being nullified is from a previous
60
- * transaction (and thus not a new note).
61
- */
62
- nullifyNote(contractAddress: AztecAddress, innerNullifier: Fr, noteHash: Fr): Promise<number | undefined>;
63
- /**
64
- * Adds a nullifier to the cache. Note cache needs to track all nullifiers to decide which nullifier to use for note siloing.
65
- * @param contractAddress - Contract address that emitted the nullifier.
66
- * @param innerNullifier
67
- */
68
- nullifierCreated(contractAddress: AztecAddress, innerNullifier: Fr): Promise<void>;
69
- /**
70
- * Return notes created up to current point in execution.
71
- * If a nullifier for a note in this list is emitted, the note will be deleted.
72
- * @param contractAddress - Contract address of the notes.
73
- * @param storageSlot - Storage slot of the notes.
74
- **/
75
- getNotes(contractAddress: AztecAddress, storageSlot: Fr): NoteData[];
76
- /**
77
- * Check if a note exists in the newNotes array.
78
- * @param contractAddress - Contract address of the note.
79
- * @param storageSlot - Storage slot of the note.
80
- * @param noteHash - A hash of the note.
81
- **/
82
- checkNoteExists(contractAddress: AztecAddress, noteHash: Fr): boolean;
83
- /**
84
- * Return all nullifiers emitted from a contract.
85
- * @param contractAddress - Address of the contract.
86
- */
87
- getNullifiers(contractAddress: AztecAddress): Set<bigint>;
88
- getAllNotes(): PendingNote[];
89
- getAllNullifiers(): Fr[];
90
- recordNullifier(contractAddress: AztecAddress, siloedNullifier: Fr): void;
91
- }
92
- export {};
93
- //# sourceMappingURL=execution_note_cache.d.ts.map