@aztec-labs/simulator 6.0.0-nightly.20260829
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/README.md +57 -0
- package/dest/client.d.ts +6 -0
- package/dest/client.d.ts.map +1 -0
- package/dest/client.js +3 -0
- package/dest/common/errors.d.ts +51 -0
- package/dest/common/errors.d.ts.map +1 -0
- package/dest/common/errors.js +154 -0
- package/dest/common/index.d.ts +3 -0
- package/dest/common/index.d.ts.map +1 -0
- package/dest/common/index.js +2 -0
- package/dest/common/stats/index.d.ts +2 -0
- package/dest/common/stats/index.d.ts.map +1 -0
- package/dest/common/stats/index.js +1 -0
- package/dest/common/stats/stats.d.ts +4 -0
- package/dest/common/stats/stats.d.ts.map +1 -0
- package/dest/common/stats/stats.js +10 -0
- package/dest/private/acvm/acvm.d.ts +43 -0
- package/dest/private/acvm/acvm.d.ts.map +1 -0
- package/dest/private/acvm/acvm.js +65 -0
- package/dest/private/acvm/acvm_types.d.ts +10 -0
- package/dest/private/acvm/acvm_types.d.ts.map +1 -0
- package/dest/private/acvm/acvm_types.js +3 -0
- package/dest/private/acvm/deserialize.d.ts +35 -0
- package/dest/private/acvm/deserialize.d.ts.map +1 -0
- package/dest/private/acvm/deserialize.js +50 -0
- package/dest/private/acvm/index.d.ts +5 -0
- package/dest/private/acvm/index.d.ts.map +1 -0
- package/dest/private/acvm/index.js +4 -0
- package/dest/private/acvm/serialize.d.ts +41 -0
- package/dest/private/acvm/serialize.d.ts.map +1 -0
- package/dest/private/acvm/serialize.js +99 -0
- package/dest/private/acvm_native.d.ts +41 -0
- package/dest/private/acvm_native.d.ts.map +1 -0
- package/dest/private/acvm_native.js +147 -0
- package/dest/private/acvm_wasm.d.ts +16 -0
- package/dest/private/acvm_wasm.d.ts.map +1 -0
- package/dest/private/acvm_wasm.js +67 -0
- package/dest/private/acvm_wasm_with_blobs.d.ts +20 -0
- package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -0
- package/dest/private/acvm_wasm_with_blobs.js +35 -0
- package/dest/private/circuit_simulator.d.ts +35 -0
- package/dest/private/circuit_simulator.d.ts.map +1 -0
- package/dest/private/circuit_simulator.js +43 -0
- package/dest/private/factory.d.ts +12 -0
- package/dest/private/factory.d.ts.map +1 -0
- package/dest/private/factory.js +30 -0
- package/dest/public/avm/testing/account_proof_fetcher.d.ts +2 -0
- package/dest/public/avm/testing/account_proof_fetcher.d.ts.map +1 -0
- package/dest/public/avm/testing/account_proof_fetcher.js +152 -0
- package/dest/public/avm/testing/base_avm_simulation_tester.d.ts +39 -0
- package/dest/public/avm/testing/base_avm_simulation_tester.d.ts.map +1 -0
- package/dest/public/avm/testing/base_avm_simulation_tester.js +121 -0
- package/dest/public/avm/testing/utils.d.ts +32 -0
- package/dest/public/avm/testing/utils.d.ts.map +1 -0
- package/dest/public/avm/testing/utils.js +66 -0
- package/dest/public/avm_simulator.d.ts +28 -0
- package/dest/public/avm_simulator.d.ts.map +1 -0
- package/dest/public/avm_simulator.js +4 -0
- package/dest/public/avm_simulator_pool.d.ts +84 -0
- package/dest/public/avm_simulator_pool.d.ts.map +1 -0
- package/dest/public/avm_simulator_pool.js +311 -0
- package/dest/public/cdb_ipc_server.d.ts +40 -0
- package/dest/public/cdb_ipc_server.d.ts.map +1 -0
- package/dest/public/cdb_ipc_server.js +153 -0
- package/dest/public/contracts_db_checkpoint.d.ts +16 -0
- package/dest/public/contracts_db_checkpoint.d.ts.map +1 -0
- package/dest/public/contracts_db_checkpoint.js +30 -0
- package/dest/public/db_interfaces.d.ts +68 -0
- package/dest/public/db_interfaces.d.ts.map +1 -0
- package/dest/public/db_interfaces.js +3 -0
- package/dest/public/executor_metrics.d.ts +21 -0
- package/dest/public/executor_metrics.d.ts.map +1 -0
- package/dest/public/executor_metrics.js +64 -0
- package/dest/public/executor_metrics_interface.d.ts +10 -0
- package/dest/public/executor_metrics_interface.d.ts.map +1 -0
- package/dest/public/executor_metrics_interface.js +1 -0
- package/dest/public/fixtures/amm_test.d.ts +10 -0
- package/dest/public/fixtures/amm_test.d.ts.map +1 -0
- package/dest/public/fixtures/amm_test.js +213 -0
- package/dest/public/fixtures/bulk_test.d.ts +6 -0
- package/dest/public/fixtures/bulk_test.d.ts.map +1 -0
- package/dest/public/fixtures/bulk_test.js +289 -0
- package/dest/public/fixtures/custom_bytecode_tester.d.ts +34 -0
- package/dest/public/fixtures/custom_bytecode_tester.d.ts.map +1 -0
- package/dest/public/fixtures/custom_bytecode_tester.js +53 -0
- package/dest/public/fixtures/index.d.ts +10 -0
- package/dest/public/fixtures/index.d.ts.map +1 -0
- package/dest/public/fixtures/index.js +9 -0
- package/dest/public/fixtures/public_processor_test_env.d.ts +30 -0
- package/dest/public/fixtures/public_processor_test_env.d.ts.map +1 -0
- package/dest/public/fixtures/public_processor_test_env.js +73 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +77 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -0
- package/dest/public/fixtures/public_tx_simulation_tester.js +176 -0
- package/dest/public/fixtures/simple_contract_data_source.d.ts +36 -0
- package/dest/public/fixtures/simple_contract_data_source.d.ts.map +1 -0
- package/dest/public/fixtures/simple_contract_data_source.js +95 -0
- package/dest/public/fixtures/token_test.d.ts +12 -0
- package/dest/public/fixtures/token_test.d.ts.map +1 -0
- package/dest/public/fixtures/token_test.js +96 -0
- package/dest/public/fixtures/utils.d.ts +26 -0
- package/dest/public/fixtures/utils.d.ts.map +1 -0
- package/dest/public/fixtures/utils.js +170 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +65 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.js +181 -0
- package/dest/public/fuzzing/avm_simulator_bin.d.ts +2 -0
- package/dest/public/fuzzing/avm_simulator_bin.d.ts.map +1 -0
- package/dest/public/fuzzing/avm_simulator_bin.js +108 -0
- package/dest/public/index.d.ts +10 -0
- package/dest/public/index.d.ts.map +1 -0
- package/dest/public/index.js +6 -0
- package/dest/public/public_db_sources.d.ts +83 -0
- package/dest/public/public_db_sources.d.ts.map +1 -0
- package/dest/public/public_db_sources.js +297 -0
- package/dest/public/public_errors.d.ts +12 -0
- package/dest/public/public_errors.d.ts.map +1 -0
- package/dest/public/public_errors.js +13 -0
- package/dest/public/public_processor/guarded_merkle_tree.d.ts +52 -0
- package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -0
- package/dest/public/public_processor/guarded_merkle_tree.js +116 -0
- package/dest/public/public_processor/public_processor.d.ts +71 -0
- package/dest/public/public_processor/public_processor.d.ts.map +1 -0
- package/dest/public/public_processor/public_processor.js +858 -0
- package/dest/public/public_processor/public_processor_metrics.d.ts +30 -0
- package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -0
- package/dest/public/public_processor/public_processor_metrics.js +116 -0
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts +17 -0
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.js +39 -0
- package/dest/public/public_tx_simulator/factories.d.ts +14 -0
- package/dest/public/public_tx_simulator/factories.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/factories.js +28 -0
- package/dest/public/public_tx_simulator/index.d.ts +6 -0
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/index.js +3 -0
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +53 -0
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator.js +127 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts +24 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.js +31 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +32 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.js +1 -0
- package/dest/public/side_effect_errors.d.ts +44 -0
- package/dest/public/side_effect_errors.d.ts.map +1 -0
- package/dest/public/side_effect_errors.js +75 -0
- package/dest/public/test_executor_metrics.d.ts +56 -0
- package/dest/public/test_executor_metrics.d.ts.map +1 -0
- package/dest/public/test_executor_metrics.js +305 -0
- package/dest/public/unique_class_ids.d.ts +37 -0
- package/dest/public/unique_class_ids.d.ts.map +1 -0
- package/dest/public/unique_class_ids.js +61 -0
- package/dest/public/utils.d.ts +3 -0
- package/dest/public/utils.d.ts.map +1 -0
- package/dest/public/utils.js +18 -0
- package/dest/server.d.ts +7 -0
- package/dest/server.d.ts.map +1 -0
- package/dest/server.js +5 -0
- package/package.json +109 -0
- package/src/client.ts +5 -0
- package/src/common/errors.ts +219 -0
- package/src/common/index.ts +2 -0
- package/src/common/stats/index.ts +1 -0
- package/src/common/stats/stats.ts +20 -0
- package/src/private/acvm/acvm.ts +114 -0
- package/src/private/acvm/acvm_types.ts +11 -0
- package/src/private/acvm/deserialize.ts +58 -0
- package/src/private/acvm/index.ts +4 -0
- package/src/private/acvm/serialize.ts +123 -0
- package/src/private/acvm_native.ts +200 -0
- package/src/private/acvm_wasm.ts +80 -0
- package/src/private/acvm_wasm_with_blobs.ts +55 -0
- package/src/private/circuit_simulator.ts +91 -0
- package/src/private/factory.ts +40 -0
- package/src/public/avm/testing/account_proof.json +553 -0
- package/src/public/avm/testing/account_proof_fetcher.ts +166 -0
- package/src/public/avm/testing/base_avm_simulation_tester.ts +162 -0
- package/src/public/avm/testing/utils.ts +114 -0
- package/src/public/avm_simulator.ts +29 -0
- package/src/public/avm_simulator_pool.ts +355 -0
- package/src/public/cdb_ipc_server.ts +198 -0
- package/src/public/contracts_db_checkpoint.ts +41 -0
- package/src/public/db_interfaces.ts +76 -0
- package/src/public/executor_metrics.ts +102 -0
- package/src/public/executor_metrics_interface.ts +20 -0
- package/src/public/fixtures/amm_test.ts +331 -0
- package/src/public/fixtures/bulk_test.ts +194 -0
- package/src/public/fixtures/custom_bytecode_tester.ts +83 -0
- package/src/public/fixtures/index.ts +13 -0
- package/src/public/fixtures/public_processor_test_env.ts +88 -0
- package/src/public/fixtures/public_tx_simulation_tester.ts +315 -0
- package/src/public/fixtures/simple_contract_data_source.ts +122 -0
- package/src/public/fixtures/token_test.ts +148 -0
- package/src/public/fixtures/utils.ts +269 -0
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +302 -0
- package/src/public/fuzzing/avm_simulator_bin.ts +156 -0
- package/src/public/index.ts +16 -0
- package/src/public/public_db_sources.ts +405 -0
- package/src/public/public_errors.ts +14 -0
- package/src/public/public_processor/guarded_merkle_tree.ts +161 -0
- package/src/public/public_processor/public_processor.ts +657 -0
- package/src/public/public_processor/public_processor_metrics.ts +138 -0
- package/src/public/public_tx_simulator/dumping_public_tx_simulator.ts +66 -0
- package/src/public/public_tx_simulator/factories.ts +61 -0
- package/src/public/public_tx_simulator/index.ts +8 -0
- package/src/public/public_tx_simulator/public_tx_simulator.ts +190 -0
- package/src/public/public_tx_simulator/public_tx_simulator_base.ts +37 -0
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +33 -0
- package/src/public/side_effect_errors.ts +96 -0
- package/src/public/test_executor_metrics.ts +399 -0
- package/src/public/unique_class_ids.ts +79 -0
- package/src/public/utils.ts +16 -0
- package/src/server.ts +6 -0
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Simulator
|
|
2
|
+
|
|
3
|
+
## Responsibilities
|
|
4
|
+
|
|
5
|
+
This library package is responsible for simulating function circuits compiled to ACIR / AVM.
|
|
6
|
+
|
|
7
|
+
Simulating a function implies generating the partial witness and the public inputs of the function, as well as collecting all the data (such as created notes or nullifiers, or state changes) that are necessary for components upstream.
|
|
8
|
+
|
|
9
|
+
It's able to simulate three different types of functions:
|
|
10
|
+
|
|
11
|
+
### Private Functions
|
|
12
|
+
|
|
13
|
+
Private functions are simulated and proved client-side, and verified client-side in the private kernel circuit.
|
|
14
|
+
|
|
15
|
+
The public inputs of private functions are defined [here](../stdlib/src/structs/private_circuit_public_inputs.ts).
|
|
16
|
+
|
|
17
|
+
They are run with the assistance of a DB oracle that provides any private data requested by the function.
|
|
18
|
+
|
|
19
|
+
Private functions can call another private function, and can request to call a public function, but the public function execution will be performed by the sequencer asynchronously, thus having no access to the return values.
|
|
20
|
+
|
|
21
|
+
### Public Functions
|
|
22
|
+
|
|
23
|
+
Public functions are simulated and proved on the sequencer side, and verified by the public kernel circuit.
|
|
24
|
+
|
|
25
|
+
The public inputs of public functions are defined [here](../stdlib/src/structs/avm/avm_circuit_public_inputs.ts).
|
|
26
|
+
|
|
27
|
+
They are run with the assistance of an oracle that provides any value read from the public state tree.
|
|
28
|
+
|
|
29
|
+
Public functions can call other public functions, but cannot call private functions.
|
|
30
|
+
|
|
31
|
+
See the specifications of the [Aztec Virtual Machine (AVM) for public execution](./docs/avm/index.md).
|
|
32
|
+
|
|
33
|
+
### Unconstrained Functions
|
|
34
|
+
|
|
35
|
+
Unconstrained functions are useful to extract data for users that could produce very large execution traces - such as the summed balance of all of a user's notes.
|
|
36
|
+
They are not proved, and are simulated client-side.
|
|
37
|
+
|
|
38
|
+
They are run with the assistance of a DB oracle that provides any private data requested by the function.
|
|
39
|
+
|
|
40
|
+
At the moment, unconstrained functions cannot call any other function.
|
|
41
|
+
It would be possible to allow them to call other unconstrained functions.
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
### Development
|
|
46
|
+
|
|
47
|
+
Same steps as any other library. They are detailed [here](../README.md#development)
|
|
48
|
+
|
|
49
|
+
### Testing
|
|
50
|
+
|
|
51
|
+
Same steps as any other library. They are detailed [here](../README.md#tests)
|
|
52
|
+
|
|
53
|
+
### Benchmarking
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
LOG_LEVEL=info yarn test src/public/public_tx_simulator/apps_tests/bench.test.ts
|
|
57
|
+
```
|
package/dest/client.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './private/acvm/index.js';
|
|
2
|
+
export { WASMSimulator } from './private/acvm_wasm.js';
|
|
3
|
+
export type { ACVMSuccess } from './private/acvm_native.js';
|
|
4
|
+
export { type CircuitSimulator, type DecodedError } from './private/circuit_simulator.js';
|
|
5
|
+
export * from './common/index.js';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpZW50LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY2xpZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELFlBQVksRUFBRSxXQUFXLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUM1RCxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBRSxLQUFLLFlBQVksRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQzFGLGNBQWMsbUJBQW1CLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
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,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC1F,cAAc,mBAAmB,CAAC"}
|
package/dest/client.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { RawAssertionPayload } from '@aztec/noir-acvm_js';
|
|
2
|
+
import type { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
|
+
import type { BrilligFunctionId, DebugFileMap, DebugInfo, FunctionAbi, OpcodeLocation } from '@aztec-labs/stdlib/abi';
|
|
4
|
+
import { type FailingFunction, type NoirCallStack, SimulationError, type SourceCodeLocation } from '@aztec-labs/stdlib/errors';
|
|
5
|
+
/**
|
|
6
|
+
* An error that occurred during the execution of a function.
|
|
7
|
+
* @param message - the error message
|
|
8
|
+
* @param failingFunction - the Aztec function that failed
|
|
9
|
+
* @param noirCallStack - the internal call stack of the function that failed (within the failing Aztec function)
|
|
10
|
+
* @param options - additional error options (an optional "cause" entry allows for a recursive error stack where
|
|
11
|
+
* an error's cause may be an ExecutionError itself)
|
|
12
|
+
*/
|
|
13
|
+
export declare class ExecutionError extends Error {
|
|
14
|
+
/**
|
|
15
|
+
* The function that failed.
|
|
16
|
+
*/
|
|
17
|
+
failingFunction: FailingFunction;
|
|
18
|
+
/**
|
|
19
|
+
* The noir call stack of the function that failed.
|
|
20
|
+
*/
|
|
21
|
+
noirCallStack?: NoirCallStack | undefined;
|
|
22
|
+
constructor(message: string,
|
|
23
|
+
/**
|
|
24
|
+
* The function that failed.
|
|
25
|
+
*/
|
|
26
|
+
failingFunction: FailingFunction,
|
|
27
|
+
/**
|
|
28
|
+
* The noir call stack of the function that failed.
|
|
29
|
+
*/
|
|
30
|
+
noirCallStack?: NoirCallStack | undefined, options?: ErrorOptions);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Traverses the cause chain of an error.
|
|
34
|
+
* @param error - The error to start from.
|
|
35
|
+
* @param callback - A callback on every error, including the first one.
|
|
36
|
+
*/
|
|
37
|
+
export declare function traverseCauseChain(error: Error, callback: (error: Error) => void): void;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a simulation error from an error chain generated during the execution of a function.
|
|
40
|
+
* @param error - The error thrown during execution.
|
|
41
|
+
* @returns - A simulation error.
|
|
42
|
+
*/
|
|
43
|
+
export declare function createSimulationError(error: Error, revertData?: Fr[]): SimulationError;
|
|
44
|
+
/**
|
|
45
|
+
* Resolves the source code locations from an array of opcode locations
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveOpcodeLocations(opcodeLocations: OpcodeLocation[], debug: DebugInfo, files: DebugFileMap, brilligFunctionId?: BrilligFunctionId): SourceCodeLocation[];
|
|
48
|
+
export declare function resolveAssertionMessage(errorPayload: RawAssertionPayload, abi: FunctionAbi): string | undefined;
|
|
49
|
+
export declare function resolveAssertionMessageFromRevertData(revertData: Fr[], abi: FunctionAbi): string | undefined;
|
|
50
|
+
export declare function resolveAssertionMessageFromError(err: Error, abi: FunctionAbi): string;
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29tbW9uL2Vycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRy9ELE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBRTlELE9BQU8sS0FBSyxFQUNWLGlCQUFpQixFQUNqQixZQUFZLEVBQ1osU0FBUyxFQUNULFdBQVcsRUFFWCxjQUFjLEVBQ2YsTUFBTSx3QkFBd0IsQ0FBQztBQUNoQyxPQUFPLEVBQ0wsS0FBSyxlQUFlLEVBQ3BCLEtBQUssYUFBYSxFQUNsQixlQUFlLEVBQ2YsS0FBSyxrQkFBa0IsRUFDeEIsTUFBTSwyQkFBMkIsQ0FBQztBQUVuQzs7Ozs7OztHQU9HO0FBQ0gscUJBQWEsY0FBZSxTQUFRLEtBQUs7SUFHckM7O09BRUc7SUFDSSxlQUFlLEVBQUUsZUFBZTtJQUN2Qzs7T0FFRztJQUNJLGFBQWEsQ0FBQztJQVR2QixZQUNFLE9BQU8sRUFBRSx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;AAED,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAMrF"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { abiDecodeError } from '@aztec/noir-noirc_abi';
|
|
2
|
+
import { jsonStringify } from '@aztec-labs/foundation/json-rpc';
|
|
3
|
+
import { SimulationError } from '@aztec-labs/stdlib/errors';
|
|
4
|
+
/**
|
|
5
|
+
* An error that occurred during the execution of a function.
|
|
6
|
+
* @param message - the error message
|
|
7
|
+
* @param failingFunction - the Aztec function that failed
|
|
8
|
+
* @param noirCallStack - the internal call stack of the function that failed (within the failing Aztec function)
|
|
9
|
+
* @param options - additional error options (an optional "cause" entry allows for a recursive error stack where
|
|
10
|
+
* an error's cause may be an ExecutionError itself)
|
|
11
|
+
*/ export class ExecutionError extends Error {
|
|
12
|
+
failingFunction;
|
|
13
|
+
noirCallStack;
|
|
14
|
+
constructor(message, /**
|
|
15
|
+
* The function that failed.
|
|
16
|
+
*/ failingFunction, /**
|
|
17
|
+
* The noir call stack of the function that failed.
|
|
18
|
+
*/ noirCallStack, options){
|
|
19
|
+
super(message, options), this.failingFunction = failingFunction, this.noirCallStack = noirCallStack;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Traverses the cause chain of an error.
|
|
24
|
+
* @param error - The error to start from.
|
|
25
|
+
* @param callback - A callback on every error, including the first one.
|
|
26
|
+
*/ export function traverseCauseChain(error, callback) {
|
|
27
|
+
let currentError = error;
|
|
28
|
+
while(currentError){
|
|
29
|
+
callback(currentError);
|
|
30
|
+
if (currentError.cause && currentError.cause instanceof Error) {
|
|
31
|
+
currentError = currentError.cause;
|
|
32
|
+
} else {
|
|
33
|
+
currentError = undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a simulation error from an error chain generated during the execution of a function.
|
|
39
|
+
* @param error - The error thrown during execution.
|
|
40
|
+
* @returns - A simulation error.
|
|
41
|
+
*/ export function createSimulationError(error, revertData) {
|
|
42
|
+
let rootCause = error;
|
|
43
|
+
let noirCallStack = undefined;
|
|
44
|
+
const aztecCallStack = [];
|
|
45
|
+
traverseCauseChain(error, (cause)=>{
|
|
46
|
+
rootCause = cause;
|
|
47
|
+
if (cause instanceof ExecutionError) {
|
|
48
|
+
aztecCallStack.push(cause.failingFunction);
|
|
49
|
+
if (cause.noirCallStack) {
|
|
50
|
+
noirCallStack = cause.noirCallStack;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return new SimulationError(rootCause.message, aztecCallStack, revertData, noirCallStack, {
|
|
55
|
+
cause: rootCause
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolves the source code locations from an array of opcode locations
|
|
60
|
+
*/ export function resolveOpcodeLocations(opcodeLocations, debug, files, brilligFunctionId) {
|
|
61
|
+
let locations = opcodeLocations.flatMap((opcodeLocation)=>getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId));
|
|
62
|
+
// Adds the acir call stack if the last location is a brillig opcode
|
|
63
|
+
if (locations.length > 0) {
|
|
64
|
+
const decomposedOpcodeLocation = opcodeLocations[opcodeLocations.length - 1].split('.');
|
|
65
|
+
if (decomposedOpcodeLocation.length === 2) {
|
|
66
|
+
const acirCallstackId = debug.acir_locations[decomposedOpcodeLocation[0]];
|
|
67
|
+
if (acirCallstackId !== undefined) {
|
|
68
|
+
const callStack = debug.location_tree.locations[acirCallstackId];
|
|
69
|
+
const acirCallstack = getCallStackFromLocationNode(callStack, debug.location_tree.locations, files);
|
|
70
|
+
locations = acirCallstack.concat(locations);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return locations;
|
|
75
|
+
}
|
|
76
|
+
function getCallStackFromLocationNode(callStack, locationTree, files) {
|
|
77
|
+
const result = [];
|
|
78
|
+
while(callStack.parent !== null){
|
|
79
|
+
const { file: fileId, span } = callStack.value;
|
|
80
|
+
const { path, source } = files[fileId];
|
|
81
|
+
const locationText = source.substring(span.start, span.end);
|
|
82
|
+
const precedingText = source.substring(0, span.start);
|
|
83
|
+
const previousLines = precedingText.split('\n');
|
|
84
|
+
// Lines and columns in stacks are one indexed.
|
|
85
|
+
const line = previousLines.length;
|
|
86
|
+
const column = previousLines[previousLines.length - 1].length + 1;
|
|
87
|
+
// Unshift since we are exploring child nodes first
|
|
88
|
+
result.unshift({
|
|
89
|
+
filePath: path,
|
|
90
|
+
line,
|
|
91
|
+
column,
|
|
92
|
+
fileSource: source,
|
|
93
|
+
locationText
|
|
94
|
+
});
|
|
95
|
+
callStack = locationTree[callStack.parent];
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Extracts the call stack from the location of a failing opcode and the debug metadata.
|
|
101
|
+
* One opcode can point to multiple calls due to inlining.
|
|
102
|
+
*/ function getSourceCodeLocationsFromOpcodeLocation(opcodeLocation, debug, files, brilligFunctionId) {
|
|
103
|
+
let callStackID = debug.acir_locations[opcodeLocation];
|
|
104
|
+
const brilligLocation = extractBrilligLocation(opcodeLocation);
|
|
105
|
+
if (brilligFunctionId !== undefined && brilligLocation !== undefined) {
|
|
106
|
+
callStackID = debug.brillig_locations[brilligFunctionId][brilligLocation];
|
|
107
|
+
if (callStackID === undefined) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (callStackID === undefined) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
const callStack = debug.location_tree.locations[callStackID];
|
|
115
|
+
return getCallStackFromLocationNode(callStack, debug.location_tree.locations, files);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Extracts a brillig location from an opcode location.
|
|
119
|
+
*/ function extractBrilligLocation(opcodeLocation) {
|
|
120
|
+
const splitted = opcodeLocation.split('.');
|
|
121
|
+
if (splitted.length === 2) {
|
|
122
|
+
return splitted[1];
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
export function resolveAssertionMessage(errorPayload, abi) {
|
|
127
|
+
const decoded = abiDecodeError({
|
|
128
|
+
parameters: [],
|
|
129
|
+
error_types: abi.errorTypes,
|
|
130
|
+
return_type: null
|
|
131
|
+
}, errorPayload);
|
|
132
|
+
if (typeof decoded === 'string') {
|
|
133
|
+
return decoded;
|
|
134
|
+
} else {
|
|
135
|
+
return jsonStringify(decoded);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export function resolveAssertionMessageFromRevertData(revertData, abi) {
|
|
139
|
+
if (revertData.length == 0) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
const [errorSelector, ...errorData] = revertData;
|
|
143
|
+
return resolveAssertionMessage({
|
|
144
|
+
selector: errorSelector.toBigInt().toString(),
|
|
145
|
+
data: errorData.map((f)=>f.toString())
|
|
146
|
+
}, abi);
|
|
147
|
+
}
|
|
148
|
+
export function resolveAssertionMessageFromError(err, abi) {
|
|
149
|
+
if (typeof err === 'object' && err !== null && 'rawAssertionPayload' in err && err.rawAssertionPayload) {
|
|
150
|
+
return `Assertion failed: ${resolveAssertionMessage(err.rawAssertionPayload, abi)}`;
|
|
151
|
+
} else {
|
|
152
|
+
return err.message;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export * from './errors.js';
|
|
2
|
+
export * from './stats/index.js';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxrQkFBa0IsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/stats/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './stats.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Logger } from '@aztec-labs/foundation/log';
|
|
2
|
+
import type { CircuitName } from '@aztec-labs/stdlib/stats';
|
|
3
|
+
export declare function emitCircuitSimulationStats(circuitName: CircuitName, duration: number, inputSize: number, outputSize: number, logger: Logger): void;
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21tb24vc3RhdHMvc3RhdHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUEwQixNQUFNLDBCQUEwQixDQUFDO0FBRXBGLHdCQUFnQiwwQkFBMEIsQ0FDeEMsV0FBVyxFQUFFLFdBQVcsRUFDeEIsUUFBUSxFQUFFLE1BQU0sRUFDaEIsU0FBUyxFQUFFLE1BQU0sRUFDakIsVUFBVSxFQUFFLE1BQU0sRUFDbEIsTUFBTSxFQUFFLE1BQU0sUUFXZiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/common/stats/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAEpF,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,QAWf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function emitCircuitSimulationStats(circuitName, duration, inputSize, outputSize, logger) {
|
|
2
|
+
const stats = {
|
|
3
|
+
eventName: 'circuit-simulation',
|
|
4
|
+
circuitName,
|
|
5
|
+
inputSize,
|
|
6
|
+
outputSize,
|
|
7
|
+
duration
|
|
8
|
+
};
|
|
9
|
+
logger.debug('Circuit simulation stats', stats);
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ExecutionError, type ForeignCallInput, type ForeignCallOutput } from '@aztec/noir-acvm_js';
|
|
2
|
+
import { type Logger, type LoggerBindings } from '@aztec-labs/foundation/log';
|
|
3
|
+
import type { FunctionDebugMetadata } from '@aztec-labs/stdlib/abi';
|
|
4
|
+
import type { NoirCallStack } from '@aztec-labs/stdlib/errors';
|
|
5
|
+
import type { ACVMWitness } from './acvm_types.js';
|
|
6
|
+
/**
|
|
7
|
+
* The callback interface for the ACIR.
|
|
8
|
+
*/
|
|
9
|
+
export type ACIRCallback = Record<string, (...args: ForeignCallInput[]) => Promise<ForeignCallOutput[]>>;
|
|
10
|
+
export type ACIRCallbackStats = {
|
|
11
|
+
times: number[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The result of executing an ACIR.
|
|
15
|
+
*/
|
|
16
|
+
export interface ACIRExecutionResult {
|
|
17
|
+
/**
|
|
18
|
+
* An execution result contains two witnesses.
|
|
19
|
+
* 1. The partial witness of the execution.
|
|
20
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
21
|
+
*/
|
|
22
|
+
partialWitness: ACVMWitness;
|
|
23
|
+
returnWitness: ACVMWitness;
|
|
24
|
+
oracles?: Record<string, ACIRCallbackStats>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The function call that executes an ACIR.
|
|
28
|
+
* @param acir - The ACIR circuit bytecode to execute.
|
|
29
|
+
* @param initialWitness - The initial witness map defining all of the inputs to `circuit`.
|
|
30
|
+
* @param callback - A callback to process any foreign calls from the circuit.
|
|
31
|
+
* @param logger - Optional logger for ACVM execution logs.
|
|
32
|
+
* @returns The solved witness calculated by executing the circuit on the provided inputs, as well as the return
|
|
33
|
+
* witness indices as specified by the circuit.
|
|
34
|
+
*/
|
|
35
|
+
export declare function acvm(acir: Buffer, initialWitness: ACVMWitness, callback: ACIRCallback, loggerOrBindings?: Logger | LoggerBindings): Promise<ACIRExecutionResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Extracts the call stack from an thrown by the acvm.
|
|
38
|
+
* @param error - The error to extract from.
|
|
39
|
+
* @param debug - The debug metadata of the function called.
|
|
40
|
+
* @returns The call stack, if available.
|
|
41
|
+
*/
|
|
42
|
+
export declare function extractCallStack(error: Error | ExecutionError, debug?: FunctionDebugMetadata): NoirCallStack | undefined;
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN2bS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGUvYWN2bS9hY3ZtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLGNBQWMsRUFDbkIsS0FBSyxnQkFBZ0IsRUFDckIsS0FBSyxpQkFBaUIsRUFFdkIsTUFBTSxxQkFBcUIsQ0FBQztBQUU3QixPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQUUsS0FBSyxjQUFjLEVBQWlCLE1BQU0sNEJBQTRCLENBQUM7QUFD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aAAa,GAAG,SAAS,CAc3B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { executeCircuitWithReturnWitness } from '@aztec/noir-acvm_js';
|
|
2
|
+
import { resolveLogger } from '@aztec-labs/foundation/log';
|
|
3
|
+
import { resolveOpcodeLocations, traverseCauseChain } from '../../common/errors.js';
|
|
4
|
+
/**
|
|
5
|
+
* The function call that executes an ACIR.
|
|
6
|
+
* @param acir - The ACIR circuit bytecode to execute.
|
|
7
|
+
* @param initialWitness - The initial witness map defining all of the inputs to `circuit`.
|
|
8
|
+
* @param callback - A callback to process any foreign calls from the circuit.
|
|
9
|
+
* @param logger - Optional logger for ACVM execution logs.
|
|
10
|
+
* @returns The solved witness calculated by executing the circuit on the provided inputs, as well as the return
|
|
11
|
+
* witness indices as specified by the circuit.
|
|
12
|
+
*/ export async function acvm(acir, initialWitness, callback, loggerOrBindings) {
|
|
13
|
+
const logger = resolveLogger('simulator:acvm', loggerOrBindings);
|
|
14
|
+
const solvedAndReturnWitness = await executeCircuitWithReturnWitness(acir, initialWitness, (name, args)=>{
|
|
15
|
+
try {
|
|
16
|
+
logger.debug(`Oracle callback ${name}`);
|
|
17
|
+
const oracleFunction = callback[name];
|
|
18
|
+
if (!oracleFunction) {
|
|
19
|
+
throw new Error(`Oracle callback ${name} not found`);
|
|
20
|
+
}
|
|
21
|
+
return oracleFunction.call(callback, ...args);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
let typedError;
|
|
24
|
+
if (err instanceof Error) {
|
|
25
|
+
typedError = err;
|
|
26
|
+
} else {
|
|
27
|
+
typedError = new Error(`Error in oracle callback ${err}`);
|
|
28
|
+
}
|
|
29
|
+
logger.error(`Error in oracle callback ${name}: ${typedError.message}`);
|
|
30
|
+
throw typedError;
|
|
31
|
+
}
|
|
32
|
+
}).catch((err)=>{
|
|
33
|
+
// Wasm callbacks act as a boundary for stack traces, so we capture it here and complete the error if it happens.
|
|
34
|
+
const stack = new Error().stack;
|
|
35
|
+
traverseCauseChain(err, (cause)=>{
|
|
36
|
+
if (cause.stack) {
|
|
37
|
+
cause.stack += stack;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
throw err;
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
partialWitness: solvedAndReturnWitness.solvedWitness,
|
|
44
|
+
returnWitness: solvedAndReturnWitness.returnWitness
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Extracts the call stack from an thrown by the acvm.
|
|
49
|
+
* @param error - The error to extract from.
|
|
50
|
+
* @param debug - The debug metadata of the function called.
|
|
51
|
+
* @returns The call stack, if available.
|
|
52
|
+
*/ export function extractCallStack(error, debug) {
|
|
53
|
+
if (!('callStack' in error) || !error.callStack) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const { callStack, brilligFunctionId } = error;
|
|
57
|
+
if (!debug) {
|
|
58
|
+
return callStack;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
return resolveOpcodeLocations(callStack, debug.debugSymbols, debug.files, brilligFunctionId);
|
|
62
|
+
} catch {
|
|
63
|
+
return callStack;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
2
|
+
/**
|
|
3
|
+
* ACVMField
|
|
4
|
+
*/
|
|
5
|
+
export type ACVMField = string;
|
|
6
|
+
/**
|
|
7
|
+
* The format for witnesses of the ACVM.
|
|
8
|
+
*/
|
|
9
|
+
export type ACVMWitness = WitnessMap;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN2bV90eXBlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGUvYWN2bS9hY3ZtX3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRXREOztHQUVHO0FBQ0gsTUFBTSxNQUFNLFNBQVMsR0FBRyxNQUFNLENBQUM7QUFFL0I7O0dBRUc7QUFDSCxNQUFNLE1BQU0sV0FBVyxHQUFHLFVBQVUsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acvm_types.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/acvm_types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import type { ACVMField, ACVMWitness } from './acvm_types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a Noir BoundedVec of Fields into an Fr array. Note that BoundedVecs are structs, and therefore translated as
|
|
5
|
+
* two separate ACVMField values (an array and a single field).
|
|
6
|
+
*
|
|
7
|
+
* @param storage The array with the BoundedVec's storage (i.e. BoundedVec::storage())
|
|
8
|
+
* @param length The length of the BoundedVec (i.e. BoundedVec::len())
|
|
9
|
+
* @returns An array with the same content as the Noir version. Elements past the length are discarded.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fromBoundedVec(storage: ACVMField[], length: ACVMField): Fr[];
|
|
12
|
+
/**
|
|
13
|
+
* Converts a Noir BoundedVec of unsigned integers into a Buffer. Note that BoundedVecs are structs, and therefore
|
|
14
|
+
* translated as two separate ACVMField values (an array and a single field).
|
|
15
|
+
*
|
|
16
|
+
* @param storage The array with the BoundedVec's storage (i.e. BoundedVec::storage())
|
|
17
|
+
* @param length The length of the BoundedVec (i.e. BoundedVec::len())
|
|
18
|
+
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
19
|
+
* @returns A buffer containing the unsigned integers tightly packed
|
|
20
|
+
*/
|
|
21
|
+
export declare function fromUintBoundedVec(storage: ACVMField[], length: ACVMField, uintBitSize: number): Buffer;
|
|
22
|
+
/**
|
|
23
|
+
* Transforms a witness map to its field elements.
|
|
24
|
+
* @param witness - The witness to extract from.
|
|
25
|
+
* @returns The return values.
|
|
26
|
+
*/
|
|
27
|
+
export declare function witnessMapToFields(witness: ACVMWitness): Fr[];
|
|
28
|
+
/**
|
|
29
|
+
* Converts an array of Noir unsigned integers to a single tightly-packed buffer.
|
|
30
|
+
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
31
|
+
* @returns A buffer where each byte is correctly represented as a single byte in the buffer.
|
|
32
|
+
* Copy of the function in txe/src/util/encoding.ts.
|
|
33
|
+
*/
|
|
34
|
+
export declare function fromUintArray(obj: ACVMField[], uintBitSize: number): Buffer;
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVzZXJpYWxpemUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlL2Fjdm0vZGVzZXJpYWxpemUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBR3pELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUU5RDs7Ozs7OztHQU9HO0FBQ0gsd0JBQWdCLGNBQWMsQ0FBQyxPQUFPLEVBQUUsU0FBUyxFQUFFLEVBQUUsTUFBTSxFQUFFLFNBQVMsR0FBRyxFQUFFLEVBQUUsQ0FFNUU7QUFFRDs7Ozs7Ozs7R0FRRztBQUNILHdCQUFnQixrQkFBa0IsQ0FBQyxPQUFPLEVBQUUsU0FBUyxFQUFFLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FPdkc7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQWdCLGtCQUFrQixDQUFDLE9BQU8sRUFBRSxXQUFXLEdBQUcsRUFBRSxFQUFFLENBRzdEO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBZ0IsYUFBYSxDQUFDLEdBQUcsRUFBRSxTQUFTLEVBQUUsRUFBRSxXQUFXLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FNM0UifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/deserialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,CAE5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAOvG;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,EAAE,EAAE,CAG7D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAM3E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import { hexToBuffer } from '@aztec-labs/foundation/string';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a Noir BoundedVec of Fields into an Fr array. Note that BoundedVecs are structs, and therefore translated as
|
|
5
|
+
* two separate ACVMField values (an array and a single field).
|
|
6
|
+
*
|
|
7
|
+
* @param storage The array with the BoundedVec's storage (i.e. BoundedVec::storage())
|
|
8
|
+
* @param length The length of the BoundedVec (i.e. BoundedVec::len())
|
|
9
|
+
* @returns An array with the same content as the Noir version. Elements past the length are discarded.
|
|
10
|
+
*/ export function fromBoundedVec(storage, length) {
|
|
11
|
+
return storage.slice(0, Fr.fromString(length).toNumber()).map(Fr.fromString);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Converts a Noir BoundedVec of unsigned integers into a Buffer. Note that BoundedVecs are structs, and therefore
|
|
15
|
+
* translated as two separate ACVMField values (an array and a single field).
|
|
16
|
+
*
|
|
17
|
+
* @param storage The array with the BoundedVec's storage (i.e. BoundedVec::storage())
|
|
18
|
+
* @param length The length of the BoundedVec (i.e. BoundedVec::len())
|
|
19
|
+
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
20
|
+
* @returns A buffer containing the unsigned integers tightly packed
|
|
21
|
+
*/ export function fromUintBoundedVec(storage, length, uintBitSize) {
|
|
22
|
+
if (uintBitSize % 8 !== 0) {
|
|
23
|
+
throw new Error(`u${uintBitSize} is not a supported type in Noir`);
|
|
24
|
+
}
|
|
25
|
+
const uintByteSize = uintBitSize / 8;
|
|
26
|
+
const boundedStorage = storage.slice(0, Fr.fromString(length).toNumber());
|
|
27
|
+
return Buffer.concat(boundedStorage.map((str)=>hexToBuffer(str).subarray(-uintByteSize)));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Transforms a witness map to its field elements.
|
|
31
|
+
* @param witness - The witness to extract from.
|
|
32
|
+
* @returns The return values.
|
|
33
|
+
*/ export function witnessMapToFields(witness) {
|
|
34
|
+
const sortedKeys = [
|
|
35
|
+
...witness.keys()
|
|
36
|
+
].sort((a, b)=>a - b);
|
|
37
|
+
return sortedKeys.map((key)=>witness.get(key)).map(Fr.fromString);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Converts an array of Noir unsigned integers to a single tightly-packed buffer.
|
|
41
|
+
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
42
|
+
* @returns A buffer where each byte is correctly represented as a single byte in the buffer.
|
|
43
|
+
* Copy of the function in txe/src/util/encoding.ts.
|
|
44
|
+
*/ export function fromUintArray(obj, uintBitSize) {
|
|
45
|
+
if (uintBitSize % 8 !== 0) {
|
|
46
|
+
throw new Error(`u${uintBitSize} is not a supported type in Noir`);
|
|
47
|
+
}
|
|
48
|
+
const uintByteSize = uintBitSize / 8;
|
|
49
|
+
return Buffer.concat(obj.map((str)=>hexToBuffer(str).slice(-uintByteSize)));
|
|
50
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { extractCallStack, type ACIRCallback, type ACIRCallbackStats, type ACIRExecutionResult } from './acvm.js';
|
|
2
|
+
export * from './acvm_types.js';
|
|
3
|
+
export * from './deserialize.js';
|
|
4
|
+
export * from './serialize.js';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlL2Fjdm0vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLEtBQUssWUFBWSxFQUFFLEtBQUssaUJBQWlCLEVBQUUsS0FBSyxtQkFBbUIsRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUNsSCxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxnQkFBZ0IsQ0FBQyJ9
|
|
@@ -0,0 +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,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAClH,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import type { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
3
|
+
import type { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
|
|
4
|
+
import type { ACVMField } from './acvm_types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Converts a value to an ACVM field.
|
|
7
|
+
* @param value - The value to convert.
|
|
8
|
+
* @returns The ACVM field.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toACVMField(value: AztecAddress | EthAddress | Fr | Buffer | boolean | number | bigint | ACVMField): ACVMField;
|
|
11
|
+
/**
|
|
12
|
+
* Converts a single value or an array of single values into the equivalent ACVM field representation.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toACVMFieldSingleOrArray(value: Fr | Fr[]): string | string[];
|
|
15
|
+
/**
|
|
16
|
+
* Inserts a list of ACVM fields to a witness.
|
|
17
|
+
* @param witnessStartIndex - The index where to start inserting the fields.
|
|
18
|
+
* @param fields - The fields to insert.
|
|
19
|
+
* @returns The witness.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toACVMWitness(witnessStartIndex: number, fields: Parameters<typeof toACVMField>[0][]): Map<number, string>;
|
|
22
|
+
export declare function bufferToU8Array(buffer: Buffer): ACVMField[];
|
|
23
|
+
export declare function bufferToBoundedVec(buffer: Buffer, maxLen: number): [ACVMField[], ACVMField];
|
|
24
|
+
/**
|
|
25
|
+
* Converts a ForeignCallArray into a tuple which represents a nr BoundedVec.
|
|
26
|
+
* If the input array is shorter than the maxLen, it pads the result with zeros,
|
|
27
|
+
* so that nr can correctly coerce this result into a BoundedVec.
|
|
28
|
+
* @param bVecStorage - The array underlying the BoundedVec.
|
|
29
|
+
* @param maxLen - the max length of the BoundedVec.
|
|
30
|
+
* @returns a tuple representing a BoundedVec.
|
|
31
|
+
*/
|
|
32
|
+
export declare function arrayToBoundedVec(bVecStorage: ACVMField[], maxLen: number): [ACVMField[], ACVMField];
|
|
33
|
+
/**
|
|
34
|
+
* Converts an array of arrays representing Noir BoundedVec of nested arrays into its Noir serialized form.
|
|
35
|
+
* @param bVecStorage - The array underlying the BoundedVec.
|
|
36
|
+
* @param maxLen - The max length of the BoundedVec (max num of the nested arrays in the BoundedVec).
|
|
37
|
+
* @param nestedArrayLength - The length of the nested arrays (each nested array has to have the same length).
|
|
38
|
+
* @returns Serialized BoundedVec following Noir intrinsic serialization.
|
|
39
|
+
*/
|
|
40
|
+
export declare function arrayOfArraysToBoundedVecOfArrays(bVecStorage: ACVMField[][], maxLen: number, nestedArrayLength: number): [ACVMField[], ACVMField];
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VyaWFsaXplLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHJpdmF0ZS9hY3ZtL3NlcmlhbGl6ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sb0NBQW9DLENBQUM7QUFDckUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFFckUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFnQmpEOzs7O0dBSUc7QUFDSCx3QkFBZ0IsV0FBVyxDQUN6QixLQUFLLEVBQUUsWUFBWSxHQUFHLFVBQVUsR0FBRyxFQU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