AztecProtocol / aztec-packages

Apache License 2.0
155 stars 156 forks source link

feat: Unify unencrypted log emission and decoding #7232

Closed sklppy88 closed 2 days ago

sklppy88 commented 3 days ago

Currently event_selectors for unencrypted_l2_logs emitted from public default to 0.

This will be further investigated and addressed with #7198.

sklppy88 commented 3 days ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @sklppy88 and the rest of your teammates on Graphite Graphite

AztecBot commented 3 days ago

Benchmark results

Metrics with a significant change:

Detailed results All benchmarks are run on txs on the `Benchmarking` contract on the repository. Each tx consists of a batch call to `create_note` and `increment_balance`, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write. This benchmark source data is available in JSON format on S3 [here](https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/benchmarks-v1/pulls/7232.json). ### Proof generation Each column represents the number of threads used in proof generation. | Metric | 1 threads | 4 threads | 16 threads | 32 threads | 64 threads | | - | - | - | - | - | - | proof_construction_time_sha256_30_ms | 11,405 | 3,063 (-3%) | 1,420 (+2%) | 1,447 (+1%) | 1,545 (+6%) | proof_construction_time_sha256_100_ms | 43,852 (-5%) | 11,800 (-1%) | 5,453 (-1%) | 5,435 (-1%) | 5,347 (-1%) | proof_construction_time_poseidon_hash_ms | 78.0 | 34.0 | 35.0 (+3%) | 59.0 (+4%) | 89.0 (+2%) | proof_construction_time_poseidon_hash_30_ms | 1,519 | 416 | 200 | 232 (+5%) | 272 (+1%) | proof_construction_time_poseidon_hash_100_ms | :warning: 5,743 (**-17%**) | 1,569 | 719 (-1%) | 766 | 795 | ### L2 block published to L1 Each column represents the number of txs on an L2 block published to L1. | Metric | 4 txs | 8 txs | 16 txs | | - | - | - | - | l1_rollup_calldata_size_in_bytes | 1,412 | 1,412 | 1,412 | l1_rollup_calldata_gas | 9,452 | 9,456 | 9,464 | l1_rollup_execution_gas | 610,273 | 610,277 | 610,285 | l2_block_processing_time_in_ms | 756 | 1,426 (+1%) | 2,705 (+1%) | l2_block_building_time_in_ms | 25,475 | 50,920 | 99,794 | l2_block_rollup_simulation_time_in_ms | 25,475 | 50,920 | 99,794 | l2_block_public_tx_process_time_in_ms | 21,892 | 47,150 | 96,074 | ### L2 chain processing Each column represents the number of blocks on the L2 chain where each block has 8 txs. | Metric | 3 blocks | 5 blocks | | - | - | - | node_history_sync_time_in_ms | 7,125 (+2%) | 10,034 (+2%) | node_database_size_in_bytes | 12,210,256 (+1%) | 16,093,264 | pxe_database_size_in_bytes | 16,254 | 26,813 | ### Circuits stats Stats on running time and I/O sizes collected for every kernel circuit run across all benchmarks. | Circuit | simulation_time_in_ms | witness_generation_time_in_ms | proving_time_in_ms | input_size_in_bytes | output_size_in_bytes | proof_size_in_bytes | num_public_inputs | size_in_gates | | - | - | - | - | - | - | - | - | - | private-kernel-init | 121 (+1%) | 491 (-1%) | 11,985 (-1%) | 20,634 | 67,190 | 92,352 | 2,819 | 524,288 | private-kernel-inner | 381 | 1,028 (-3%) | 44,734 (+1%) | 94,902 | 67,190 | 92,352 | 2,819 | 2,097,152 | private-kernel-tail | 309 | 1,809 (-1%) | 46,209 | 99,121 | 71,733 | 14,912 | 399 | 2,097,152 | base-parity | 6.31 (-2%) | 2,041 (+4%) | 2,562 (+2%) | 128 | 64.0 | 2,208 | 2.00 | 131,072 | root-parity | 50.1 (+1%) | 58.6 (-4%) | 33,916 | 27,100 | 64.0 | 2,720 | 18.0 | 2,097,152 | base-rollup | 7,920 | 5,086 (+1%) | 71,739 | 170,330 | 756 | 3,648 | 47.0 | 4,194,304 | root-rollup | 112 | 74.5 (+1%) | 19,731 (+1%) | 25,309 | 620 | 3,456 | 41.0 | 1,048,576 | public-kernel-setup | 728 (-1%) | 3,675 (-1%) | 38,565 | 116,905 | 93,334 | 125,344 | 3,850 | 2,097,152 | public-kernel-app-logic | 632 | 4,875 | 39,599 (-1%) | 116,905 | 93,334 | 125,344 | 3,850 | 2,097,152 | public-kernel-tail | 1,405 (-1%) | 32,705 (-9%) | 166,086 (+1%) | 511,910 | 10,014 | 14,912 | 399 | 8,388,608 | private-kernel-reset-small | 560 | 2,108 (-5%) | 41,152 (-1%) | 123,313 | 67,190 | 92,352 | 2,819 | 2,097,152 | public-kernel-teardown | 636 (-1%) | 4,872 (+1%) | 39,796 | 116,905 | 93,334 | 125,344 | 3,850 | 2,097,152 | merge-rollup | 29.2 | N/A | N/A | 16,542 | 756 | N/A | N/A | N/A | private-kernel-tail-to-public | N/A | 7,280 (-1%) | 84,578 | N/A | N/A | 125,344 | 3,850 | 4,194,304 | Stats on running time collected for app circuits | Function | input_size_in_bytes | output_size_in_bytes | witness_generation_time_in_ms | proof_size_in_bytes | proving_time_in_ms | size_in_gates | num_public_inputs | | - | - | - | - | - | - | - | - | ContractClassRegisterer:register | 1,344 | 9,944 | 425 | N/A | N/A | N/A | N/A | ContractInstanceDeployer:deploy | 1,408 | 9,944 | 40.4 | N/A | N/A | N/A | N/A | MultiCallEntrypoint:entrypoint | 1,920 | 9,944 | 1,805 | N/A | N/A | N/A | N/A | GasToken:deploy | 1,376 | 9,944 | 1,011 | N/A | N/A | N/A | N/A | SchnorrAccount:constructor | 1,312 | 9,944 | 1,431 | N/A | N/A | N/A | N/A | SchnorrAccount:entrypoint | 2,304 | 9,944 | 2,843 (-1%) | 16,768 | 50,817 | 2,097,152 | 457 | Token:privately_mint_private_note | 1,280 | 9,944 | 1,697 (-1%) | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_public | 1,344 | 9,944 | 377 | 16,768 | 10,274 | 524,288 | 457 | Token:transfer | 1,312 | 9,944 | 4,566 | 16,768 | 41,312 | 2,097,152 | 457 | AuthRegistry:set_authorized (avm) | 21,043 | N/A | N/A | 87,200 | 1,669 (+1%) | N/A | N/A | FPC:prepare_fee (avm) | 28,495 | N/A | N/A | 88,032 | 4,837 | N/A | N/A | Token:transfer_public (avm) | 44,885 | N/A | N/A | 87,754 | 3,605 (+4%) | N/A | N/A | AuthRegistry:consume (avm) | 34,973 | N/A | N/A | 87,616 | 2,801 (-1%) | N/A | N/A | FPC:pay_refund (avm) | 41,394 | N/A | N/A | 88,864 | 16,674 | N/A | N/A | Benchmarking:create_note | 1,344 | 9,944 | 1,403 (-1%) | N/A | N/A | N/A | N/A | SchnorrAccount:verify_private_authwit | 1,280 | 9,944 | 80.7 (-2%) | N/A | N/A | N/A | N/A | Token:unshield | 1,376 | 9,944 | 3,738 (+1%) | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_private | 1,376 | 9,944 | 4,701 (+1%) | N/A | N/A | N/A | N/A | ### AVM Simulation Time to simulate various public functions in the AVM. | Function | time_ms | bytecode_size_in_bytes | | - | - | - | GasToken:_increase_public_balance | 68.3 (-7%) | 13,873 | GasToken:set_portal | 16.5 (-4%) | 3,495 | Token:constructor | 101 (+8%) | 24,207 | FPC:constructor | 67.3 (+5%) | 13,893 | GasToken:mint_public | 54.5 (+3%) | 10,241 | Token:mint_public | :warning: 70.5 (**-89%**) | 19,216 | Token:assert_minter_and_mint | :warning: 224 (**+207%**) | 13,034 | AuthRegistry:set_authorized | 32.5 (-3%) | 7,869 | FPC:prepare_fee | 153 (+3%) | 15,129 | Token:transfer_public | 38.0 (-23%) | 31,425 | FPC:pay_refund | 184 (-10%) | 28,061 | Benchmarking:increment_balance | 2,692 | 15,407 | Token:_increase_public_balance | 60.6 (+8%) | 15,089 | FPC:pay_refund_with_shielded_rebate | 211 (+6%) | 29,148 | ### Public DB Access Time to access various public DBs. | Function | time_ms | | - | - | get-nullifier-index | 0.150 (+1%) | ### Tree insertion stats The duration to insert a fixed batch of leaves into each tree type. | Metric | 1 leaves | 16 leaves | 64 leaves | 128 leaves | 256 leaves | 512 leaves | 1024 leaves | | - | - | - | - | - | - | - | - | batch_insert_into_append_only_tree_16_depth_ms | 10.5 (+2%) | 16.8 | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_16_depth_hash_count | 16.8 | 31.7 | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_16_depth_hash_ms | 0.610 (+2%) | 0.515 | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_32_depth_ms | N/A | N/A | 49.0 | 75.6 (-1%) | 131 | 246 | 469 | batch_insert_into_append_only_tree_32_depth_hash_count | N/A | N/A | 95.9 | 159 | 287 | 543 | 1,055 | batch_insert_into_append_only_tree_32_depth_hash_ms | N/A | N/A | 0.500 | 0.465 (-1%) | 0.449 | 0.445 | 0.438 | batch_insert_into_indexed_tree_20_depth_ms | N/A | N/A | 60.0 | 112 (+1%) | 181 (-1%) | 354 (+1%) | 691 | batch_insert_into_indexed_tree_20_depth_hash_count | N/A | N/A | 109 | 207 | 355 | 691 | 1,363 | batch_insert_into_indexed_tree_20_depth_hash_ms | N/A | N/A | 0.508 | 0.502 | 0.480 | 0.479 | 0.474 | batch_insert_into_indexed_tree_40_depth_ms | N/A | N/A | 73.2 | N/A | N/A | N/A | N/A | batch_insert_into_indexed_tree_40_depth_hash_count | N/A | N/A | 133 | N/A | N/A | N/A | N/A | batch_insert_into_indexed_tree_40_depth_hash_ms | N/A | N/A | 0.521 | N/A | N/A | N/A | N/A | ### Miscellaneous Transaction sizes based on how many contract classes are registered in the tx. | Metric | 0 registered classes | 1 registered classes | | - | - | - | tx_size_in_bytes | 85,672 | 670,983 | Transaction size based on fee payment method | Metric | | | - | |