@aztec/simulator 0.31.0 → 0.32.1

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 (174) hide show
  1. package/dest/acvm/acvm.d.ts +5 -5
  2. package/dest/acvm/acvm.d.ts.map +1 -1
  3. package/dest/acvm/acvm_types.d.ts +1 -1
  4. package/dest/acvm/acvm_types.d.ts.map +1 -1
  5. package/dest/acvm/deserialize.d.ts +1 -1
  6. package/dest/acvm/deserialize.d.ts.map +1 -1
  7. package/dest/acvm/oracle/debug.d.ts +2 -2
  8. package/dest/acvm/oracle/debug.d.ts.map +1 -1
  9. package/dest/acvm/oracle/index.d.ts +1 -1
  10. package/dest/acvm/oracle/index.d.ts.map +1 -1
  11. package/dest/acvm/oracle/oracle.d.ts +2 -2
  12. package/dest/acvm/oracle/oracle.d.ts.map +1 -1
  13. package/dest/acvm/oracle/typed_oracle.d.ts +6 -6
  14. package/dest/acvm/oracle/typed_oracle.d.ts.map +1 -1
  15. package/dest/acvm/serialize.d.ts +4 -4
  16. package/dest/acvm/serialize.d.ts.map +1 -1
  17. package/dest/acvm/serialize.js +1 -1
  18. package/dest/avm/avm_context.d.ts +4 -4
  19. package/dest/avm/avm_context.d.ts.map +1 -1
  20. package/dest/avm/avm_context.js +1 -1
  21. package/dest/avm/avm_execution_environment.d.ts +4 -4
  22. package/dest/avm/avm_execution_environment.d.ts.map +1 -1
  23. package/dest/avm/avm_execution_environment.js +3 -3
  24. package/dest/avm/avm_gas_cost.d.ts +307 -3
  25. package/dest/avm/avm_gas_cost.d.ts.map +1 -1
  26. package/dest/avm/avm_gas_cost.js +42 -8
  27. package/dest/avm/avm_machine_state.d.ts +2 -2
  28. package/dest/avm/avm_machine_state.d.ts.map +1 -1
  29. package/dest/avm/avm_machine_state.js +1 -1
  30. package/dest/avm/avm_memory_types.d.ts +1 -1
  31. package/dest/avm/avm_memory_types.d.ts.map +1 -1
  32. package/dest/avm/avm_memory_types.js +1 -1
  33. package/dest/avm/avm_message_call_result.d.ts +1 -1
  34. package/dest/avm/avm_message_call_result.d.ts.map +1 -1
  35. package/dest/avm/avm_simulator.js +1 -1
  36. package/dest/avm/errors.d.ts +1 -1
  37. package/dest/avm/errors.d.ts.map +1 -1
  38. package/dest/avm/fixtures/index.d.ts +1 -1
  39. package/dest/avm/fixtures/index.d.ts.map +1 -1
  40. package/dest/avm/fixtures/index.js +5 -5
  41. package/dest/avm/journal/host_storage.d.ts +1 -1
  42. package/dest/avm/journal/host_storage.d.ts.map +1 -1
  43. package/dest/avm/journal/journal.d.ts +2 -2
  44. package/dest/avm/journal/journal.d.ts.map +1 -1
  45. package/dest/avm/journal/trace.d.ts +1 -1
  46. package/dest/avm/journal/trace.d.ts.map +1 -1
  47. package/dest/avm/journal/trace_types.d.ts +1 -1
  48. package/dest/avm/journal/trace_types.d.ts.map +1 -1
  49. package/dest/avm/opcodes/addressing_mode.d.ts +2 -2
  50. package/dest/avm/opcodes/addressing_mode.d.ts.map +1 -1
  51. package/dest/avm/opcodes/addressing_mode.js +1 -1
  52. package/dest/avm/opcodes/arithmetic.d.ts +15 -12
  53. package/dest/avm/opcodes/arithmetic.d.ts.map +1 -1
  54. package/dest/avm/opcodes/arithmetic.js +25 -36
  55. package/dest/avm/opcodes/environment_getters.d.ts +1 -1
  56. package/dest/avm/opcodes/environment_getters.d.ts.map +1 -1
  57. package/dest/avm/opcodes/hashing.d.ts +1 -1
  58. package/dest/avm/opcodes/hashing.d.ts.map +1 -1
  59. package/dest/avm/opcodes/hashing.js +2 -2
  60. package/dest/avm/opcodes/instruction.d.ts +4 -4
  61. package/dest/avm/opcodes/instruction.d.ts.map +1 -1
  62. package/dest/avm/opcodes/instruction.js +7 -3
  63. package/dest/avm/opcodes/memory.d.ts +3 -0
  64. package/dest/avm/opcodes/memory.d.ts.map +1 -1
  65. package/dest/avm/opcodes/memory.js +8 -1
  66. package/dest/avm/temporary_executor_migration.d.ts +4 -4
  67. package/dest/avm/temporary_executor_migration.d.ts.map +1 -1
  68. package/dest/avm/temporary_executor_migration.js +3 -3
  69. package/dest/client/client_execution_context.d.ts +13 -13
  70. package/dest/client/client_execution_context.d.ts.map +1 -1
  71. package/dest/client/client_execution_context.js +5 -5
  72. package/dest/client/db_oracle.d.ts +9 -9
  73. package/dest/client/db_oracle.d.ts.map +1 -1
  74. package/dest/client/db_oracle.js +1 -1
  75. package/dest/client/execution_note_cache.d.ts +2 -2
  76. package/dest/client/execution_note_cache.d.ts.map +1 -1
  77. package/dest/client/execution_result.d.ts +9 -9
  78. package/dest/client/execution_result.d.ts.map +1 -1
  79. package/dest/client/execution_result.js +1 -1
  80. package/dest/client/pick_notes.d.ts +1 -1
  81. package/dest/client/pick_notes.d.ts.map +1 -1
  82. package/dest/client/pick_notes.js +1 -1
  83. package/dest/client/private_execution.d.ts +5 -5
  84. package/dest/client/private_execution.d.ts.map +1 -1
  85. package/dest/client/private_execution.js +1 -1
  86. package/dest/client/simulator.d.ts +6 -6
  87. package/dest/client/simulator.d.ts.map +1 -1
  88. package/dest/client/simulator.js +1 -1
  89. package/dest/client/unconstrained_execution.d.ts +5 -5
  90. package/dest/client/unconstrained_execution.d.ts.map +1 -1
  91. package/dest/client/unconstrained_execution.js +1 -1
  92. package/dest/client/view_data_oracle.d.ts +6 -6
  93. package/dest/client/view_data_oracle.d.ts.map +1 -1
  94. package/dest/client/view_data_oracle.js +1 -1
  95. package/dest/common/errors.d.ts +1 -1
  96. package/dest/common/errors.d.ts.map +1 -1
  97. package/dest/common/errors.js +1 -1
  98. package/dest/public/db.d.ts +6 -6
  99. package/dest/public/db.d.ts.map +1 -1
  100. package/dest/public/execution.d.ts +4 -4
  101. package/dest/public/execution.d.ts.map +1 -1
  102. package/dest/public/execution.js +1 -1
  103. package/dest/public/executor.d.ts +3 -3
  104. package/dest/public/executor.d.ts.map +1 -1
  105. package/dest/public/executor.js +3 -3
  106. package/dest/public/public_execution_context.d.ts +8 -8
  107. package/dest/public/public_execution_context.d.ts.map +1 -1
  108. package/dest/public/public_execution_context.js +4 -4
  109. package/dest/public/state_actions.d.ts +2 -2
  110. package/dest/public/state_actions.d.ts.map +1 -1
  111. package/dest/simulator/acvm_native.d.ts +3 -3
  112. package/dest/simulator/acvm_native.d.ts.map +1 -1
  113. package/dest/simulator/acvm_wasm.d.ts +3 -3
  114. package/dest/simulator/acvm_wasm.d.ts.map +1 -1
  115. package/dest/simulator/acvm_wasm.js +2 -2
  116. package/dest/simulator/simulation_provider.d.ts +2 -2
  117. package/dest/simulator/simulation_provider.d.ts.map +1 -1
  118. package/dest/test/utils.d.ts +1 -1
  119. package/dest/test/utils.d.ts.map +1 -1
  120. package/dest/test/utils.js +2 -3
  121. package/dest/utils.d.ts +1 -1
  122. package/dest/utils.d.ts.map +1 -1
  123. package/dest/utils.js +2 -2
  124. package/package.json +5 -5
  125. package/src/acvm/acvm.ts +8 -8
  126. package/src/acvm/acvm_types.ts +1 -1
  127. package/src/acvm/deserialize.ts +1 -1
  128. package/src/acvm/oracle/debug.ts +2 -2
  129. package/src/acvm/oracle/index.ts +1 -1
  130. package/src/acvm/oracle/oracle.ts +2 -2
  131. package/src/acvm/oracle/typed_oracle.ts +18 -18
  132. package/src/acvm/serialize.ts +4 -4
  133. package/src/avm/avm_context.ts +4 -4
  134. package/src/avm/avm_execution_environment.ts +6 -9
  135. package/src/avm/avm_gas_cost.ts +46 -8
  136. package/src/avm/avm_machine_state.ts +2 -2
  137. package/src/avm/avm_memory_types.ts +1 -1
  138. package/src/avm/avm_message_call_result.ts +1 -1
  139. package/src/avm/avm_simulator.ts +1 -1
  140. package/src/avm/errors.ts +1 -1
  141. package/src/avm/fixtures/index.ts +9 -4
  142. package/src/avm/journal/host_storage.ts +1 -1
  143. package/src/avm/journal/journal.ts +2 -2
  144. package/src/avm/journal/trace.ts +1 -1
  145. package/src/avm/journal/trace_types.ts +1 -1
  146. package/src/avm/opcodes/addressing_mode.ts +2 -2
  147. package/src/avm/opcodes/arithmetic.ts +34 -47
  148. package/src/avm/opcodes/bitwise.ts +1 -1
  149. package/src/avm/opcodes/control_flow.ts +1 -1
  150. package/src/avm/opcodes/environment_getters.ts +1 -1
  151. package/src/avm/opcodes/hashing.ts +2 -2
  152. package/src/avm/opcodes/instruction.ts +9 -5
  153. package/src/avm/opcodes/memory.ts +9 -0
  154. package/src/avm/temporary_executor_migration.ts +8 -8
  155. package/src/client/client_execution_context.ts +22 -20
  156. package/src/client/db_oracle.ts +16 -10
  157. package/src/client/execution_note_cache.ts +2 -2
  158. package/src/client/execution_result.ts +13 -9
  159. package/src/client/pick_notes.ts +1 -1
  160. package/src/client/private_execution.ts +5 -5
  161. package/src/client/simulator.ts +8 -8
  162. package/src/client/unconstrained_execution.ts +5 -5
  163. package/src/client/view_data_oracle.ts +11 -11
  164. package/src/common/errors.ts +1 -1
  165. package/src/public/db.ts +6 -6
  166. package/src/public/execution.ts +12 -12
  167. package/src/public/executor.ts +5 -5
  168. package/src/public/public_execution_context.ts +18 -8
  169. package/src/public/state_actions.ts +2 -2
  170. package/src/simulator/acvm_native.ts +3 -3
  171. package/src/simulator/acvm_wasm.ts +8 -4
  172. package/src/simulator/simulation_provider.ts +2 -2
  173. package/src/test/utils.ts +2 -3
  174. package/src/utils.ts +2 -2
@@ -1,9 +1,13 @@
1
- import { FunctionL2Logs, Note } from '@aztec/circuit-types';
2
- import { NoteHashReadRequestMembershipWitness, PrivateCallStackItem, PublicCallRequest } from '@aztec/circuits.js';
3
- import { DecodedReturn } from '@aztec/foundation/abi';
4
- import { Fr } from '@aztec/foundation/fields';
1
+ import { type EncryptedFunctionL2Logs, type Note, type UnencryptedFunctionL2Logs } from '@aztec/circuit-types';
2
+ import {
3
+ type NoteHashReadRequestMembershipWitness,
4
+ type PrivateCallStackItem,
5
+ type PublicCallRequest,
6
+ } from '@aztec/circuits.js';
7
+ import { type DecodedReturn } from '@aztec/foundation/abi';
8
+ import { type Fr } from '@aztec/foundation/fields';
5
9
 
6
- import { ACVMField } from '../acvm/index.js';
10
+ import { type ACVMField } from '../acvm/index.js';
7
11
 
8
12
  /**
9
13
  * The contents of a new note.
@@ -46,12 +50,12 @@ export interface ExecutionResult {
46
50
  * Encrypted logs emitted during execution of this function call.
47
51
  * Note: These are preimages to `encryptedLogsHash`.
48
52
  */
49
- encryptedLogs: FunctionL2Logs;
53
+ encryptedLogs: EncryptedFunctionL2Logs;
50
54
  /**
51
55
  * Unencrypted logs emitted during execution of this function call.
52
56
  * Note: These are preimages to `unencryptedLogsHash`.
53
57
  */
54
- unencryptedLogs: FunctionL2Logs;
58
+ unencryptedLogs: UnencryptedFunctionL2Logs;
55
59
  }
56
60
 
57
61
  /**
@@ -59,7 +63,7 @@ export interface ExecutionResult {
59
63
  * @param execResult - The topmost execution result.
60
64
  * @returns All encrypted logs.
61
65
  */
62
- export function collectEncryptedLogs(execResult: ExecutionResult): FunctionL2Logs[] {
66
+ export function collectEncryptedLogs(execResult: ExecutionResult): EncryptedFunctionL2Logs[] {
63
67
  // without the .reverse(), the logs will be in a queue like fashion which is wrong as the kernel processes it like a stack.
64
68
  return [execResult.encryptedLogs, ...[...execResult.nestedExecutions].reverse().flatMap(collectEncryptedLogs)];
65
69
  }
@@ -69,7 +73,7 @@ export function collectEncryptedLogs(execResult: ExecutionResult): FunctionL2Log
69
73
  * @param execResult - The topmost execution result.
70
74
  * @returns All unencrypted logs.
71
75
  */
72
- export function collectUnencryptedLogs(execResult: ExecutionResult): FunctionL2Logs[] {
76
+ export function collectUnencryptedLogs(execResult: ExecutionResult): UnencryptedFunctionL2Logs[] {
73
77
  // without the .reverse(), the logs will be in a queue like fashion which is wrong as the kernel processes it like a stack.
74
78
  return [execResult.unencryptedLogs, ...[...execResult.nestedExecutions].reverse().flatMap(collectUnencryptedLogs)];
75
79
  }
@@ -1,4 +1,4 @@
1
- import { Comparator, Note } from '@aztec/circuit-types';
1
+ import { Comparator, type Note } from '@aztec/circuit-types';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
3
 
4
4
  export interface PropertySelector {
@@ -1,14 +1,14 @@
1
- import { FunctionData, PrivateCallStackItem, PrivateCircuitPublicInputs } from '@aztec/circuits.js';
2
- import { FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
3
- import { AztecAddress } from '@aztec/foundation/aztec-address';
1
+ import { type FunctionData, PrivateCallStackItem, PrivateCircuitPublicInputs } from '@aztec/circuits.js';
2
+ import { type FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
3
+ import { type AztecAddress } from '@aztec/foundation/aztec-address';
4
4
  import { Fr } from '@aztec/foundation/fields';
5
5
  import { createDebugLogger } from '@aztec/foundation/log';
6
6
 
7
7
  import { extractReturnWitness } from '../acvm/deserialize.js';
8
8
  import { Oracle, acvm, extractCallStack } from '../acvm/index.js';
9
9
  import { ExecutionError } from '../common/errors.js';
10
- import { ClientExecutionContext } from './client_execution_context.js';
11
- import { ExecutionResult } from './execution_result.js';
10
+ import { type ClientExecutionContext } from './client_execution_context.js';
11
+ import { type ExecutionResult } from './execution_result.js';
12
12
  import { AcirSimulator } from './simulator.js';
13
13
 
14
14
  /**
@@ -1,26 +1,26 @@
1
- import { AztecNode, FunctionCall, Note, TxExecutionRequest } from '@aztec/circuit-types';
1
+ import { type AztecNode, type FunctionCall, type Note, type TxExecutionRequest } from '@aztec/circuit-types';
2
2
  import { CallContext, FunctionData } from '@aztec/circuits.js';
3
3
  import { Grumpkin } from '@aztec/circuits.js/barretenberg';
4
4
  import {
5
- ArrayType,
6
- FunctionArtifactWithDebugMetadata,
5
+ type ArrayType,
6
+ type FunctionArtifactWithDebugMetadata,
7
7
  FunctionSelector,
8
8
  FunctionType,
9
9
  encodeArguments,
10
10
  } from '@aztec/foundation/abi';
11
11
  import { AztecAddress } from '@aztec/foundation/aztec-address';
12
- import { EthAddress } from '@aztec/foundation/eth-address';
12
+ import { type EthAddress } from '@aztec/foundation/eth-address';
13
13
  import { Fr } from '@aztec/foundation/fields';
14
- import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
14
+ import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
15
15
 
16
- import { WasmBlackBoxFunctionSolver, createBlackBoxSolver } from '@noir-lang/acvm_js';
16
+ import { type WasmBlackBoxFunctionSolver, createBlackBoxSolver } from '@noir-lang/acvm_js';
17
17
 
18
18
  import { createSimulationError } from '../common/errors.js';
19
19
  import { PackedArgsCache } from '../common/packed_args_cache.js';
20
20
  import { ClientExecutionContext } from './client_execution_context.js';
21
- import { DBOracle } from './db_oracle.js';
21
+ import { type DBOracle } from './db_oracle.js';
22
22
  import { ExecutionNoteCache } from './execution_note_cache.js';
23
- import { ExecutionResult } from './execution_result.js';
23
+ import { type ExecutionResult } from './execution_result.js';
24
24
  import { executePrivateFunction } from './private_execution.js';
25
25
  import { executeUnconstrainedFunction } from './unconstrained_execution.js';
26
26
  import { ViewDataOracle } from './view_data_oracle.js';
@@ -1,14 +1,14 @@
1
- import { FunctionData } from '@aztec/circuits.js';
2
- import { DecodedReturn, FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
3
- import { AztecAddress } from '@aztec/foundation/aztec-address';
4
- import { Fr } from '@aztec/foundation/fields';
1
+ import { type FunctionData } from '@aztec/circuits.js';
2
+ import { type DecodedReturn, type FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
3
+ import { type AztecAddress } from '@aztec/foundation/aztec-address';
4
+ import { type Fr } from '@aztec/foundation/fields';
5
5
  import { createDebugLogger } from '@aztec/foundation/log';
6
6
 
7
7
  import { extractReturnWitness } from '../acvm/deserialize.js';
8
8
  import { Oracle, acvm, extractCallStack, toACVMWitness } from '../acvm/index.js';
9
9
  import { ExecutionError } from '../common/errors.js';
10
10
  import { AcirSimulator } from './simulator.js';
11
- import { ViewDataOracle } from './view_data_oracle.js';
11
+ import { type ViewDataOracle } from './view_data_oracle.js';
12
12
 
13
13
  // docs:start:execute_unconstrained_function
14
14
  /**
@@ -1,21 +1,21 @@
1
1
  import {
2
- AuthWitness,
3
- AztecNode,
4
- CompleteAddress,
2
+ type AuthWitness,
3
+ type AztecNode,
4
+ type CompleteAddress,
5
5
  MerkleTreeId,
6
- NoteStatus,
7
- NullifierMembershipWitness,
8
- PublicDataWitness,
6
+ type NoteStatus,
7
+ type NullifierMembershipWitness,
8
+ type PublicDataWitness,
9
9
  } from '@aztec/circuit-types';
10
- import { Header } from '@aztec/circuits.js';
10
+ import { type Header } from '@aztec/circuits.js';
11
11
  import { siloNullifier } from '@aztec/circuits.js/hash';
12
- import { AztecAddress } from '@aztec/foundation/aztec-address';
12
+ import { type AztecAddress } from '@aztec/foundation/aztec-address';
13
13
  import { Fr } from '@aztec/foundation/fields';
14
14
  import { createDebugLogger } from '@aztec/foundation/log';
15
- import { ContractInstance } from '@aztec/types/contracts';
15
+ import { type ContractInstance } from '@aztec/types/contracts';
16
16
 
17
- import { NoteData, TypedOracle } from '../acvm/index.js';
18
- import { DBOracle } from './db_oracle.js';
17
+ import { type NoteData, TypedOracle } from '../acvm/index.js';
18
+ import { type DBOracle } from './db_oracle.js';
19
19
  import { pickNotes } from './pick_notes.js';
20
20
 
21
21
  /**
@@ -1,4 +1,4 @@
1
- import { FailingFunction, NoirCallStack, SimulationError } from '@aztec/circuit-types';
1
+ import { type FailingFunction, type NoirCallStack, SimulationError } from '@aztec/circuit-types';
2
2
 
3
3
  /**
4
4
  * An error that occurred during the execution of a function.
package/src/public/db.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { NullifierMembershipWitness } from '@aztec/circuit-types';
2
- import { EthAddress, FunctionSelector, L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/circuits.js';
3
- import { AztecAddress } from '@aztec/foundation/aztec-address';
4
- import { Fr } from '@aztec/foundation/fields';
5
- import { ContractInstanceWithAddress } from '@aztec/types/contracts';
1
+ import { type NullifierMembershipWitness } from '@aztec/circuit-types';
2
+ import { type EthAddress, type FunctionSelector, type L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/circuits.js';
3
+ import { type AztecAddress } from '@aztec/foundation/aztec-address';
4
+ import { type Fr } from '@aztec/foundation/fields';
5
+ import { type ContractInstanceWithAddress } from '@aztec/types/contracts';
6
6
 
7
- import { MessageLoadOracleInputs } from '../acvm/index.js';
7
+ import { type MessageLoadOracleInputs } from '../acvm/index.js';
8
8
 
9
9
  /**
10
10
  * Database interface for providing access to public state.
@@ -1,16 +1,16 @@
1
- import { FunctionL2Logs, SimulationError } from '@aztec/circuit-types';
1
+ import { type SimulationError, type UnencryptedFunctionL2Logs } from '@aztec/circuit-types';
2
2
  import {
3
- AztecAddress,
4
- ContractStorageRead,
5
- ContractStorageUpdateRequest,
6
- Fr,
7
- L2ToL1Message,
8
- PublicCallRequest,
3
+ type AztecAddress,
4
+ type ContractStorageRead,
5
+ type ContractStorageUpdateRequest,
6
+ type Fr,
7
+ type L2ToL1Message,
8
+ type PublicCallRequest,
9
9
  PublicDataRead,
10
10
  PublicDataUpdateRequest,
11
- ReadRequest,
12
- SideEffect,
13
- SideEffectLinkedToNoteHash,
11
+ type ReadRequest,
12
+ type SideEffect,
13
+ type SideEffectLinkedToNoteHash,
14
14
  } from '@aztec/circuits.js';
15
15
  import { computePublicDataTreeLeafSlot, computePublicDataTreeValue } from '@aztec/circuits.js/hash';
16
16
 
@@ -46,7 +46,7 @@ export interface PublicExecutionResult {
46
46
  * Unencrypted logs emitted during execution of this function call.
47
47
  * Note: These are preimages to `unencryptedLogsHash`.
48
48
  */
49
- unencryptedLogs: FunctionL2Logs;
49
+ unencryptedLogs: UnencryptedFunctionL2Logs;
50
50
  /**
51
51
  * Whether the execution reverted.
52
52
  */
@@ -154,7 +154,7 @@ export function checkValidStaticCall(
154
154
  newNullifiers: SideEffectLinkedToNoteHash[],
155
155
  contractStorageUpdateRequests: ContractStorageUpdateRequest[],
156
156
  newL2ToL1Messages: L2ToL1Message[],
157
- unencryptedLogs: FunctionL2Logs,
157
+ unencryptedLogs: UnencryptedFunctionL2Logs,
158
158
  ) {
159
159
  if (
160
160
  contractStorageUpdateRequests.length > 0 ||
@@ -1,5 +1,5 @@
1
- import { FunctionL2Logs } from '@aztec/circuit-types';
2
- import { Fr, GlobalVariables, Header, PublicCircuitPublicInputs } from '@aztec/circuits.js';
1
+ import { UnencryptedFunctionL2Logs } from '@aztec/circuit-types';
2
+ import { Fr, type GlobalVariables, type Header, PublicCircuitPublicInputs } from '@aztec/circuits.js';
3
3
  import { createDebugLogger } from '@aztec/foundation/log';
4
4
 
5
5
  import { spawn } from 'child_process';
@@ -20,8 +20,8 @@ import { AcirSimulator } from '../client/simulator.js';
20
20
  import { ExecutionError, createSimulationError } from '../common/errors.js';
21
21
  import { SideEffectCounter } from '../common/index.js';
22
22
  import { PackedArgsCache } from '../common/packed_args_cache.js';
23
- import { CommitmentsDB, PublicContractsDB, PublicStateDB } from './db.js';
24
- import { PublicExecution, PublicExecutionResult, checkValidStaticCall } from './execution.js';
23
+ import { type CommitmentsDB, type PublicContractsDB, type PublicStateDB } from './db.js';
24
+ import { type PublicExecution, type PublicExecutionResult, checkValidStaticCall } from './execution.js';
25
25
  import { PublicExecutionContext } from './public_execution_context.js';
26
26
 
27
27
  /**
@@ -92,7 +92,7 @@ export async function executePublicFunction(
92
92
  contractStorageReads: [],
93
93
  contractStorageUpdateRequests: [],
94
94
  nestedExecutions: [],
95
- unencryptedLogs: FunctionL2Logs.empty(),
95
+ unencryptedLogs: UnencryptedFunctionL2Logs.empty(),
96
96
  reverted,
97
97
  revertReason,
98
98
  };
@@ -1,15 +1,25 @@
1
- import { FunctionL2Logs, NullifierMembershipWitness, UnencryptedL2Log } from '@aztec/circuit-types';
2
- import { CallContext, FunctionData, FunctionSelector, GlobalVariables, Header } from '@aztec/circuits.js';
3
- import { AztecAddress } from '@aztec/foundation/aztec-address';
1
+ import {
2
+ type NullifierMembershipWitness,
3
+ UnencryptedFunctionL2Logs,
4
+ type UnencryptedL2Log,
5
+ } from '@aztec/circuit-types';
6
+ import {
7
+ CallContext,
8
+ FunctionData,
9
+ type FunctionSelector,
10
+ type GlobalVariables,
11
+ type Header,
12
+ } from '@aztec/circuits.js';
13
+ import { type AztecAddress } from '@aztec/foundation/aztec-address';
4
14
  import { EthAddress } from '@aztec/foundation/eth-address';
5
15
  import { Fr } from '@aztec/foundation/fields';
6
16
  import { createDebugLogger } from '@aztec/foundation/log';
7
- import { ContractInstance } from '@aztec/types/contracts';
17
+ import { type ContractInstance } from '@aztec/types/contracts';
8
18
 
9
19
  import { TypedOracle, toACVMWitness } from '../acvm/index.js';
10
- import { PackedArgsCache, SideEffectCounter } from '../common/index.js';
11
- import { CommitmentsDB, PublicContractsDB, PublicStateDB } from './db.js';
12
- import { PublicExecution, PublicExecutionResult, checkValidStaticCall } from './execution.js';
20
+ import { type PackedArgsCache, type SideEffectCounter } from '../common/index.js';
21
+ import { type CommitmentsDB, type PublicContractsDB, type PublicStateDB } from './db.js';
22
+ import { type PublicExecution, type PublicExecutionResult, checkValidStaticCall } from './execution.js';
13
23
  import { executePublicFunction } from './executor.js';
14
24
  import { ContractStorageActionsCollector } from './state_actions.js';
15
25
 
@@ -72,7 +82,7 @@ export class PublicExecutionContext extends TypedOracle {
72
82
  * Return the encrypted logs emitted during this execution.
73
83
  */
74
84
  public getUnencryptedLogs() {
75
- return new FunctionL2Logs(this.unencryptedLogs.map(log => log.toBuffer()));
85
+ return new UnencryptedFunctionL2Logs(this.unencryptedLogs);
76
86
  }
77
87
 
78
88
  /**
@@ -1,8 +1,8 @@
1
1
  import { ContractStorageRead, ContractStorageUpdateRequest } from '@aztec/circuits.js';
2
- import { AztecAddress } from '@aztec/foundation/aztec-address';
2
+ import { type AztecAddress } from '@aztec/foundation/aztec-address';
3
3
  import { Fr } from '@aztec/foundation/fields';
4
4
 
5
- import { PublicStateDB } from './db.js';
5
+ import { type PublicStateDB } from './db.js';
6
6
 
7
7
  /**
8
8
  * Implements read/write operations on a contract public storage, collecting
@@ -1,11 +1,11 @@
1
1
  import { randomBytes } from '@aztec/foundation/crypto';
2
- import { NoirCompiledCircuit } from '@aztec/types/noir';
2
+ import { type NoirCompiledCircuit } from '@aztec/types/noir';
3
3
 
4
- import { WitnessMap } from '@noir-lang/types';
4
+ import { type WitnessMap } from '@noir-lang/types';
5
5
  import * as proc from 'child_process';
6
6
  import fs from 'fs/promises';
7
7
 
8
- import { SimulationProvider } from './simulation_provider.js';
8
+ import { type SimulationProvider } from './simulation_provider.js';
9
9
 
10
10
  /**
11
11
  * Parses a TOML format witness map string into a Map structure
@@ -1,9 +1,13 @@
1
- import { NoirCompiledCircuit } from '@aztec/types/noir';
1
+ import { type NoirCompiledCircuit } from '@aztec/types/noir';
2
2
 
3
- import { WasmBlackBoxFunctionSolver, createBlackBoxSolver, executeCircuitWithBlackBoxSolver } from '@noir-lang/acvm_js';
4
- import { WitnessMap } from '@noir-lang/types';
3
+ import {
4
+ type WasmBlackBoxFunctionSolver,
5
+ createBlackBoxSolver,
6
+ executeCircuitWithBlackBoxSolver,
7
+ } from '@noir-lang/acvm_js';
8
+ import { type WitnessMap } from '@noir-lang/types';
5
9
 
6
- import { SimulationProvider } from './simulation_provider.js';
10
+ import { type SimulationProvider } from './simulation_provider.js';
7
11
 
8
12
  let solver: Promise<WasmBlackBoxFunctionSolver>;
9
13
 
@@ -1,6 +1,6 @@
1
- import { NoirCompiledCircuit } from '@aztec/types/noir';
1
+ import { type NoirCompiledCircuit } from '@aztec/types/noir';
2
2
 
3
- import { WitnessMap } from '@noir-lang/types';
3
+ import { type WitnessMap } from '@noir-lang/types';
4
4
 
5
5
  /**
6
6
  * Low level simulation interface
package/src/test/utils.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { L1Actor, L1ToL2Message, L2Actor } from '@aztec/circuit-types';
2
- import { AztecAddress, EthAddress, Fr } from '@aztec/circuits.js';
2
+ import { type AztecAddress, EthAddress, type Fr } from '@aztec/circuits.js';
3
3
  import { computeMessageSecretHash } from '@aztec/circuits.js/hash';
4
4
  import { sha256ToField } from '@aztec/foundation/crypto';
5
5
 
@@ -20,8 +20,7 @@ export const buildL1ToL2Message = (
20
20
  // Write the selector into a buffer.
21
21
  const selectorBuf = Buffer.from(selector, 'hex');
22
22
 
23
- const contentBuf = Buffer.concat([selectorBuf, ...contentPreimage.map(field => field.toBuffer())]);
24
- const content = sha256ToField(contentBuf);
23
+ const content = sha256ToField([selectorBuf, ...contentPreimage]);
25
24
  const secretHash = computeMessageSecretHash(secret);
26
25
 
27
26
  // Eventually the kernel will need to prove the kernel portal pair exists within the contract tree,
package/src/utils.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { pedersenHash } from '@aztec/foundation/crypto';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { type Fr } from '@aztec/foundation/fields';
3
3
 
4
4
  /**
5
5
  * Computes the resulting storage slot for an entry in a mapping.
@@ -14,5 +14,5 @@ export function computeSlotForMapping(
14
14
  toField: () => Fr;
15
15
  },
16
16
  ) {
17
- return pedersenHash([mappingSlot, key.toField()].map(field => field.toBuffer()));
17
+ return pedersenHash([mappingSlot, key.toField()]);
18
18
  }