Open nventuro opened 1 month ago
The token.transfer
function introduced in https://github.com/AztecProtocol/aztec-packages/pull/7730 should see a gate count reduction of ~10k gates if this is properly done.
This currently causes compilation issues if introduced at the code autogenerated by the macros, likely due to some implementation detail of how no_predicates
is implemented, considering it's an internal hack and not really meant to be relied on yet by language users. @vezenovm is looking into an alternative implementation that might solve this.
A very common pattern is to conditionally call self in order to recursively perform a task, e.g. consume more notes if needed. A naive way to do this would be to do e.g.:
This unfortunately results in a large gate count blowup due to the computation of the contract interaction being predicated. I noticed upwards of 10k extra gates compared to the alternative:
This unfortunately is quite unintuitive, and makes it very easy for developers to accidentally write very large circuits. We should apply the
#[no_predicates]
attribute to the macro-generated functions that are used to create these interfaces, and test that we get the expected gate count reduction.