aztec-packages icon indicating copy to clipboard operation
aztec-packages copied to clipboard

[DO_NOT_MERGE] feat: optimizing SharedImmutable

Open benesjan opened this issue 6 months ago • 2 comments

This is a demonstration of how we can optimize state variables by packing them (storing serialized values along with hash, then fetching value in unconstrained, fetching hash in constrained and checking the hash).

Not mergeable because:

  1. Arithmetics over generics is highly experimental and not ready to be used in "prod" yet,
  2. we have to solve proper storage slot allocation (this breaks current impl in macros),
  3. we should try optimizing the length = 1 case in which the value should not get packed.

PrivateFPC::fund_transaction_privately(...) gates Before: 13987 After: 10209

diff: 3778

benesjan avatar Aug 15 '24 14:08 benesjan