[Perf] Speed up authorize by evaluating instead of executing
Motivation
This PR speeds up authorize significantly. This is done by letting authorize call evaluate_function instead of execute_function, while ensuring these functions have the same interface. Evaluation doesn't generate a circuit under the hood.
This does come at the cost of reduced UX: the user doesn't get feedback on whether they're creating a satisfying circuit. Note that there's no safety issue here; an authorization for an unsatisfied circuit will just lead to failing proof generation and verification. Moreover, for executions of common programs on common input, e.g. credits.aleo/transfer_public, the circuit is unlikely to be unsatisfied.
I added an authorize_checked function for clients/users who want to run this early extensive check anyway.
Testing
Existing unit tests should suffice, they use both the old and new version.
On the API: do we want an authorize_unchecked instead of making it the default in authorize? This would also avoid the breaking change to callers.
On the API: do we want an authorize_unchecked instead of making it the default in authorize? This would also avoid the breaking change to callers.
It's a good question which of the two versions should be the default. Either way, this PR doesn't touch any public API, its all internal. My opinion is that its fine to have the fast version be the default. I added more commentary in the PR description above.
Can you quantify the need for this change in terms of runtime difference? What are the major unlocks? Browser authorization generation?
I am always nervous when touching Stack operations, however the logic looks fairly straightforward.