import type { ExecutionError, ForeignCallHandler } from '@aztec-foundation/noir-acvm_js'; import type { InputMap } from '@aztec-foundation/noir-types'; import type { FunctionArtifactWithContractName } from '@aztec-labs/stdlib/abi'; import type { NoirCompiledCircuit, NoirCompiledCircuitWithName } from '@aztec-labs/stdlib/noir'; import { type ACIRCallback, type ACIRExecutionResult } from './acvm/acvm.js'; import type { ACVMWitness } from './acvm/acvm_types.js'; import type { ACVMSuccess } from './acvm_native.js'; /** The outcome of executing a protocol circuit at the ABI level. */ export type ProtocolCircuitResult = { /** The circuit's return value, decoded against the artifact's ABI. */ returnValue: ReturnType; /** How long the execution took, in milliseconds. */ duration: number; }; /** * Low level simulation interface */ export interface CircuitSimulator { /** * Execute a protocol circuit and decode its return value. * * Inputs and outputs are exchanged in ABI form rather than as witness maps, which lets each * simulator talk to its backend in that backend's native currency: the native simulator writes the * inputs straight out as a prover file and reads the return value back, never materializing a * witness map, while the WASM simulator encodes and decodes around `executeCircuit`. * * @param inputs - The circuit's parameters, keyed by ABI parameter name. * @param artifact - ACIR circuit bytecode and its metadata. * @param callback - A callback to process any foreign calls from the circuit. Can be undefined as for native * ACVM simulator we don't process foreign calls. * @returns The circuit's decoded return value. */ executeProtocolCircuit(inputs: InputMap, artifact: NoirCompiledCircuitWithName, callback: ForeignCallHandler | undefined): Promise>; /** * Execute a protocol circuit and return its full solved witness. * * Only for callers that need the witness itself — client IVC hands it to the proving backend. Prefer * {@link executeProtocolCircuit} otherwise: materializing the witness costs a hex string per entry, * and solved witnesses run to hundreds of thousands of entries. * * @param input - The initial witness map defining all of the inputs to `circuit`. * @param artifact - ACIR circuit bytecode and its metadata. * @param callback - A callback to process any foreign calls from the circuit. * @returns The solved witness calculated by executing the circuit on the provided inputs. */ executeProtocolCircuitToWitness(input: ACVMWitness, artifact: NoirCompiledCircuitWithName, callback: ForeignCallHandler | undefined): Promise; /** * Execute a user circuit (smart contract function)/generate a witness * @param input - The initial witness map defining all of the inputs to `circuit`. * @param artifact - Contract function ACIR circuit bytecode and its metadata. * @param callback - A callback to process any foreign calls from the circuit. * @returns The solved witness calculated by executing the circuit on the provided inputs, as well as the return * witness indices as specified by the circuit. */ executeUserCircuit(input: ACVMWitness, artifact: FunctionArtifactWithContractName, callback: ACIRCallback): Promise; } export type DecodedError = ExecutionError & { decodedAssertionPayload?: any; noirCallStack?: string[]; }; export declare function enrichNoirError(artifact: NoirCompiledCircuit, originalError: ExecutionError): DecodedError; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2lyY3VpdF9zaW11bGF0b3IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcml2YXRlL2NpcmN1aXRfc2ltdWxhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXpGLE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBRzdELE9BQU8sS0FBSyxFQUFFLGdDQUFnQyxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDL0UsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUVoRyxPQUFPLEVBQUUsS0FBSyxZQUFZLEVBQUUsS0FBSyxtQkFBbUIsRUFBb0IsTUFBTSxnQkFBZ0IsQ0FBQztBQUMvRixPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN4RCxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUVwRCxvRUFBb0U7QUFDcEUsTUFBTSxNQUFNLHFCQUFxQixDQUFDLFVBQVUsSUFBSTtJQUM5QyxzRUFBc0U7SUFDdEUsV0FB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