AztecProtocol / aztec-packages

Apache License 2.0
157 stars 160 forks source link

Update simulator to handle call stacks across multiple ACIR functions #5813

Open vezenovm opened 2 months ago

vezenovm commented 2 months ago

We altered the way call stack are handled in nargo in this PR https://github.com/noir-lang/noir/pull/4711. This was a necessary update in order to have accurate user-facing errors after enabling non-inlined ACIR (https://github.com/noir-lang/noir/issues/4428). Right now using the #[fold] attribute is unsupported for Aztec but even if this is not supported for aztec contracts, we might want to take advantage of other non-inlined ACIR functionality for optimizations. If we plan to take advantage of non-inlined ACIR in aztec contracts we need to update how debug info is handled in the simulator. We should be able to update the simulator in a similar way to how it was handled in nargo in the Noir PR linked above.

sirasistant commented 2 months ago

I think this also needs to update the acvm_js with a similar treatment as nargo received in https://github.com/noir-lang/noir/pull/4711 because the simulator expects to receive built call stacks, that I think right now will be incomplete (?)

vezenovm commented 2 months ago

Yeah this would most likely require some updating to acvm js as well

vezenovm commented 2 months ago

This issue (https://github.com/AztecProtocol/aztec-packages/issues/6182) would most likely need to come first