@aztec/simulator 0.87.4 → 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.
- package/dest/client.d.ts +5 -5
- package/dest/client.d.ts.map +1 -1
- package/dest/client.js +4 -4
- package/dest/private/acvm/acvm.d.ts +1 -2
- package/dest/private/acvm/acvm.d.ts.map +1 -1
- package/dest/private/acvm/index.d.ts +0 -1
- package/dest/private/acvm/index.d.ts.map +1 -1
- package/dest/private/acvm/index.js +0 -1
- package/dest/private/{providers/acvm_native.d.ts → acvm_native.d.ts} +4 -4
- package/dest/private/acvm_native.d.ts.map +1 -0
- package/dest/private/{providers/acvm_wasm.d.ts → acvm_wasm.d.ts} +4 -4
- package/dest/private/acvm_wasm.d.ts.map +1 -0
- package/dest/private/{providers/acvm_wasm.js → acvm_wasm.js} +2 -2
- package/dest/private/{providers/acvm_wasm_with_blobs.d.ts → acvm_wasm_with_blobs.d.ts} +5 -5
- package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -0
- package/dest/private/{providers/acvm_wasm_with_blobs.js → acvm_wasm_with_blobs.js} +2 -2
- package/dest/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.d.ts +2 -2
- package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -0
- package/dest/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.js +2 -3
- package/dest/private/{providers/circuit_recording → circuit_recording}/file_circuit_recorder.d.ts +1 -1
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -0
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -0
- package/dest/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.d.ts → circuit_recording/simulator_recorder_wrapper.d.ts} +7 -7
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -0
- package/dest/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.js → circuit_recording/simulator_recorder_wrapper.js} +2 -2
- package/dest/private/{providers/simulation_provider.d.ts → circuit_simulator.d.ts} +4 -4
- package/dest/private/circuit_simulator.d.ts.map +1 -0
- package/dest/private/{providers/simulation_provider.js → circuit_simulator.js} +1 -1
- package/dest/private/factory.d.ts +12 -0
- package/dest/private/factory.d.ts.map +1 -0
- package/dest/private/{providers/factory.js → factory.js} +2 -2
- package/dest/server.d.ts +6 -5
- package/dest/server.d.ts.map +1 -1
- package/dest/server.js +5 -4
- package/dest/testing.d.ts +1 -1
- package/dest/testing.d.ts.map +1 -1
- package/dest/testing.js +1 -1
- package/package.json +15 -15
- package/src/client.ts +5 -5
- package/src/private/acvm/acvm.ts +2 -3
- package/src/private/acvm/index.ts +0 -1
- package/src/private/{providers/acvm_native.ts → acvm_native.ts} +4 -4
- package/src/private/{providers/acvm_wasm.ts → acvm_wasm.ts} +4 -4
- package/src/private/{providers/acvm_wasm_with_blobs.ts → acvm_wasm_with_blobs.ts} +5 -5
- package/src/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.ts +4 -5
- package/src/private/{providers/circuit_recording → circuit_recording}/file_circuit_recorder.ts +1 -1
- package/src/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.ts → circuit_recording/simulator_recorder_wrapper.ts} +6 -6
- package/src/private/{providers/simulation_provider.ts → circuit_simulator.ts} +3 -3
- package/src/private/{providers/factory.ts → factory.ts} +6 -6
- package/src/server.ts +6 -5
- package/src/testing.ts +1 -1
- package/dest/private/acvm/oracle/index.d.ts +0 -14
- package/dest/private/acvm/oracle/index.d.ts.map +0 -1
- package/dest/private/acvm/oracle/index.js +0 -2
- package/dest/private/acvm/oracle/oracle.d.ts +0 -52
- package/dest/private/acvm/oracle/oracle.d.ts.map +0 -1
- package/dest/private/acvm/oracle/oracle.js +0 -312
- package/dest/private/acvm/oracle/typed_oracle.d.ts +0 -83
- package/dest/private/acvm/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/private/acvm/oracle/typed_oracle.js +0 -138
- package/dest/private/execution_data_provider.d.ts +0 -301
- package/dest/private/execution_data_provider.d.ts.map +0 -1
- package/dest/private/execution_data_provider.js +0 -14
- package/dest/private/execution_note_cache.d.ts +0 -93
- package/dest/private/execution_note_cache.d.ts.map +0 -1
- package/dest/private/execution_note_cache.js +0 -180
- package/dest/private/hashed_values_cache.d.ts +0 -28
- package/dest/private/hashed_values_cache.d.ts.map +0 -1
- package/dest/private/hashed_values_cache.js +0 -36
- package/dest/private/index.d.ts +0 -16
- package/dest/private/index.d.ts.map +0 -1
- package/dest/private/index.js +0 -15
- package/dest/private/message_load_oracle_inputs.d.ts +0 -19
- package/dest/private/message_load_oracle_inputs.d.ts.map +0 -1
- package/dest/private/message_load_oracle_inputs.js +0 -24
- package/dest/private/pick_notes.d.ts +0 -85
- package/dest/private/pick_notes.d.ts.map +0 -1
- package/dest/private/pick_notes.js +0 -51
- package/dest/private/private_execution.d.ts +0 -25
- package/dest/private/private_execution.d.ts.map +0 -1
- package/dest/private/private_execution.js +0 -96
- package/dest/private/private_execution_oracle.d.ts +0 -187
- package/dest/private/private_execution_oracle.d.ts.map +0 -1
- package/dest/private/private_execution_oracle.js +0 -318
- package/dest/private/providers/acvm_native.d.ts.map +0 -1
- package/dest/private/providers/acvm_wasm.d.ts.map +0 -1
- package/dest/private/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
- package/dest/private/providers/circuit_recording/circuit_recorder.d.ts.map +0 -1
- package/dest/private/providers/circuit_recording/file_circuit_recorder.d.ts.map +0 -1
- package/dest/private/providers/circuit_recording/memory_circuit_recorder.d.ts.map +0 -1
- package/dest/private/providers/circuit_recording/simulation_provider_recorder_wrapper.d.ts.map +0 -1
- package/dest/private/providers/factory.d.ts +0 -12
- package/dest/private/providers/factory.d.ts.map +0 -1
- package/dest/private/providers/simulation_provider.d.ts.map +0 -1
- package/dest/private/simulator.d.ts +0 -36
- package/dest/private/simulator.d.ts.map +0 -1
- package/dest/private/simulator.js +0 -104
- package/dest/private/utility_execution_oracle.d.ts +0 -163
- package/dest/private/utility_execution_oracle.d.ts.map +0 -1
- package/dest/private/utility_execution_oracle.js +0 -257
- package/dest/test/utils.d.ts +0 -13
- package/dest/test/utils.d.ts.map +0 -1
- package/dest/test/utils.js +0 -22
- package/src/private/acvm/oracle/index.ts +0 -16
- package/src/private/acvm/oracle/oracle.ts +0 -523
- package/src/private/acvm/oracle/typed_oracle.ts +0 -273
- package/src/private/execution_data_provider.ts +0 -388
- package/src/private/execution_note_cache.ts +0 -217
- package/src/private/hashed_values_cache.ts +0 -47
- package/src/private/index.ts +0 -19
- package/src/private/message_load_oracle_inputs.ts +0 -23
- package/src/private/pick_notes.ts +0 -141
- package/src/private/private_execution.ts +0 -160
- package/src/private/private_execution_oracle.ts +0 -508
- package/src/private/simulator.ts +0 -170
- package/src/private/utility_execution_oracle.ts +0 -384
- package/src/test/utils.ts +0 -36
- /package/dest/private/{providers/acvm_native.js → acvm_native.js} +0 -0
- /package/dest/private/{providers/circuit_recording → circuit_recording}/file_circuit_recorder.js +0 -0
- /package/dest/private/{providers/circuit_recording → circuit_recording}/memory_circuit_recorder.d.ts +0 -0
- /package/dest/private/{providers/circuit_recording → circuit_recording}/memory_circuit_recorder.js +0 -0
- /package/src/private/{providers/circuit_recording → circuit_recording}/memory_circuit_recorder.ts +0 -0
package/dest/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './private/index.js';
|
|
2
|
-
export { WASMSimulator } from './private/
|
|
3
|
-
export {
|
|
4
|
-
export { MemoryCircuitRecorder } from './private/
|
|
5
|
-
export { type
|
|
1
|
+
export * from './private/acvm/index.js';
|
|
2
|
+
export { WASMSimulator } from './private/acvm_wasm.js';
|
|
3
|
+
export { SimulatorRecorderWrapper } from './private/circuit_recording/simulator_recorder_wrapper.js';
|
|
4
|
+
export { MemoryCircuitRecorder } from './private/circuit_recording/memory_circuit_recorder.js';
|
|
5
|
+
export { type CircuitSimulator, type DecodedError } from './private/circuit_simulator.js';
|
|
6
6
|
export * from './common/index.js';
|
|
7
7
|
//# sourceMappingURL=client.d.ts.map
|
package/dest/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AACrG,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC1F,cAAc,mBAAmB,CAAC"}
|
package/dest/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './private/index.js';
|
|
2
|
-
export { WASMSimulator } from './private/
|
|
3
|
-
export {
|
|
4
|
-
export { MemoryCircuitRecorder } from './private/
|
|
1
|
+
export * from './private/acvm/index.js';
|
|
2
|
+
export { WASMSimulator } from './private/acvm_wasm.js';
|
|
3
|
+
export { SimulatorRecorderWrapper } from './private/circuit_recording/simulator_recorder_wrapper.js';
|
|
4
|
+
export { MemoryCircuitRecorder } from './private/circuit_recording/memory_circuit_recorder.js';
|
|
5
5
|
export * from './common/index.js';
|
|
@@ -2,11 +2,10 @@ import { type ExecutionError, type ForeignCallInput, type ForeignCallOutput } fr
|
|
|
2
2
|
import type { FunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
3
3
|
import type { NoirCallStack } from '@aztec/stdlib/errors';
|
|
4
4
|
import type { ACVMWitness } from './acvm_types.js';
|
|
5
|
-
import type { ORACLE_NAMES } from './oracle/index.js';
|
|
6
5
|
/**
|
|
7
6
|
* The callback interface for the ACIR.
|
|
8
7
|
*/
|
|
9
|
-
export type ACIRCallback = Record<
|
|
8
|
+
export type ACIRCallback = Record<string, (...args: ForeignCallInput[]) => Promise<ForeignCallOutput[]>>;
|
|
10
9
|
export type ACIRCallbackStats = {
|
|
11
10
|
times: number[];
|
|
12
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acvm.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/acvm.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"acvm.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/acvm.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,gBAAgB,EAAE,KAAK,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;AAEzG,MAAM,MAAM,iBAAiB,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC;IAC5B,aAAa,EAAE,WAAW,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,WAAW,EAC3B,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAwC9B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,GAAG,cAAc,EAC7B,KAAK,CAAC,EAAE,qBAAqB,GAC5B,aAAa,GAAG,SAAS,CAc3B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { extractCallStack, type ACIRCallback, type ACIRExecutionResult } from './acvm.js';
|
|
2
2
|
export * from './acvm_types.js';
|
|
3
3
|
export * from './deserialize.js';
|
|
4
|
-
export * from './oracle/index.js';
|
|
5
4
|
export * from './serialize.js';
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC1F,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC1F,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -2,9 +2,9 @@ import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
|
2
2
|
import type { ForeignCallHandler } from '@aztec/noir-protocol-circuits-types/types';
|
|
3
3
|
import type { FunctionArtifactWithContractName } from '@aztec/stdlib/abi';
|
|
4
4
|
import type { NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
5
|
-
import type { ACIRCallback, ACIRExecutionResult } from '
|
|
6
|
-
import type { ACVMWitness } from '
|
|
7
|
-
import type {
|
|
5
|
+
import type { ACIRCallback, ACIRExecutionResult } from './acvm/acvm.js';
|
|
6
|
+
import type { ACVMWitness } from './acvm/acvm_types.js';
|
|
7
|
+
import type { CircuitSimulator } from './circuit_simulator.js';
|
|
8
8
|
export declare enum ACVM_RESULT {
|
|
9
9
|
SUCCESS = 0,
|
|
10
10
|
FAILURE = 1
|
|
@@ -29,7 +29,7 @@ export type ACVMResult = ACVMSuccess | ACVMFailure;
|
|
|
29
29
|
* @returns The completed partial witness outputted from the circuit
|
|
30
30
|
*/
|
|
31
31
|
export declare function executeNativeCircuit(inputWitness: WitnessMap, bytecode: Buffer, workingDirectory: string, pathToAcvm: string, outputFilename?: string): Promise<ACVMResult>;
|
|
32
|
-
export declare class NativeACVMSimulator implements
|
|
32
|
+
export declare class NativeACVMSimulator implements CircuitSimulator {
|
|
33
33
|
private workingDirectory;
|
|
34
34
|
private pathToAcvm;
|
|
35
35
|
private witnessFilename?;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acvm_native.d.ts","sourceRoot":"","sources":["../../src/private/acvm_native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAKtE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,oBAAY,WAAW;IACrB,OAAO,IAAA;IACP,OAAO,IAAA;CACR;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AAmBnD;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,UAAU,EACxB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,UAAU,CAAC,CAsErB;AAED,qBAAa,mBAAoB,YAAW,gBAAgB;IAExD,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,eAAe,CAAC;gBAFhB,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,YAAA;IAG5B,sBAAsB,CAC1B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,OAAO,CAAC,WAAW,CAAC;IA6BvB,kBAAkB,CAChB,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,gCAAgC,EAC3C,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,mBAAmB,CAAC;CAGhC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ForeignCallHandler } from '@aztec/noir-acvm_js';
|
|
2
2
|
import type { FunctionArtifactWithContractName } from '@aztec/stdlib/abi';
|
|
3
3
|
import type { NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
4
|
-
import { type ACIRCallback, type ACIRExecutionResult } from '
|
|
5
|
-
import type { ACVMWitness } from '
|
|
4
|
+
import { type ACIRCallback, type ACIRExecutionResult } from './acvm/acvm.js';
|
|
5
|
+
import type { ACVMWitness } from './acvm/acvm_types.js';
|
|
6
6
|
import type { ACVMSuccess } from './acvm_native.js';
|
|
7
|
-
import { type
|
|
8
|
-
export declare class WASMSimulator implements
|
|
7
|
+
import { type CircuitSimulator } from './circuit_simulator.js';
|
|
8
|
+
export declare class WASMSimulator implements CircuitSimulator {
|
|
9
9
|
protected log: import("@aztec/foundation/log").Logger;
|
|
10
10
|
constructor(log?: import("@aztec/foundation/log").Logger);
|
|
11
11
|
init(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acvm_wasm.d.ts","sourceRoot":"","sources":["../../src/private/acvm_wasm.ts"],"names":[],"mappings":"AAEA,OAAiB,EAAuB,KAAK,kBAAkB,EAAkB,MAAM,qBAAqB,CAAC;AAE7G,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAQ,MAAM,gBAAgB,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAmB,MAAM,wBAAwB,CAAC;AAEhF,qBAAa,aAAc,YAAW,gBAAgB;IACxC,SAAS,CAAC,GAAG;gBAAH,GAAG,yCAAiC;IAEpD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrB,sBAAsB,CAC1B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC;IAkCjB,kBAAkB,CACtB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,gCAAgC,EAC1C,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC;CAIhC"}
|
|
@@ -2,8 +2,8 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
2
2
|
import { Timer } from '@aztec/foundation/timer';
|
|
3
3
|
import initACVM, { executeCircuit } from '@aztec/noir-acvm_js';
|
|
4
4
|
import initAbi from '@aztec/noir-noirc_abi';
|
|
5
|
-
import { acvm } from '
|
|
6
|
-
import { enrichNoirError } from './
|
|
5
|
+
import { acvm } from './acvm/acvm.js';
|
|
6
|
+
import { enrichNoirError } from './circuit_simulator.js';
|
|
7
7
|
export class WASMSimulator {
|
|
8
8
|
log;
|
|
9
9
|
constructor(log = createLogger('wasm-simulator')){
|
|
@@ -2,18 +2,18 @@ import { type ForeignCallHandler } from '@aztec/noir-acvm_js';
|
|
|
2
2
|
import type { WitnessMap } from '@aztec/noir-types';
|
|
3
3
|
import type { FunctionArtifactWithContractName } from '@aztec/stdlib/abi';
|
|
4
4
|
import type { NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
5
|
-
import type { ACIRCallback, ACIRExecutionResult } from '
|
|
6
|
-
import type { ACVMWitness } from '
|
|
5
|
+
import type { ACIRCallback, ACIRExecutionResult } from './acvm/acvm.js';
|
|
6
|
+
import type { ACVMWitness } from './acvm/acvm_types.js';
|
|
7
7
|
import type { ACVMSuccess } from './acvm_native.js';
|
|
8
|
-
import { type
|
|
8
|
+
import { type CircuitSimulator } from './circuit_simulator.js';
|
|
9
9
|
/**
|
|
10
|
-
* A
|
|
10
|
+
* A circuit simulator that uses the WASM simulator with the ability to handle blobs via the foreign call handler.
|
|
11
11
|
* This class is temporary while brillig cannot handle the blob math, and it is kept separate
|
|
12
12
|
* because the zkg commitment library used in the blob code is not browser compatible.
|
|
13
13
|
*
|
|
14
14
|
* It is only used in the context of server-side code executing simulated protocol circuits.
|
|
15
15
|
*/
|
|
16
|
-
export declare class WASMSimulatorWithBlobs implements
|
|
16
|
+
export declare class WASMSimulatorWithBlobs implements CircuitSimulator {
|
|
17
17
|
executeProtocolCircuit(input: WitnessMap, artifact: NoirCompiledCircuitWithName, callback: ForeignCallHandler): Promise<ACVMSuccess>;
|
|
18
18
|
executeUserCircuit(_input: ACVMWitness, _artifact: FunctionArtifactWithContractName, _callback: ACIRCallback): Promise<ACIRExecutionResult>;
|
|
19
19
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acvm_wasm_with_blobs.d.ts","sourceRoot":"","sources":["../../src/private/acvm_wasm_with_blobs.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,kBAAkB,EAAkB,MAAM,qBAAqB,CAAC;AACnG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAmB,MAAM,wBAAwB,CAAC;AAEhF;;;;;;GAMG;AACH,qBAAa,sBAAuB,YAAW,gBAAgB;IACvD,sBAAsB,CAC1B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC;IAuBvB,kBAAkB,CAChB,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,gCAAgC,EAC3C,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,mBAAmB,CAAC;CAGhC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Timer } from '@aztec/foundation/timer';
|
|
2
2
|
import { executeCircuit } from '@aztec/noir-acvm_js';
|
|
3
|
-
import { enrichNoirError } from './
|
|
3
|
+
import { enrichNoirError } from './circuit_simulator.js';
|
|
4
4
|
/**
|
|
5
|
-
* A
|
|
5
|
+
* A circuit simulator that uses the WASM simulator with the ability to handle blobs via the foreign call handler.
|
|
6
6
|
* This class is temporary while brillig cannot handle the blob math, and it is kept separate
|
|
7
7
|
* because the zkg commitment library used in the blob code is not browser compatible.
|
|
8
8
|
*
|
package/dest/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ForeignCallHandler } from '@aztec/noir-acvm_js';
|
|
2
|
-
import type { ACIRCallback } from '
|
|
3
|
-
import type { ACVMWitness } from '
|
|
2
|
+
import type { ACIRCallback } from '../acvm/acvm.js';
|
|
3
|
+
import type { ACVMWitness } from '../acvm/acvm_types.js';
|
|
4
4
|
export type OracleCall = {
|
|
5
5
|
name: string;
|
|
6
6
|
inputs: unknown[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuit_recorder.d.ts","sourceRoot":"","sources":["../../../src/private/circuit_recording/circuit_recorder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAuC,MAAM,qBAAqB,CAAC;AAEnG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IAMb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,gBAAgB,CAAC;gBAEd,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IASjH,SAAS,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,IAAI;CAG9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,qBAAa,eAAe;;IAC1B,SAAS,CAAC,QAAQ,CAAC,MAAM,yCAA4C;IAErE,SAAS,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAEvC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAiB;IAEnC,SAAS;IAET;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5G;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,kBAAkB,GAAG,SAAS,GAAG,YAAY,GAAG,kBAAkB,GAAG,SAAS;IAqFpH;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAYpH;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAUnC;;;OAGG;IACH,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAU3D"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { sha512 } from '@aztec/foundation/crypto';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
4
|
-
import { Oracle } from '../../acvm/oracle/oracle.js';
|
|
5
4
|
export class CircuitRecording {
|
|
6
5
|
circuitName;
|
|
7
6
|
functionName;
|
|
@@ -113,10 +112,10 @@ export class CircuitRecording {
|
|
|
113
112
|
* @returns A wrapped callback that records all oracle interactions which is to be provided to the ACVM.
|
|
114
113
|
*/ #wrapUserCircuitCallback(callback) {
|
|
115
114
|
const recordingCallback = {};
|
|
116
|
-
const oracleMethods = Object.
|
|
115
|
+
const oracleMethods = Object.keys(callback);
|
|
117
116
|
for (const name of oracleMethods){
|
|
118
117
|
const fn = callback[name];
|
|
119
|
-
if (!fn) {
|
|
118
|
+
if (!fn || typeof fn !== 'function') {
|
|
120
119
|
throw new Error(`Oracle method ${name} not found when setting up recording callback`);
|
|
121
120
|
}
|
|
122
121
|
const isExternalCall = name === 'callPrivateFunction';
|
package/dest/private/{providers/circuit_recording → circuit_recording}/file_circuit_recorder.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ACVMWitness } from '
|
|
1
|
+
import type { ACVMWitness } from '../acvm/acvm_types.js';
|
|
2
2
|
import { CircuitRecorder, type CircuitRecording } from './circuit_recorder.js';
|
|
3
3
|
export declare class FileCircuitRecorder extends CircuitRecorder {
|
|
4
4
|
#private;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file_circuit_recorder.d.ts","sourceRoot":"","sources":["../../../src/private/circuit_recording/file_circuit_recorder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,qBAAa,mBAAoB,SAAQ,eAAe;;IAG1C,OAAO,CAAC,QAAQ,CAAC,SAAS;IAF9B,SAAS,CAAC,EAAE,gBAAgB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;gBAErD,SAAS,EAAE,MAAM;IAI/B,KAAK,CAClB,KAAK,EAAE,WAAW,EAClB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,YAAY,GAAE,MAAe;IAqE/B;;;;;OAKG;IACY,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAY7G;;;OAGG;IACY,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAalD;;;;OAIG;IACY,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAc1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory_circuit_recorder.d.ts","sourceRoot":"","sources":["../../../src/private/circuit_recording/memory_circuit_recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,qBAAa,qBAAsB,SAAQ,eAAe;;CAIzD"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { ForeignCallHandler } from '@aztec/noir-protocol-circuits-types/types';
|
|
2
2
|
import type { FunctionArtifactWithContractName } from '@aztec/stdlib/abi';
|
|
3
3
|
import type { NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
4
|
-
import type { ACIRCallback, ACIRExecutionResult } from '
|
|
5
|
-
import type { ACVMWitness } from '
|
|
4
|
+
import type { ACIRCallback, ACIRExecutionResult } from '../acvm/acvm.js';
|
|
5
|
+
import type { ACVMWitness } from '../acvm/acvm_types.js';
|
|
6
6
|
import type { ACVMSuccess } from '../acvm_native.js';
|
|
7
|
-
import type {
|
|
7
|
+
import type { CircuitSimulator } from '../circuit_simulator.js';
|
|
8
8
|
import type { CircuitRecorder } from './circuit_recorder.js';
|
|
9
9
|
/**
|
|
10
|
-
* Takes a
|
|
10
|
+
* Takes a circuit simulator and wraps it in a circuit recorder. See CircuitRecorder for more details on how circuit
|
|
11
11
|
* recording works.
|
|
12
12
|
*/
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class SimulatorRecorderWrapper implements CircuitSimulator {
|
|
14
14
|
#private;
|
|
15
15
|
private simulator;
|
|
16
16
|
private recorder;
|
|
17
|
-
constructor(simulator:
|
|
17
|
+
constructor(simulator: CircuitSimulator, recorder: CircuitRecorder);
|
|
18
18
|
executeProtocolCircuit(input: ACVMWitness, artifact: NoirCompiledCircuitWithName, callback: ForeignCallHandler | undefined): Promise<ACVMSuccess>;
|
|
19
19
|
executeUserCircuit(input: ACVMWitness, artifact: FunctionArtifactWithContractName, callback: ACIRCallback): Promise<ACIRExecutionResult>;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=simulator_recorder_wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulator_recorder_wrapper.d.ts","sourceRoot":"","sources":["../../../src/private/circuit_recording/simulator_recorder_wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAqB,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,gBAAgB;;IAE7D,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,QAAQ;gBADR,SAAS,EAAE,gBAAgB,EAC3B,QAAQ,EAAE,eAAe;IAGnC,sBAAsB,CACpB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,OAAO,CAAC,WAAW,CAAC;IAavB,kBAAkB,CAChB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,gCAAgC,EAC1C,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC;CAiDhC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Takes a
|
|
2
|
+
* Takes a circuit simulator and wraps it in a circuit recorder. See CircuitRecorder for more details on how circuit
|
|
3
3
|
* recording works.
|
|
4
|
-
*/ export class
|
|
4
|
+
*/ export class SimulatorRecorderWrapper {
|
|
5
5
|
simulator;
|
|
6
6
|
recorder;
|
|
7
7
|
constructor(simulator, recorder){
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ExecutionError, ForeignCallHandler } from '@aztec/noir-acvm_js';
|
|
2
2
|
import type { FunctionArtifactWithContractName } from '@aztec/stdlib/abi';
|
|
3
3
|
import type { NoirCompiledCircuit, NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
4
|
-
import { type ACIRCallback, type ACIRExecutionResult } from '
|
|
5
|
-
import type { ACVMWitness } from '
|
|
4
|
+
import { type ACIRCallback, type ACIRExecutionResult } from './acvm/acvm.js';
|
|
5
|
+
import type { ACVMWitness } from './acvm/acvm_types.js';
|
|
6
6
|
import type { ACVMSuccess } from './acvm_native.js';
|
|
7
7
|
/**
|
|
8
8
|
* Low level simulation interface
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface CircuitSimulator {
|
|
11
11
|
/**
|
|
12
12
|
* Execute a protocol circuit/generate a witness
|
|
13
13
|
* @param input - The initial witness map defining all of the inputs to `circuit`.
|
|
@@ -32,4 +32,4 @@ export type DecodedError = ExecutionError & {
|
|
|
32
32
|
noirCallStack?: string[];
|
|
33
33
|
};
|
|
34
34
|
export declare function enrichNoirError(artifact: NoirCompiledCircuit, originalError: ExecutionError): DecodedError;
|
|
35
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=circuit_simulator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuit_simulator.d.ts","sourceRoot":"","sources":["../../src/private/circuit_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAoB,MAAM,gBAAgB,CAAC;AAC/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,sBAAsB,CACpB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,kBAAkB,CAChB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,gCAAgC,EAC1C,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC;AAED,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG;IAAE,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAIxG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,GAAG,YAAY,CA0C1G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { abiDecodeError } from '@aztec/noir-noirc_abi';
|
|
2
2
|
import { parseDebugSymbols } from '@aztec/stdlib/abi';
|
|
3
|
-
import { extractCallStack } from '
|
|
3
|
+
import { extractCallStack } from './acvm/acvm.js';
|
|
4
4
|
// Payload parsing taken from noir/noir-repo/tooling/noir_js/src/witness_generation.ts.
|
|
5
5
|
// TODO: import this in isolation without having to import noir_js in its entirety.
|
|
6
6
|
export function enrichNoirError(artifact, originalError) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
+
import type { CircuitSimulator } from './circuit_simulator.js';
|
|
3
|
+
export type SimulatorConfig = {
|
|
4
|
+
acvmBinaryPath?: string;
|
|
5
|
+
acvmWorkingDirectory?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function getSimulatorConfigFromEnv(): {
|
|
8
|
+
acvmWorkingDirectory: string | undefined;
|
|
9
|
+
acvmBinaryPath: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function createSimulator(config: SimulatorConfig, logger?: Logger): Promise<CircuitSimulator>;
|
|
12
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/private/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAMlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,wBAAgB,yBAAyB;;;EAMxC;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,MAAM,GAAE,MAAkC,GACzC,OAAO,CAAC,gBAAgB,CAAC,CAa3B"}
|
|
@@ -2,14 +2,14 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
2
2
|
import { promises as fs } from 'fs';
|
|
3
3
|
import { NativeACVMSimulator } from './acvm_native.js';
|
|
4
4
|
import { WASMSimulator } from './acvm_wasm.js';
|
|
5
|
-
export function
|
|
5
|
+
export function getSimulatorConfigFromEnv() {
|
|
6
6
|
const { ACVM_BINARY_PATH, ACVM_WORKING_DIRECTORY } = process.env;
|
|
7
7
|
return {
|
|
8
8
|
acvmWorkingDirectory: ACVM_WORKING_DIRECTORY ? ACVM_WORKING_DIRECTORY : undefined,
|
|
9
9
|
acvmBinaryPath: ACVM_BINARY_PATH ? ACVM_BINARY_PATH : undefined
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
export async function
|
|
12
|
+
export async function createSimulator(config, logger = createLogger('simulator')) {
|
|
13
13
|
if (config.acvmBinaryPath && config.acvmWorkingDirectory) {
|
|
14
14
|
try {
|
|
15
15
|
await fs.access(config.acvmBinaryPath, fs.constants.R_OK);
|
package/dest/server.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './public/index.js';
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
2
|
+
export * from './private/acvm/index.js';
|
|
3
|
+
export { WASMSimulatorWithBlobs } from './private/acvm_wasm_with_blobs.js';
|
|
4
|
+
export { NativeACVMSimulator } from './private/acvm_native.js';
|
|
5
|
+
export { SimulatorRecorderWrapper } from './private/circuit_recording/simulator_recorder_wrapper.js';
|
|
6
|
+
export { MemoryCircuitRecorder } from './private/circuit_recording/memory_circuit_recorder.js';
|
|
7
|
+
export { type CircuitSimulator, type DecodedError } from './private/circuit_simulator.js';
|
|
7
8
|
export * from './common/index.js';
|
|
8
9
|
//# sourceMappingURL=server.d.ts.map
|
package/dest/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AACrG,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC1F,cAAc,mBAAmB,CAAC"}
|
package/dest/server.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './public/index.js';
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
2
|
+
export * from './private/acvm/index.js';
|
|
3
|
+
export { WASMSimulatorWithBlobs } from './private/acvm_wasm_with_blobs.js';
|
|
4
|
+
export { NativeACVMSimulator } from './private/acvm_native.js';
|
|
5
|
+
export { SimulatorRecorderWrapper } from './private/circuit_recording/simulator_recorder_wrapper.js';
|
|
6
|
+
export { MemoryCircuitRecorder } from './private/circuit_recording/memory_circuit_recorder.js';
|
|
6
7
|
export * from './common/index.js';
|
package/dest/testing.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { FileCircuitRecorder } from './private/
|
|
1
|
+
export { FileCircuitRecorder } from './private/circuit_recording/file_circuit_recorder.js';
|
|
2
2
|
//# sourceMappingURL=testing.d.ts.map
|
package/dest/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC"}
|
package/dest/testing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FileCircuitRecorder } from './private/
|
|
1
|
+
export { FileCircuitRecorder } from './private/circuit_recording/file_circuit_recorder.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/simulator",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/server.js",
|
|
@@ -58,25 +58,25 @@
|
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@aztec/constants": "0.87.
|
|
62
|
-
"@aztec/foundation": "0.87.
|
|
63
|
-
"@aztec/noir-acvm_js": "0.87.
|
|
64
|
-
"@aztec/noir-noirc_abi": "0.87.
|
|
65
|
-
"@aztec/noir-protocol-circuits-types": "0.87.
|
|
66
|
-
"@aztec/noir-types": "0.87.
|
|
67
|
-
"@aztec/protocol-contracts": "0.87.
|
|
68
|
-
"@aztec/stdlib": "0.87.
|
|
69
|
-
"@aztec/telemetry-client": "0.87.
|
|
70
|
-
"@aztec/world-state": "0.87.
|
|
61
|
+
"@aztec/constants": "0.87.6",
|
|
62
|
+
"@aztec/foundation": "0.87.6",
|
|
63
|
+
"@aztec/noir-acvm_js": "0.87.6",
|
|
64
|
+
"@aztec/noir-noirc_abi": "0.87.6",
|
|
65
|
+
"@aztec/noir-protocol-circuits-types": "0.87.6",
|
|
66
|
+
"@aztec/noir-types": "0.87.6",
|
|
67
|
+
"@aztec/protocol-contracts": "0.87.6",
|
|
68
|
+
"@aztec/stdlib": "0.87.6",
|
|
69
|
+
"@aztec/telemetry-client": "0.87.6",
|
|
70
|
+
"@aztec/world-state": "0.87.6",
|
|
71
71
|
"lodash.clonedeep": "^4.5.0",
|
|
72
72
|
"lodash.merge": "^4.6.2",
|
|
73
73
|
"tslib": "^2.4.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@aztec/kv-store": "0.87.
|
|
77
|
-
"@aztec/merkle-tree": "0.87.
|
|
78
|
-
"@aztec/noir-contracts.js": "0.87.
|
|
79
|
-
"@aztec/noir-test-contracts.js": "0.87.
|
|
76
|
+
"@aztec/kv-store": "0.87.6",
|
|
77
|
+
"@aztec/merkle-tree": "0.87.6",
|
|
78
|
+
"@aztec/noir-contracts.js": "0.87.6",
|
|
79
|
+
"@aztec/noir-test-contracts.js": "0.87.6",
|
|
80
80
|
"@jest/globals": "^29.5.0",
|
|
81
81
|
"@types/jest": "^29.5.0",
|
|
82
82
|
"@types/lodash.clonedeep": "^4.5.7",
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './private/index.js';
|
|
2
|
-
export { WASMSimulator } from './private/
|
|
3
|
-
export {
|
|
4
|
-
export { MemoryCircuitRecorder } from './private/
|
|
5
|
-
export { type
|
|
1
|
+
export * from './private/acvm/index.js';
|
|
2
|
+
export { WASMSimulator } from './private/acvm_wasm.js';
|
|
3
|
+
export { SimulatorRecorderWrapper } from './private/circuit_recording/simulator_recorder_wrapper.js';
|
|
4
|
+
export { MemoryCircuitRecorder } from './private/circuit_recording/memory_circuit_recorder.js';
|
|
5
|
+
export { type CircuitSimulator, type DecodedError } from './private/circuit_simulator.js';
|
|
6
6
|
export * from './common/index.js';
|
package/src/private/acvm/acvm.ts
CHANGED
|
@@ -10,12 +10,11 @@ import type { NoirCallStack } from '@aztec/stdlib/errors';
|
|
|
10
10
|
|
|
11
11
|
import { resolveOpcodeLocations, traverseCauseChain } from '../../common/errors.js';
|
|
12
12
|
import type { ACVMWitness } from './acvm_types.js';
|
|
13
|
-
import type { ORACLE_NAMES } from './oracle/index.js';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* The callback interface for the ACIR.
|
|
17
16
|
*/
|
|
18
|
-
export type ACIRCallback = Record<
|
|
17
|
+
export type ACIRCallback = Record<string, (...args: ForeignCallInput[]) => Promise<ForeignCallOutput[]>>;
|
|
19
18
|
|
|
20
19
|
export type ACIRCallbackStats = { times: number[] };
|
|
21
20
|
|
|
@@ -54,7 +53,7 @@ export async function acvm(
|
|
|
54
53
|
(name: string, args: ForeignCallInput[]) => {
|
|
55
54
|
try {
|
|
56
55
|
logger.debug(`Oracle callback ${name}`);
|
|
57
|
-
const oracleFunction = callback[name
|
|
56
|
+
const oracleFunction = callback[name];
|
|
58
57
|
if (!oracleFunction) {
|
|
59
58
|
throw new Error(`Oracle callback ${name} not found`);
|
|
60
59
|
}
|
|
@@ -9,9 +9,9 @@ import type { NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
|
9
9
|
import * as proc from 'child_process';
|
|
10
10
|
import { promises as fs } from 'fs';
|
|
11
11
|
|
|
12
|
-
import type { ACIRCallback, ACIRExecutionResult } from '
|
|
13
|
-
import type { ACVMWitness } from '
|
|
14
|
-
import type {
|
|
12
|
+
import type { ACIRCallback, ACIRExecutionResult } from './acvm/acvm.js';
|
|
13
|
+
import type { ACVMWitness } from './acvm/acvm_types.js';
|
|
14
|
+
import type { CircuitSimulator } from './circuit_simulator.js';
|
|
15
15
|
|
|
16
16
|
const logger = createLogger('simulator:acvm-native');
|
|
17
17
|
|
|
@@ -137,7 +137,7 @@ export async function executeNativeCircuit(
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
export class NativeACVMSimulator implements
|
|
140
|
+
export class NativeACVMSimulator implements CircuitSimulator {
|
|
141
141
|
constructor(
|
|
142
142
|
private workingDirectory: string,
|
|
143
143
|
private pathToAcvm: string,
|
|
@@ -5,12 +5,12 @@ import initAbi from '@aztec/noir-noirc_abi';
|
|
|
5
5
|
import type { FunctionArtifactWithContractName } from '@aztec/stdlib/abi';
|
|
6
6
|
import type { NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
7
7
|
|
|
8
|
-
import { type ACIRCallback, type ACIRExecutionResult, acvm } from '
|
|
9
|
-
import type { ACVMWitness } from '
|
|
8
|
+
import { type ACIRCallback, type ACIRExecutionResult, acvm } from './acvm/acvm.js';
|
|
9
|
+
import type { ACVMWitness } from './acvm/acvm_types.js';
|
|
10
10
|
import type { ACVMSuccess } from './acvm_native.js';
|
|
11
|
-
import { type
|
|
11
|
+
import { type CircuitSimulator, enrichNoirError } from './circuit_simulator.js';
|
|
12
12
|
|
|
13
|
-
export class WASMSimulator implements
|
|
13
|
+
export class WASMSimulator implements CircuitSimulator {
|
|
14
14
|
constructor(protected log = createLogger('wasm-simulator')) {}
|
|
15
15
|
|
|
16
16
|
async init(): Promise<void> {
|
|
@@ -4,19 +4,19 @@ import type { WitnessMap } from '@aztec/noir-types';
|
|
|
4
4
|
import type { FunctionArtifactWithContractName } from '@aztec/stdlib/abi';
|
|
5
5
|
import type { NoirCompiledCircuitWithName } from '@aztec/stdlib/noir';
|
|
6
6
|
|
|
7
|
-
import type { ACIRCallback, ACIRExecutionResult } from '
|
|
8
|
-
import type { ACVMWitness } from '
|
|
7
|
+
import type { ACIRCallback, ACIRExecutionResult } from './acvm/acvm.js';
|
|
8
|
+
import type { ACVMWitness } from './acvm/acvm_types.js';
|
|
9
9
|
import type { ACVMSuccess } from './acvm_native.js';
|
|
10
|
-
import { type
|
|
10
|
+
import { type CircuitSimulator, enrichNoirError } from './circuit_simulator.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* A
|
|
13
|
+
* A circuit simulator that uses the WASM simulator with the ability to handle blobs via the foreign call handler.
|
|
14
14
|
* This class is temporary while brillig cannot handle the blob math, and it is kept separate
|
|
15
15
|
* because the zkg commitment library used in the blob code is not browser compatible.
|
|
16
16
|
*
|
|
17
17
|
* It is only used in the context of server-side code executing simulated protocol circuits.
|
|
18
18
|
*/
|
|
19
|
-
export class WASMSimulatorWithBlobs implements
|
|
19
|
+
export class WASMSimulatorWithBlobs implements CircuitSimulator {
|
|
20
20
|
async executeProtocolCircuit(
|
|
21
21
|
input: WitnessMap,
|
|
22
22
|
artifact: NoirCompiledCircuitWithName,
|
|
@@ -3,9 +3,8 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
3
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
4
4
|
import type { ForeignCallHandler, ForeignCallInput, ForeignCallOutput } from '@aztec/noir-acvm_js';
|
|
5
5
|
|
|
6
|
-
import type { ACIRCallback } from '
|
|
7
|
-
import type { ACVMWitness } from '
|
|
8
|
-
import { Oracle } from '../../acvm/oracle/oracle.js';
|
|
6
|
+
import type { ACIRCallback } from '../acvm/acvm.js';
|
|
7
|
+
import type { ACVMWitness } from '../acvm/acvm_types.js';
|
|
9
8
|
|
|
10
9
|
export type OracleCall = {
|
|
11
10
|
name: string;
|
|
@@ -152,11 +151,11 @@ export class CircuitRecorder {
|
|
|
152
151
|
*/
|
|
153
152
|
#wrapUserCircuitCallback(callback: ACIRCallback): ACIRCallback {
|
|
154
153
|
const recordingCallback: ACIRCallback = {} as ACIRCallback;
|
|
155
|
-
const oracleMethods = Object.
|
|
154
|
+
const oracleMethods = Object.keys(callback);
|
|
156
155
|
|
|
157
156
|
for (const name of oracleMethods) {
|
|
158
157
|
const fn = callback[name as keyof ACIRCallback];
|
|
159
|
-
if (!fn) {
|
|
158
|
+
if (!fn || typeof fn !== 'function') {
|
|
160
159
|
throw new Error(`Oracle method ${name} not found when setting up recording callback`);
|
|
161
160
|
}
|
|
162
161
|
|