@aztec/simulator 0.77.0-testnet-ignition.26 → 0.77.0-testnet-ignition.27

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 (198) hide show
  1. package/dest/private/index.js +2 -2
  2. package/dest/private/private_execution.js +18 -16
  3. package/dest/private/{client_execution_context.js → private_execution_oracle.js} +24 -19
  4. package/dest/private/simulator.js +12 -14
  5. package/dest/private/{view_data_oracle.js → unconstrained_execution_oracle.js} +32 -34
  6. package/dest/public/public_tx_simulator/public_tx_simulator.js +21 -12
  7. package/package.json +14 -14
  8. package/src/private/{db_oracle.ts → execution_data_provider.ts} +28 -2
  9. package/src/private/index.ts +6 -2
  10. package/src/private/private_execution.ts +21 -20
  11. package/src/private/{client_execution_context.ts → private_execution_oracle.ts} +41 -26
  12. package/src/private/simulator.ts +20 -24
  13. package/src/private/unconstrained_execution.ts +2 -2
  14. package/src/private/{view_data_oracle.ts → unconstrained_execution_oracle.ts} +42 -35
  15. package/src/public/public_tx_simulator/public_tx_simulator.ts +29 -16
  16. package/dest/client.d.ts +0 -5
  17. package/dest/client.d.ts.map +0 -1
  18. package/dest/common/db_interfaces.d.ts +0 -80
  19. package/dest/common/db_interfaces.d.ts.map +0 -1
  20. package/dest/common/debug_fn_name.d.ts +0 -5
  21. package/dest/common/debug_fn_name.d.ts.map +0 -1
  22. package/dest/common/errors.d.ts +0 -54
  23. package/dest/common/errors.d.ts.map +0 -1
  24. package/dest/common/index.d.ts +0 -4
  25. package/dest/common/index.d.ts.map +0 -1
  26. package/dest/common/message_load_oracle_inputs.d.ts +0 -15
  27. package/dest/common/message_load_oracle_inputs.d.ts.map +0 -1
  28. package/dest/common/stats/index.d.ts +0 -2
  29. package/dest/common/stats/index.d.ts.map +0 -1
  30. package/dest/common/stats/stats.d.ts +0 -4
  31. package/dest/common/stats/stats.d.ts.map +0 -1
  32. package/dest/private/acvm/acvm.d.ts +0 -35
  33. package/dest/private/acvm/acvm.d.ts.map +0 -1
  34. package/dest/private/acvm/acvm_types.d.ts +0 -10
  35. package/dest/private/acvm/acvm_types.d.ts.map +0 -1
  36. package/dest/private/acvm/deserialize.d.ts +0 -36
  37. package/dest/private/acvm/deserialize.d.ts.map +0 -1
  38. package/dest/private/acvm/index.d.ts +0 -6
  39. package/dest/private/acvm/index.d.ts.map +0 -1
  40. package/dest/private/acvm/oracle/index.d.ts +0 -14
  41. package/dest/private/acvm/oracle/index.d.ts.map +0 -1
  42. package/dest/private/acvm/oracle/oracle.d.ts +0 -49
  43. package/dest/private/acvm/oracle/oracle.d.ts.map +0 -1
  44. package/dest/private/acvm/oracle/typed_oracle.d.ts +0 -83
  45. package/dest/private/acvm/oracle/typed_oracle.d.ts.map +0 -1
  46. package/dest/private/acvm/serialize.d.ts +0 -24
  47. package/dest/private/acvm/serialize.d.ts.map +0 -1
  48. package/dest/private/client_execution_context.d.ts +0 -217
  49. package/dest/private/client_execution_context.d.ts.map +0 -1
  50. package/dest/private/db_oracle.d.ts +0 -238
  51. package/dest/private/db_oracle.d.ts.map +0 -1
  52. package/dest/private/execution_note_cache.d.ts +0 -93
  53. package/dest/private/execution_note_cache.d.ts.map +0 -1
  54. package/dest/private/hashed_values_cache.d.ts +0 -28
  55. package/dest/private/hashed_values_cache.d.ts.map +0 -1
  56. package/dest/private/index.d.ts +0 -13
  57. package/dest/private/index.d.ts.map +0 -1
  58. package/dest/private/pick_notes.d.ts +0 -85
  59. package/dest/private/pick_notes.d.ts.map +0 -1
  60. package/dest/private/private_execution.d.ts +0 -24
  61. package/dest/private/private_execution.d.ts.map +0 -1
  62. package/dest/private/providers/acvm_native.d.ts +0 -40
  63. package/dest/private/providers/acvm_native.d.ts.map +0 -1
  64. package/dest/private/providers/acvm_wasm.d.ts +0 -15
  65. package/dest/private/providers/acvm_wasm.d.ts.map +0 -1
  66. package/dest/private/providers/acvm_wasm_with_blobs.d.ts +0 -19
  67. package/dest/private/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
  68. package/dest/private/providers/factory.d.ts +0 -12
  69. package/dest/private/providers/factory.d.ts.map +0 -1
  70. package/dest/private/providers/simulation_provider.d.ts +0 -19
  71. package/dest/private/providers/simulation_provider.d.ts.map +0 -1
  72. package/dest/private/simulator.d.ts +0 -36
  73. package/dest/private/simulator.d.ts.map +0 -1
  74. package/dest/private/unconstrained_execution.d.ts +0 -10
  75. package/dest/private/unconstrained_execution.d.ts.map +0 -1
  76. package/dest/private/view_data_oracle.d.ts +0 -164
  77. package/dest/private/view_data_oracle.d.ts.map +0 -1
  78. package/dest/public/avm/avm_context.d.ts +0 -41
  79. package/dest/public/avm/avm_context.d.ts.map +0 -1
  80. package/dest/public/avm/avm_contract_call_result.d.ts +0 -30
  81. package/dest/public/avm/avm_contract_call_result.d.ts.map +0 -1
  82. package/dest/public/avm/avm_execution_environment.d.ts +0 -21
  83. package/dest/public/avm/avm_execution_environment.d.ts.map +0 -1
  84. package/dest/public/avm/avm_gas.d.ts +0 -60
  85. package/dest/public/avm/avm_gas.d.ts.map +0 -1
  86. package/dest/public/avm/avm_machine_state.d.ts +0 -93
  87. package/dest/public/avm/avm_machine_state.d.ts.map +0 -1
  88. package/dest/public/avm/avm_memory_types.d.ts +0 -264
  89. package/dest/public/avm/avm_memory_types.d.ts.map +0 -1
  90. package/dest/public/avm/avm_simulator.d.ts +0 -40
  91. package/dest/public/avm/avm_simulator.d.ts.map +0 -1
  92. package/dest/public/avm/bytecode_utils.d.ts +0 -5
  93. package/dest/public/avm/bytecode_utils.d.ts.map +0 -1
  94. package/dest/public/avm/errors.d.ts +0 -122
  95. package/dest/public/avm/errors.d.ts.map +0 -1
  96. package/dest/public/avm/fixtures/avm_simulation_tester.d.ts +0 -21
  97. package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +0 -1
  98. package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts +0 -36
  99. package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +0 -1
  100. package/dest/public/avm/fixtures/index.d.ts +0 -84
  101. package/dest/public/avm/fixtures/index.d.ts.map +0 -1
  102. package/dest/public/avm/fixtures/simple_contract_data_source.d.ts +0 -35
  103. package/dest/public/avm/fixtures/simple_contract_data_source.d.ts.map +0 -1
  104. package/dest/public/avm/index.d.ts +0 -4
  105. package/dest/public/avm/index.d.ts.map +0 -1
  106. package/dest/public/avm/journal/index.d.ts +0 -2
  107. package/dest/public/avm/journal/index.d.ts.map +0 -1
  108. package/dest/public/avm/journal/journal.d.ts +0 -209
  109. package/dest/public/avm/journal/journal.d.ts.map +0 -1
  110. package/dest/public/avm/journal/nullifiers.d.ts +0 -64
  111. package/dest/public/avm/journal/nullifiers.d.ts.map +0 -1
  112. package/dest/public/avm/journal/public_storage.d.ts +0 -66
  113. package/dest/public/avm/journal/public_storage.d.ts.map +0 -1
  114. package/dest/public/avm/opcodes/accrued_substate.d.ts +0 -75
  115. package/dest/public/avm/opcodes/accrued_substate.d.ts.map +0 -1
  116. package/dest/public/avm/opcodes/addressing_mode.d.ts +0 -27
  117. package/dest/public/avm/opcodes/addressing_mode.d.ts.map +0 -1
  118. package/dest/public/avm/opcodes/arithmetic.d.ts +0 -37
  119. package/dest/public/avm/opcodes/arithmetic.d.ts.map +0 -1
  120. package/dest/public/avm/opcodes/bitwise.d.ts +0 -50
  121. package/dest/public/avm/opcodes/bitwise.d.ts.map +0 -1
  122. package/dest/public/avm/opcodes/comparators.d.ts +0 -25
  123. package/dest/public/avm/opcodes/comparators.d.ts.map +0 -1
  124. package/dest/public/avm/opcodes/contract.d.ts +0 -21
  125. package/dest/public/avm/opcodes/contract.d.ts.map +0 -1
  126. package/dest/public/avm/opcodes/control_flow.d.ts +0 -41
  127. package/dest/public/avm/opcodes/control_flow.d.ts.map +0 -1
  128. package/dest/public/avm/opcodes/conversion.d.ts +0 -17
  129. package/dest/public/avm/opcodes/conversion.d.ts.map +0 -1
  130. package/dest/public/avm/opcodes/ec_add.d.ts +0 -19
  131. package/dest/public/avm/opcodes/ec_add.d.ts.map +0 -1
  132. package/dest/public/avm/opcodes/environment_getters.d.ts +0 -28
  133. package/dest/public/avm/opcodes/environment_getters.d.ts.map +0 -1
  134. package/dest/public/avm/opcodes/external_calls.d.ts +0 -50
  135. package/dest/public/avm/opcodes/external_calls.d.ts.map +0 -1
  136. package/dest/public/avm/opcodes/hashing.d.ts +0 -36
  137. package/dest/public/avm/opcodes/hashing.d.ts.map +0 -1
  138. package/dest/public/avm/opcodes/index.d.ts +0 -16
  139. package/dest/public/avm/opcodes/index.d.ts.map +0 -1
  140. package/dest/public/avm/opcodes/instruction.d.ts +0 -70
  141. package/dest/public/avm/opcodes/instruction.d.ts.map +0 -1
  142. package/dest/public/avm/opcodes/instruction_impl.d.ts +0 -19
  143. package/dest/public/avm/opcodes/instruction_impl.d.ts.map +0 -1
  144. package/dest/public/avm/opcodes/memory.d.ts +0 -74
  145. package/dest/public/avm/opcodes/memory.d.ts.map +0 -1
  146. package/dest/public/avm/opcodes/misc.d.ts +0 -17
  147. package/dest/public/avm/opcodes/misc.d.ts.map +0 -1
  148. package/dest/public/avm/opcodes/storage.d.ts +0 -24
  149. package/dest/public/avm/opcodes/storage.d.ts.map +0 -1
  150. package/dest/public/avm/serialization/buffer_cursor.d.ts +0 -28
  151. package/dest/public/avm/serialization/buffer_cursor.d.ts.map +0 -1
  152. package/dest/public/avm/serialization/bytecode_serialization.d.ts +0 -21
  153. package/dest/public/avm/serialization/bytecode_serialization.d.ts.map +0 -1
  154. package/dest/public/avm/serialization/instruction_serialization.d.ts +0 -104
  155. package/dest/public/avm/serialization/instruction_serialization.d.ts.map +0 -1
  156. package/dest/public/avm/test_utils.d.ts +0 -18
  157. package/dest/public/avm/test_utils.d.ts.map +0 -1
  158. package/dest/public/bytecode_errors.d.ts +0 -4
  159. package/dest/public/bytecode_errors.d.ts.map +0 -1
  160. package/dest/public/execution.d.ts +0 -108
  161. package/dest/public/execution.d.ts.map +0 -1
  162. package/dest/public/executor_metrics.d.ts +0 -13
  163. package/dest/public/executor_metrics.d.ts.map +0 -1
  164. package/dest/public/fixtures/index.d.ts +0 -3
  165. package/dest/public/fixtures/index.d.ts.map +0 -1
  166. package/dest/public/fixtures/public_tx_simulation_tester.d.ts +0 -32
  167. package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +0 -1
  168. package/dest/public/fixtures/utils.d.ts +0 -13
  169. package/dest/public/fixtures/utils.d.ts.map +0 -1
  170. package/dest/public/index.d.ts +0 -10
  171. package/dest/public/index.d.ts.map +0 -1
  172. package/dest/public/public_db_sources.d.ts +0 -129
  173. package/dest/public/public_db_sources.d.ts.map +0 -1
  174. package/dest/public/public_processor/public_processor.d.ts +0 -74
  175. package/dest/public/public_processor/public_processor.d.ts.map +0 -1
  176. package/dest/public/public_processor/public_processor_metrics.d.ts +0 -27
  177. package/dest/public/public_processor/public_processor_metrics.d.ts.map +0 -1
  178. package/dest/public/public_tx_simulator/public_tx_context.d.ts +0 -137
  179. package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +0 -1
  180. package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +0 -102
  181. package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +0 -1
  182. package/dest/public/side_effect_errors.d.ts +0 -4
  183. package/dest/public/side_effect_errors.d.ts.map +0 -1
  184. package/dest/public/side_effect_trace.d.ts +0 -132
  185. package/dest/public/side_effect_trace.d.ts.map +0 -1
  186. package/dest/public/side_effect_trace_interface.d.ts +0 -34
  187. package/dest/public/side_effect_trace_interface.d.ts.map +0 -1
  188. package/dest/public/tx_contract_cache.d.ts +0 -41
  189. package/dest/public/tx_contract_cache.d.ts.map +0 -1
  190. package/dest/public/unique_class_ids.d.ts +0 -37
  191. package/dest/public/unique_class_ids.d.ts.map +0 -1
  192. package/dest/public/utils.d.ts +0 -5
  193. package/dest/public/utils.d.ts.map +0 -1
  194. package/dest/server.d.ts +0 -6
  195. package/dest/server.d.ts.map +0 -1
  196. package/dest/test/utils.d.ts +0 -13
  197. package/dest/test/utils.d.ts.map +0 -1
  198. /package/dest/private/{db_oracle.js → execution_data_provider.js} +0 -0
@@ -1,19 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import type { NoirCompiledCircuit } from '@aztec/stdlib/noir';
4
- import type { ExecutionError } from '@noir-lang/acvm_js';
5
- import type { Abi, WitnessMap } from '@noir-lang/types';
6
- import type { ACIRCallback, ACIRExecutionResult } from '../acvm/acvm.js';
7
- import type { ACVMWitness } from '../acvm/acvm_types.js';
8
- /**
9
- * Low level simulation interface
10
- */
11
- export interface SimulationProvider {
12
- executeProtocolCircuit(input: WitnessMap, compiledCircuit: NoirCompiledCircuit): Promise<WitnessMap>;
13
- executeUserCircuit(acir: Buffer, initialWitness: ACVMWitness, callback: ACIRCallback): Promise<ACIRExecutionResult>;
14
- }
15
- export type ErrorWithPayload = ExecutionError & {
16
- decodedAssertionPayload?: any;
17
- };
18
- export declare function parseErrorPayload(abi: Abi, originalError: ExecutionError): Error;
19
- //# sourceMappingURL=simulation_provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simulation_provider.d.ts","sourceRoot":"","sources":["../../../src/private/providers/simulation_provider.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrG,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACrH;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG;IAAE,uBAAuB,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC;AAIlF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,cAAc,GAAG,KAAK,CAuBhF"}
@@ -1,36 +0,0 @@
1
- import type { FunctionCall } from '@aztec/stdlib/abi';
2
- import { FunctionSelector } from '@aztec/stdlib/abi';
3
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
- import type { AztecNode } from '@aztec/stdlib/interfaces/client';
5
- import { PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
6
- import type { DBOracle } from './db_oracle.js';
7
- import type { SimulationProvider } from './providers/simulation_provider.js';
8
- /**
9
- * The ACIR simulator.
10
- */
11
- export declare class AcirSimulator {
12
- private db;
13
- private node;
14
- private simulationProvider;
15
- private log;
16
- constructor(db: DBOracle, node: AztecNode, simulationProvider: SimulationProvider);
17
- /**
18
- * Runs a private function.
19
- * @param request - The transaction request.
20
- * @param entryPointArtifact - The artifact of the entry point function.
21
- * @param contractAddress - The address of the contract (should match request.origin)
22
- * @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract or a specific account.
23
- * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
24
- * @returns The result of the execution.
25
- */
26
- run(request: TxExecutionRequest, contractAddress: AztecAddress, selector: FunctionSelector, msgSender?: AztecAddress, scopes?: AztecAddress[]): Promise<PrivateExecutionResult>;
27
- /**
28
- * Runs an unconstrained function.
29
- * @param request - The transaction request.
30
- * @param entryPointArtifact - The artifact of the entry point function.
31
- * @param contractAddress - The address of the contract.
32
- * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
33
- */
34
- runUnconstrained(request: FunctionCall, contractAddress: AztecAddress, selector: FunctionSelector, scopes?: AztecAddress[]): Promise<import("@aztec/stdlib/abi").AbiDecoded>;
35
- }
36
- //# sourceMappingURL=simulator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../../src/private/simulator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAe,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAI3F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAI7E;;GAEG;AACH,qBAAa,aAAa;IAGZ,OAAO,CAAC,EAAE;IAAY,OAAO,CAAC,IAAI;IAAa,OAAO,CAAC,kBAAkB;IAFrF,OAAO,CAAC,GAAG,CAAS;gBAEA,EAAE,EAAE,QAAQ,EAAU,IAAI,EAAE,SAAS,EAAU,kBAAkB,EAAE,kBAAkB;IAIzG;;;;;;;;OAQG;IACU,GAAG,CACd,OAAO,EAAE,kBAAkB,EAC3B,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,eAA6C,EACtD,MAAM,CAAC,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,sBAAsB,CAAC;IAmElC;;;;;;OAMG;IACU,gBAAgB,CAC3B,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,CAAC,EAAE,YAAY,EAAE;CA6B1B"}
@@ -1,10 +0,0 @@
1
- import type { Fr } from '@aztec/foundation/fields';
2
- import { type AbiDecoded, type FunctionArtifact, type FunctionSelector } from '@aztec/stdlib/abi';
3
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
- import type { SimulationProvider } from './providers/simulation_provider.js';
5
- import type { ViewDataOracle } from './view_data_oracle.js';
6
- /**
7
- * Execute an unconstrained function and return the decoded values.
8
- */
9
- export declare function executeUnconstrainedFunction(simulatorProvider: SimulationProvider, oracle: ViewDataOracle, artifact: FunctionArtifact, contractAddress: AztecAddress, functionSelector: FunctionSelector, args: Fr[], log?: import("@aztec/foundation/log").Logger): Promise<AbiDecoded>;
10
- //# sourceMappingURL=unconstrained_execution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unconstrained_execution.d.ts","sourceRoot":"","sources":["../../src/private/unconstrained_execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAiB,MAAM,mBAAmB,CAAC;AACjH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,iBAAiB,EAAE,kBAAkB,EACrC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,YAAY,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,EAAE,EAAE,EACV,GAAG,yCAAoD,GACtD,OAAO,CAAC,UAAU,CAAC,CAyBrB"}
@@ -1,164 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import { Fr } from '@aztec/foundation/fields';
4
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
5
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
6
- import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
7
- import type { AztecNode } from '@aztec/stdlib/interfaces/client';
8
- import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
9
- import { IndexedTaggingSecret, LogWithTxData } from '@aztec/stdlib/logs';
10
- import type { NoteStatus } from '@aztec/stdlib/note';
11
- import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
12
- import type { BlockHeader, Capsule } from '@aztec/stdlib/tx';
13
- import { type NoteData, TypedOracle } from './acvm/index.js';
14
- import type { DBOracle } from './db_oracle.js';
15
- /**
16
- * The execution context for a client view tx simulation.
17
- * It only reads data from data sources. Nothing will be updated or created during this simulation.
18
- */
19
- export declare class ViewDataOracle extends TypedOracle {
20
- protected readonly contractAddress: AztecAddress;
21
- /** List of transient auth witnesses to be used during this simulation */
22
- protected readonly authWitnesses: AuthWitness[];
23
- protected readonly capsules: Capsule[];
24
- protected readonly db: DBOracle;
25
- protected readonly aztecNode: AztecNode;
26
- protected log: import("@aztec/foundation/log").Logger;
27
- protected readonly scopes?: AztecAddress[] | undefined;
28
- constructor(contractAddress: AztecAddress,
29
- /** List of transient auth witnesses to be used during this simulation */
30
- authWitnesses: AuthWitness[], capsules: Capsule[], db: DBOracle, aztecNode: AztecNode, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[] | undefined);
31
- getBlockNumber(): Promise<number>;
32
- getContractAddress(): Promise<AztecAddress>;
33
- getChainId(): Promise<Fr>;
34
- getVersion(): Promise<Fr>;
35
- /**
36
- * Retrieve keys associated with a specific master public key and app address.
37
- * @param pkMHash - The master public key hash.
38
- * @returns A Promise that resolves to nullifier keys.
39
- * @throws If the keys are not registered in the key store.
40
- */
41
- getKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest>;
42
- /**
43
- * Fetches the index and sibling path of a leaf at a given block from a given tree.
44
- * @param blockNumber - The block number at which to get the membership witness.
45
- * @param treeId - Id of the tree to get the sibling path from.
46
- * @param leafValue - The leaf value
47
- * @returns The index and sibling path concatenated [index, sibling_path]
48
- */
49
- getMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]>;
50
- /**
51
- * Returns a nullifier membership witness for a given nullifier at a given block.
52
- * @param blockNumber - The block number at which to get the index.
53
- * @param nullifier - Nullifier we try to find witness for.
54
- * @returns The nullifier membership witness (if found).
55
- */
56
- getNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
57
- /**
58
- * Returns a low nullifier membership witness for a given nullifier at a given block.
59
- * @param blockNumber - The block number at which to get the index.
60
- * @param nullifier - Nullifier we try to find the low nullifier witness for.
61
- * @returns The low nullifier membership witness (if found).
62
- * @remarks Low nullifier witness can be used to perform a nullifier non-inclusion proof by leveraging the "linked
63
- * list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
64
- * we are trying to prove non-inclusion for.
65
- */
66
- getLowNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
67
- /**
68
- * Returns a public data tree witness for a given leaf slot at a given block.
69
- * @param blockNumber - The block number at which to get the index.
70
- * @param leafSlot - The slot of the public data tree to get the witness for.
71
- * @returns - The witness
72
- */
73
- getPublicDataTreeWitness(blockNumber: number, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
74
- /**
75
- * Fetches a block header of a given block.
76
- * @param blockNumber - The number of a block of which to get the block header.
77
- * @returns Block extracted from a block with block number `blockNumber`.
78
- */
79
- getBlockHeader(blockNumber: number): Promise<BlockHeader | undefined>;
80
- /**
81
- * Retrieve the complete address associated to a given address.
82
- * @param account - The account address.
83
- * @returns A complete address associated with the input address.
84
- * @throws An error if the account is not registered in the database.
85
- */
86
- getCompleteAddress(account: AztecAddress): Promise<CompleteAddress>;
87
- /**
88
- * Returns a contract instance associated with an address or throws if not found.
89
- * @param address - Address.
90
- * @returns A contract instance.
91
- */
92
- getContractInstance(address: AztecAddress): Promise<ContractInstance>;
93
- /**
94
- * Returns an auth witness for the given message hash. Checks on the list of transient witnesses
95
- * for this transaction first, and falls back to the local database if not found.
96
- * @param messageHash - Hash of the message to authenticate.
97
- * @returns Authentication witness for the requested message hash.
98
- */
99
- getAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
100
- /**
101
- * Gets some notes for a contract address and storage slot.
102
- * Returns a flattened array containing filtered notes.
103
- *
104
- * @remarks
105
- * Check for pending notes with matching slot.
106
- * Real notes coming from DB will have a leafIndex which
107
- * represents their index in the note hash tree.
108
- *
109
- * @param storageSlot - The storage slot.
110
- * @param numSelects - The number of valid selects in selectBy and selectValues.
111
- * @param selectBy - An array of indices of the fields to selects.
112
- * @param selectValues - The values to match.
113
- * @param selectComparators - The comparators to use to match values.
114
- * @param sortBy - An array of indices of the fields to sort.
115
- * @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
116
- * @param limit - The number of notes to retrieve per query.
117
- * @param offset - The starting index for pagination.
118
- * @param status - The status of notes to fetch.
119
- * @returns Array of note data.
120
- */
121
- 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[]>;
122
- /**
123
- * Check if a nullifier exists in the nullifier tree.
124
- * @param innerNullifier - The inner nullifier.
125
- * @returns A boolean indicating whether the nullifier exists in the tree or not.
126
- */
127
- checkNullifierExists(innerNullifier: Fr): Promise<boolean>;
128
- /**
129
- * Fetches a message from the db, given its key.
130
- * @param contractAddress - Address of a contract by which the message was emitted.
131
- * @param messageHash - Hash of the message.
132
- * @param secret - Secret used to compute a nullifier.
133
- * @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
134
- * @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
135
- */
136
- getL1ToL2MembershipWitness(contractAddress: AztecAddress, messageHash: Fr, secret: Fr): Promise<import("../client.js").MessageLoadOracleInputs<39>>;
137
- /**
138
- * Read the public storage data.
139
- * @param contractAddress - The address to read storage from.
140
- * @param startStorageSlot - The starting storage slot.
141
- * @param blockNumber - The block number to read storage at.
142
- * @param numberOfElements - Number of elements to read from the starting storage slot.
143
- */
144
- storageRead(contractAddress: AztecAddress, startStorageSlot: Fr, blockNumber: number, numberOfElements: number): Promise<Fr[]>;
145
- debugLog(message: string, fields: Fr[]): void;
146
- /**
147
- * Returns the tagging secret for a given sender and recipient pair, siloed to the current contract address.
148
- * Includes the next index to be used used for tagging with this secret.
149
- * For this to work, the ivsk_m of the sender must be known.
150
- * @param sender - The address sending the note
151
- * @param recipient - The address receiving the note
152
- * @returns A tagging secret that can be used to tag notes.
153
- */
154
- getIndexedTaggingSecretAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<IndexedTaggingSecret>;
155
- syncNotes(): Promise<void>;
156
- deliverNote(contractAddress: AztecAddress, storageSlot: Fr, nonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: Fr, recipient: AztecAddress): Promise<void>;
157
- getLogByTag(tag: Fr): Promise<LogWithTxData | null>;
158
- storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void>;
159
- loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
160
- deleteCapsule(contractAddress: AztecAddress, slot: Fr): Promise<void>;
161
- copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
162
- aes128Decrypt(ciphertext: Buffer, iv: Buffer, symKey: Buffer): Promise<Buffer>;
163
- }
164
- //# sourceMappingURL=view_data_oracle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"view_data_oracle.d.ts","sourceRoot":"","sources":["../../src/private/view_data_oracle.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA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GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAInD,YAAY,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7E,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAWhF,aAAa,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrE,WAAW,CACzB,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,EAAE,EACX,OAAO,EAAE,EAAE,EACX,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IASA,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAI/F"}
@@ -1,41 +0,0 @@
1
- import type { Fr } from '@aztec/foundation/fields';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
- import type { AvmExecutionEnvironment } from './avm_execution_environment.js';
4
- import { type Gas } from './avm_gas.js';
5
- import { AvmMachineState } from './avm_machine_state.js';
6
- import type { AvmSimulator } from './avm_simulator.js';
7
- import type { AvmPersistableStateManager } from './journal/journal.js';
8
- /**
9
- * An execution context includes the information necessary to initiate AVM
10
- * execution along with all state maintained by the AVM throughout execution.
11
- */
12
- export declare class AvmContext {
13
- persistableState: AvmPersistableStateManager;
14
- environment: AvmExecutionEnvironment;
15
- machineState: AvmMachineState;
16
- /**
17
- * Create a new AVM context
18
- * @param persistableState - Manages world state and accrued substate during execution - (caching, fetching, tracing)
19
- * @param environment - Contains constant variables provided by the kernel
20
- * @param machineState - VM state that is modified on an instruction-by-instruction basis
21
- * @returns new AvmContext instance
22
- */
23
- constructor(persistableState: AvmPersistableStateManager, environment: AvmExecutionEnvironment, machineState: AvmMachineState);
24
- provideSimulator?: (ctx: this) => Promise<AvmSimulator>;
25
- /**
26
- * Prepare a new AVM context that will be ready for an external/nested call
27
- * - Fork the world state journal
28
- * - Derive a machine state from the current state
29
- * - E.g., gas metering is preserved but pc is reset
30
- * - Derive an execution environment from the caller/parent
31
- * - Alter address
32
- *
33
- * @param address - The contract instance to initialize a context for
34
- * @param calldata - Data/arguments for nested call
35
- * @param allocatedGas - Gas allocated for the nested call
36
- * @param callType - Type of call (CALL or STATICCALL)
37
- * @returns new AvmContext instance
38
- */
39
- createNestedContractCallContext(address: AztecAddress, calldata: Fr[], allocatedGas: Gas, callType: 'CALL' | 'STATICCALL'): Promise<AvmContext>;
40
- }
41
- //# sourceMappingURL=avm_context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avm_context.d.ts","sourceRoot":"","sources":["../../../src/public/avm/avm_context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,KAAK,GAAG,EAAgB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAEvE;;;GAGG;AACH,qBAAa,UAAU;IASZ,gBAAgB,EAAE,0BAA0B;IAC5C,WAAW,EAAE,uBAAuB;IACpC,YAAY,EAAE,eAAe;IAVtC;;;;;;OAMG;gBAEM,gBAAgB,EAAE,0BAA0B,EAC5C,WAAW,EAAE,uBAAuB,EACpC,YAAY,EAAE,eAAe;IAK/B,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAE/D;;;;;;;;;;;;;OAaG;IACU,+BAA+B,CAC1C,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,EAAE,EAAE,EACd,YAAY,EAAE,GAAG,EACjB,QAAQ,EAAE,MAAM,GAAG,YAAY,GAC9B,OAAO,CAAC,UAAU,CAAC;CAUvB"}
@@ -1,30 +0,0 @@
1
- import type { Fr } from '@aztec/foundation/fields';
2
- import type { SimulationError } from '@aztec/stdlib/errors';
3
- import { Gas } from '@aztec/stdlib/gas';
4
- import type { Gas as AvmGas } from './avm_gas.js';
5
- import type { AvmRevertReason } from './errors.js';
6
- /**
7
- * Results of an contract call's execution in the AVM.
8
- */
9
- export declare class AvmContractCallResult {
10
- reverted: boolean;
11
- output: Fr[];
12
- gasLeft: AvmGas;
13
- revertReason?: AvmRevertReason | undefined;
14
- constructor(reverted: boolean, output: Fr[], gasLeft: AvmGas, revertReason?: AvmRevertReason | undefined);
15
- toString(): string;
16
- finalize(): AvmFinalizedCallResult;
17
- }
18
- /**
19
- * Similar to AvmContractCallResult, but with a SimulationError and standard Gas
20
- * which are useful for consumption external to core AVM simulation.
21
- */
22
- export declare class AvmFinalizedCallResult {
23
- reverted: boolean;
24
- output: Fr[];
25
- gasLeft: Gas;
26
- revertReason?: SimulationError | undefined;
27
- constructor(reverted: boolean, output: Fr[], gasLeft: Gas, revertReason?: SimulationError | undefined);
28
- toString(): string;
29
- }
30
- //# sourceMappingURL=avm_contract_call_result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avm_contract_call_result.d.ts","sourceRoot":"","sources":["../../../src/public/avm/avm_contract_call_result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAKxC,OAAO,KAAK,EAAE,GAAG,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,qBAAa,qBAAqB;IAEvB,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,EAAE,EAAE;IACZ,OAAO,EAAE,MAAM;IACf,YAAY,CAAC;gBAHb,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,EAAE,EAAE,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,6BAAiB;IAGvC,QAAQ,IAAI,MAAM;IAQlB,QAAQ,IAAI,sBAAsB;CAInC;AAED;;;GAGG;AACH,qBAAa,sBAAsB;IAExB,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,EAAE,EAAE;IACZ,OAAO,EAAE,GAAG;IACZ,YAAY,CAAC;gBAHb,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,EAAE,EAAE,EACZ,OAAO,EAAE,GAAG,EACZ,YAAY,CAAC,6BAAiB;IAGvC,QAAQ,IAAI,MAAM;CAOnB"}
@@ -1,21 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
- import type { GlobalVariables } from '@aztec/stdlib/tx';
4
- /**
5
- * Contains variables that remain constant during AVM execution
6
- * These variables are provided by the public kernel circuit
7
- */
8
- export declare class AvmExecutionEnvironment {
9
- readonly address: AztecAddress;
10
- readonly sender: AztecAddress;
11
- readonly contractCallDepth: Fr;
12
- readonly transactionFee: Fr;
13
- readonly globals: GlobalVariables;
14
- readonly isStaticCall: boolean;
15
- readonly calldata: Fr[];
16
- constructor(address: AztecAddress, sender: AztecAddress, contractCallDepth: Fr, transactionFee: Fr, globals: GlobalVariables, isStaticCall: boolean, calldata: Fr[]);
17
- private deriveEnvironmentForNestedCallInternal;
18
- deriveEnvironmentForNestedCall(targetAddress: AztecAddress, calldata: Fr[]): AvmExecutionEnvironment;
19
- deriveEnvironmentForNestedStaticCall(targetAddress: AztecAddress, calldata: Fr[]): AvmExecutionEnvironment;
20
- }
21
- //# sourceMappingURL=avm_execution_environment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avm_execution_environment.d.ts","sourceRoot":"","sources":["../../../src/public/avm/avm_execution_environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;GAGG;AACH,qBAAa,uBAAuB;aAEhB,OAAO,EAAE,YAAY;aACrB,MAAM,EAAE,YAAY;aACpB,iBAAiB,EAAE,EAAE;aACrB,cAAc,EAAE,EAAE;aAClB,OAAO,EAAE,eAAe;aACxB,YAAY,EAAE,OAAO;aACrB,QAAQ,EAAE,EAAE,EAAE;gBANd,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,YAAY,EACpB,iBAAiB,EAAE,EAAE,EACrB,cAAc,EAAE,EAAE,EAClB,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,EAAE,EAAE;IAGhC,OAAO,CAAC,sCAAsC;IAYvC,8BAA8B,CAAC,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,uBAAuB;IAIpG,oCAAoC,CAAC,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,uBAAuB;CAGlH"}
@@ -1,60 +0,0 @@
1
- import { TypeTag } from './avm_memory_types.js';
2
- import { Opcode } from './serialization/instruction_serialization.js';
3
- /** Gas counters in L1, L2, and DA. */
4
- export type Gas = {
5
- l2Gas: number;
6
- daGas: number;
7
- };
8
- /** Maps a Gas struct to gasLeft properties. */
9
- export declare function gasToGasLeft(gas: Gas): {
10
- l2GasLeft: number;
11
- daGasLeft: number;
12
- };
13
- /** Maps gasLeft properties to a gas struct. */
14
- export declare function gasLeftToGas(gasLeft: {
15
- l2GasLeft: number;
16
- daGasLeft: number;
17
- }): {
18
- l2Gas: number;
19
- daGas: number;
20
- };
21
- /** Creates a new instance with all values set to zero except the ones set. */
22
- export declare function makeGas(gasCost: Partial<Gas>): {
23
- l2Gas: number;
24
- daGas: number;
25
- };
26
- /** Sums together multiple instances of Gas. */
27
- export declare function sumGas(...gases: Partial<Gas>[]): Gas;
28
- /** Multiplies a gas instance by a scalar. */
29
- export declare function mulGas(gas: Partial<Gas>, scalar: number): {
30
- l2Gas: number;
31
- daGas: number;
32
- };
33
- /** Zero gas across all gas dimensions. */
34
- export declare const EmptyGas: Gas;
35
- /** Dimensions of gas usage: L1, L2, and DA. */
36
- export declare const GAS_DIMENSIONS: readonly ["l2Gas", "daGas"];
37
- /** Returns the fixed base gas cost for a given opcode. */
38
- export declare function getBaseGasCost(opcode: Opcode): Gas;
39
- export declare function getDynamicGasCost(opcode: Opcode): Gas;
40
- /** Returns the gas cost associated with the memory operations performed. */
41
- export declare function getMemoryGasCost(args: {
42
- reads?: number;
43
- writes?: number;
44
- indirect?: number;
45
- }): {
46
- l2Gas: number;
47
- daGas: number;
48
- };
49
- /** Constants used in base cost calculations. */
50
- export declare const GAS_COST_CONSTANTS: {
51
- MEMORY_READ: number;
52
- MEMORY_INDIRECT_READ_PENALTY: number;
53
- MEMORY_WRITE: number;
54
- };
55
- /** Returns gas cost for an operation on a given type tag based on the base cost per byte. */
56
- export declare function getGasCostForTypeTag(tag: TypeTag, baseCost: Gas): {
57
- l2Gas: number;
58
- daGas: number;
59
- };
60
- //# sourceMappingURL=avm_gas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avm_gas.d.ts","sourceRoot":"","sources":["../../../src/public/avm/avm_gas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAA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0,0 @@
1
- import type { Fr } from '@aztec/foundation/fields';
2
- import type { Gas } from './avm_gas.js';
3
- import { TaggedMemory } from './avm_memory_types.js';
4
- import { type AvmRevertReason } from './errors.js';
5
- /**
6
- * A few fields of machine state are initialized from AVM session inputs or call instruction arguments
7
- */
8
- export type InitialAvmMachineState = {
9
- l2GasLeft: number;
10
- daGasLeft: number;
11
- };
12
- /**
13
- * Used to track the call stack and revert data of nested calls.
14
- * This is used to provide a more detailed revert reason when a contract call reverts.
15
- * It is only a heuristic and may not always provide the correct revert reason.
16
- */
17
- type TrackedRevertInfo = {
18
- revertDataRepresentative: Fr[];
19
- recursiveRevertReason: AvmRevertReason;
20
- };
21
- type CallStackEntry = {
22
- callPc: number;
23
- returnPc: number;
24
- };
25
- /**
26
- * Avm state modified on an instruction-per-instruction basis.
27
- */
28
- export declare class AvmMachineState {
29
- /** gas remaining of the gas allocated for a contract call */
30
- l2GasLeft: number;
31
- daGasLeft: number;
32
- /** program counter, byte based */
33
- pc: number;
34
- /** program counter of the next instruction, byte based */
35
- nextPc: number;
36
- /** return/revertdata of the last nested call. */
37
- nestedReturndata: Fr[];
38
- /**
39
- * Used to track the call stack and revert data of nested calls.
40
- * This is used to provide a more detailed revert reason when a contract call reverts.
41
- * It is only a heuristic and may not always provide the correct revert reason.
42
- */
43
- collectedRevertInfo: TrackedRevertInfo | undefined;
44
- /**
45
- * On INTERNALCALL, internal call stack is pushed to with the current pc and the return pc.
46
- * On INTERNALRETURN, value is popped from the internal call stack and assigned to the return pc.
47
- */
48
- internalCallStack: CallStackEntry[];
49
- /** Memory accessible to user code */
50
- readonly memory: TaggedMemory;
51
- /**
52
- * Signals that execution should end.
53
- * AvmContext execution continues executing instructions until the machine state signals "halted"
54
- */
55
- private halted;
56
- /** Signals that execution has reverted normally (this does not cover exceptional halts) */
57
- private reverted;
58
- /** Output data must NOT be modified once it is set */
59
- private output;
60
- constructor(gasLeft: Gas);
61
- constructor(l2GasLeft: number, daGasLeft: number);
62
- get gasLeft(): Gas;
63
- static fromState(state: InitialAvmMachineState): AvmMachineState;
64
- /**
65
- * Consumes the given gas.
66
- * Should any of the gas dimensions get depleted, it sets all gas left to zero and triggers
67
- * an exceptional halt by throwing an OutOfGasError.
68
- */
69
- consumeGas(gasCost: Partial<Gas>): void;
70
- /** Increases the gas left by the amounts specified. */
71
- refundGas(gasRefund: Partial<Gas>): void;
72
- /**
73
- * Halt as successful
74
- * Output data must NOT be modified once it is set
75
- * @param output
76
- */
77
- return(output: Fr[]): void;
78
- /**
79
- * Halt as reverted
80
- * Output data must NOT be modified once it is set
81
- * @param output
82
- */
83
- revert(output: Fr[]): void;
84
- getHalted(): boolean;
85
- getReverted(): boolean;
86
- getOutput(): Fr[];
87
- /**
88
- * Flag an exceptional halt. Clears gas left and sets the reverted flag. No output data.
89
- */
90
- private exceptionalHalt;
91
- }
92
- export {};
93
- //# sourceMappingURL=avm_machine_state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avm_machine_state.d.ts","sourceRoot":"","sources":["../../../src/public/avm/avm_machine_state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,aAAa,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,KAAK,iBAAiB,GAAG;IACvB,wBAAwB,EAAE,EAAE,EAAE,CAAC;IAC/B,qBAAqB,EAAE,eAAe,CAAC;CACxC,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;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