feat: introduce initialize_or_replace#6519
Conversation
Benchmark resultsNo metrics with a significant change found. Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Proof generationEach column represents the number of threads used in proof generation.
L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.
Stats on running time collected for app circuits
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method | Metric | | Transaction processing duration by data writes.
|
This fixes the issue described in these comments, which highlighted that
PrivateMutablewas providing a poor API as it forced users to call unconstrained functions and leave correctness up to them. This is a simple replacement to make #6442 cleaner and help guide future development, but it should only be considered a patch - we'll eventually do a more thoughtful complete pass over the entire API to bring coherency to it.I tried adding tests for this (I wanted to test that regardless what the return value of the nullifier check oracle was, either an inclusion proof or a new nullifier would be included in the context), but this proved to be very hard because notes are sent to the oracle as raw fields in a custom packed format which
oracle::get_notesdecodes on the spot. We'd need to have that be a separate library, but that exceeds the scope of this PR.