AztecProtocol / aztec-packages

Apache License 2.0
155 stars 157 forks source link

feat: Sync from noir #7288

Closed AztecBot closed 2 days ago

AztecBot commented 3 days ago

Automated pull of development from the noir programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE feat: Sync from aztec-packages (https://github.com/noir-lang/noir/pull/5387) feat: Implement trait dispatch in the comptime interpreter (https://github.com/noir-lang/noir/pull/5376) feat(lsp): allow function rename (https://github.com/noir-lang/noir/pull/4294) chore: use mod.nr files in stdlib (https://github.com/noir-lang/noir/pull/5379) fix: Replace std::HashMap with FxHashMap to fix frontend indeterminism (https://github.com/noir-lang/noir/pull/5385) fix: Remove panics in the interpreter when a builtin fails to type check (https://github.com/noir-lang/noir/pull/5382) fix: Replace expects in interpreter with errors (https://github.com/noir-lang/noir/pull/5383) END_COMMIT_OVERRIDE

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/7288.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_ms | 5,749 | 1,564 | 714 | 746 (-6%) | 778 (+1%) | proof_construction_time_sha256_30_ms | 11,948 (-1%) | 3,202 | 1,425 | 1,435 (-1%) | 1,476 (-1%) | proof_construction_time_sha256_100_ms | 43,959 | 11,805 (-1%) | 5,486 (-1%) | 5,421 (-1%) | 5,367 (-1%) | proof_construction_time_poseidon_hash_ms | 79.0 | 34.0 | 35.0 (+3%) | 58.0 | 88.0 | proof_construction_time_poseidon_hash_30_ms | 1,528 | 418 | 201 | 232 (+1%) | 269 (+1%) | proof_construction_time_poseidon_hash_100_ms | 5,789 | 1,573 | 726 | 774 (-1%) | 804 (+1%) | ### 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,464 | 9,476 | l1_rollup_execution_gas | 611,191 | 611,354 | 611,517 | l2_block_processing_time_in_ms | 756 (+1%) | 1,428 (+1%) | 2,704 | l2_block_building_time_in_ms | 20,848 | 42,127 (+1%) | 81,552 | l2_block_rollup_simulation_time_in_ms | 20,848 | 42,127 (+1%) | 81,551 | l2_block_public_tx_process_time_in_ms | 17,835 | 38,895 (+1%) | 78,400 | ### 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,110 (+2%) | 9,951 (+1%) | node_database_size_in_bytes | 12,279,888 | 16,162,896 | 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 | 103 | 384 | 12,986 (+2%) | 19,482 | 54,134 | 73,920 | 2,243 | 524,288 | private-kernel-inner | 311 (+1%) | :warning: 902 (**+19%**) | 49,529 (+1%) | 80,694 | 54,134 | 73,920 | 2,243 | 2,097,152 | private-kernel-tail | 1,087 | 2,553 (-1%) | 52,320 (+7%) | 61,457 | 62,057 | 14,912 | 399 | 2,097,152 | base-parity | 6.12 | 1,531 (-2%) | 2,636 (+1%) | 128 | 64.0 | 2,208 | 2.00 | 131,072 | root-parity | 48.7 (-1%) | 69.8 (+3%) | 41,729 (+6%) | 27,100 | 64.0 | 2,720 | 18.0 | 2,097,152 | base-rollup | 6,578 | 4,890 (+1%) | 89,166 (+1%) | 170,330 | 728 | 3,648 | 47.0 | 4,194,304 | root-rollup | 110 | 93.3 (+12%) | 24,286 (-2%) | 25,253 | 620 | 3,456 | 41.0 | 1,048,576 | public-kernel-setup | 532 (-1%) | 2,375 | 42,340 (+2%) | 102,121 | 80,278 | 106,912 | 3,274 | 2,097,152 | public-kernel-app-logic | 502 | 3,347 (+2%) | 43,408 (-2%) | 102,121 | 80,278 | 106,912 | 3,274 | 2,097,152 | public-kernel-tail | 1,148 | 26,608 (+1%) | 177,138 (-1%) | 399,014 | 10,014 | 14,912 | 399 | 8,388,608 | private-kernel-reset-small | 467 | 1,102 (+2%) | 30,449 (+3%) | 109,233 | 54,134 | 73,920 | 2,243 | 1,048,576 | public-kernel-teardown | 483 (-1%) | 3,382 (+2%) | 43,437 (-2%) | 102,121 | 80,278 | 106,912 | 3,274 | 2,097,152 | merge-rollup | 29.2 | N/A | N/A | 16,486 | 728 | N/A | N/A | N/A | private-kernel-tail-to-public | N/A | 8,342 | 51,883 (-3%) | N/A | N/A | 106,912 | 3,274 | 2,097,152 | 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 | 8,792 | 410 (+2%) | N/A | N/A | N/A | N/A | ContractInstanceDeployer:deploy | 1,408 | 8,792 | 38.7 | N/A | N/A | N/A | N/A | MultiCallEntrypoint:entrypoint | 1,920 | 8,792 | 1,195 (+1%) | N/A | N/A | N/A | N/A | GasToken:deploy | 1,376 | 8,792 | 892 | N/A | N/A | N/A | N/A | SchnorrAccount:constructor | 1,312 | 8,792 | 489 (+1%) | N/A | N/A | N/A | N/A | SchnorrAccount:entrypoint | 2,304 | 8,792 | 1,622 | 14,720 | 53,267 (-2%) | 2,097,152 | 393 | Token:privately_mint_private_note | 1,280 | 8,792 | 626 | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_public | 1,344 | 8,792 | 270 (-1%) | 14,720 | 11,454 (+2%) | 524,288 | 393 | Token:transfer | 1,312 | 8,792 | 1,791 | 14,720 | 12,858 (+1%) | 524,288 | 393 | AuthRegistry:set_authorized (avm) | 19,226 | N/A | N/A | 91,264 | 1,330 (+4%) | N/A | N/A | FPC:prepare_fee (avm) | 26,668 | N/A | N/A | 91,328 | 2,920 (+4%) | N/A | N/A | Token:transfer_public (avm) | 42,918 | N/A | N/A | 91,328 | 3,832 (-1%) | N/A | N/A | AuthRegistry:consume (avm) | 33,104 | N/A | N/A | 91,264 | 2,910 (+3%) | N/A | N/A | FPC:pay_refund (avm) | 36,833 | N/A | N/A | 91,296 | 22,745 | N/A | N/A | Benchmarking:create_note | 1,344 | 8,792 | 480 | N/A | N/A | N/A | N/A | SchnorrAccount:verify_private_authwit | 1,280 | 8,792 | 71.8 (-6%) | N/A | N/A | N/A | N/A | Token:unshield | 1,376 | 8,792 | 1,525 | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_private | 1,376 | 8,792 | 2,118 | 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 | 67.7 (-1%) | 13,790 | GasToken:set_portal | 18.0 (-8%) | 3,339 | Token:constructor | 92.6 (-7%) | 23,692 | FPC:constructor | 62.0 (-4%) | 13,592 | GasToken:mint_public | 52.6 (+2%) | 10,158 | Token:mint_public | 510 (+3%) | 19,034 | Token:assert_minter_and_mint | 55.1 | 12,925 | AuthRegistry:set_authorized | 32.8 (+5%) | 7,812 | FPC:prepare_fee | 110 | 15,062 | Token:transfer_public | :warning: 45.7 (**+45%**) | 31,218 | FPC:pay_refund | 136 (-1%) | 25,260 | Benchmarking:increment_balance | 2,206 | 15,267 | Token:_increase_public_balance | 55.7 | 15,006 | FPC:pay_refund_with_shielded_rebate | 115 (-2%) | 26,347 | ### Public DB Access Time to access various public DBs. | Function | time_ms | | - | - | get-nullifier-index | 0.163 (+5%) | ### 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.4 (+1%) | 16.8 (+1%) | 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.599 | 0.516 (+1%) | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_32_depth_ms | N/A | N/A | 48.4 (+1%) | 76.0 (+1%) | 131 | 248 (+2%) | 470 | 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.494 (+1%) | 0.467 (+1%) | 0.451 | 0.448 (+1%) | 0.439 | batch_insert_into_indexed_tree_20_depth_ms | N/A | N/A | 59.5 | 112 (+1%) | 183 (+1%) | 356 (+1%) | 692 | 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.502 | 0.502 (+1%) | 0.483 (+1%) | 0.482 (+1%) | 0.475 | batch_insert_into_indexed_tree_40_depth_ms | N/A | N/A | 72.8 (+1%) | 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.518 | 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 | 74,057 | 667,850 | Transaction size based on fee payment method | Metric | | | - | |