feat: separate bytecode logs from unencrypted logs#9891
Conversation
Changes to circuit sizes
🧾 Summary (100% most significant diffs)
Full diff report 👇
|
| // The reset circuit checks that capped_size must be greater than or equal to all non-empty logs. | ||
| // Since there is no current config with ENCRYPTED_LOG_SILOING_AMOUNT = 0 (only 1+), it defaults to 1, | ||
| // so the circuit fails when we have more than 1 log and require no siloing. | ||
| const numLogsNoSiloing = this.previousKernel.end.encryptedLogsHashes.filter( | ||
| l => !l.logHash.isEmpty() && l.logHash.randomness.isZero(), | ||
| ).length; | ||
| const cappedSize = !numToSilo && numLogsNoSiloing > 1 ? numLogsNoSiloing : numToSilo; | ||
| // NB: This is a little flimsy, and only works because we have either ENCRYPTED_LOG_SILOING_AMOUNT=1 or 8. | ||
| // e.g. if we have 2 logs that need siloing, and 2 that dont, then numLogs = ENCRYPTED_LOG_SILOING_AMOUNT = 2 | ||
| // This would fail because the circuit thinks that cappedSize = 2, but we have 4 logs. | ||
| this.requestedDimensions.ENCRYPTED_LOG_SILOING_AMOUNT = cappedSize; |
There was a problem hiding this comment.
This fixes something I believe is in master - reset will fail for any number of encrypted logs which don't need siloing above 1.
It works now because we'd never tested more than 1 encrypted log with randomness set to 0. In that case, ENCRYPTED_LOG_SILOING_AMOUNT=0 in the above function, and the reset variant with =1 is chosen. Since there is only 1 log overall, it passes. Otherwise, it fails the capped_size check for the same reasons we modify the NULLIFIER_SILOING_AMOUNT just above this fn.
...ir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr
Show resolved
Hide resolved
...col-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr
Outdated
Show resolved
Hide resolved
| public encryptedLogs: EncryptedTxL2Logs, | ||
| /** | ||
| * Unencrypted logs generated by the tx. | ||
| * NOTE: These do not get filled, but remain here so enqueued_calls_processor.ts can accumulate public logs |
There was a problem hiding this comment.
We really shouldn't change the tx directly for new logs :(
But I'll refactor it in my next pr!
There was a problem hiding this comment.
Agree, it was becoming a huge pain to try and rework the calls processor to store them elsewhere in this PR :(
* master: (245 commits) chore: pull signed bitshifts from sync PR (#9939) chore: pull frontend changes from sync PR (#9935) feat: separate bytecode logs from unencrypted logs (#9891) git subrepo push --branch=master noir-projects/aztec-nr git_subrepo.sh: Fix parent in .gitrepo file. [skip ci] chore: replace relative paths to noir-protocol-circuits git subrepo push --branch=master barretenberg fix: token naming issue (#9950) feat: multiplier oracle (#9902) refactor: token refunds cleanup (#9943) chore: Use stack based recursion instead of function recursion (#9947) feat: parallelize DIE pass (#9933) feat(avm): Simulator enforces integral tag for DIV and field tag for FDIV (#9944) chore(avm): bugfixing witness generation for add, sub, mul for FF (#9938) feat: Google Cloud Kubernetes cluster + AWS Firewall Rules (#9915) chore: nuking ancient redundant test (#9941) fix: include 'master' version for aztec-up scripts (#9940) chore: fixing test contract fixture (#9909) refactor: token naming cleanup (#9904) chore: pull SSA parser from sync PR (#9928) ...
Adds bytecode logs to a new array:
contractClassLogs, emitted from private only. This PR:UnencryptedLogs, as they have the same structure and logic)getContractClassLogsto pxe, log stores, archivercloses #9590