Skip to content

feat(simulator): Fetch return values at circuit execution#5642

Merged
vezenovm merged 18 commits into
masterfrom
mv/execute-circuit-with-return-witness
Apr 10, 2024
Merged

feat(simulator): Fetch return values at circuit execution#5642
vezenovm merged 18 commits into
masterfrom
mv/execute-circuit-with-return-witness

Conversation

@vezenovm

@vezenovm vezenovm commented Apr 9, 2024

Copy link
Copy Markdown
Contributor

We were deserializing a Program twice in the simulator. Once to execute the circuit and again to fetch the return witness. Every call to executeCircuitWithBlackBoxSolver is followed by a call to getReturnWitness in the simulator. We should just pass the return witness right away as to not cross the WASM boundary a second time and as to avoid a second deserialization.

I settled on a new ACVM method rather than using abi decoding as the return witnesses are stripped from the ABI. We can have a method that returns both the fully solved witness and the return witness based upon the circuit. This allows us to both avoid storing duplicate return witness information and an unnecessary deserialization.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants