Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sync from noir #8701

Merged
merged 21 commits into from
Sep 24, 2024
Merged

feat: Sync from noir #8701

merged 21 commits into from
Sep 24, 2024

Conversation

AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Sep 23, 2024

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat: swap endianness in-place in keccak implementation (noir-lang/noir#6128)
feat: (LSP) remove unused imports (noir-lang/noir#6129)
fix: handle parenthesized expressions in array length (noir-lang/noir#6132)
chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
END_COMMIT_OVERRIDE

AztecBot and others added 7 commits September 23, 2024 19:22
…ir-lang/noir#6132)

chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
…oir-lang/noir#6128)

feat: (LSP) remove unused imports (noir-lang/noir#6129)
fix: handle parenthesized expressions in array length (noir-lang/noir#6132)
chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
…ir#6128)

feat: (LSP) remove unused imports (noir-lang/noir#6129)
fix: handle parenthesized expressions in array length (noir-lang/noir#6132)
chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
@TomAFrench TomAFrench added the bench-all CI: Enables this CI job. label Sep 23, 2024
TomAFrench and others added 8 commits September 23, 2024 21:25
…oir-lang/noir#6128)

feat: (LSP) remove unused imports (noir-lang/noir#6129)
fix: handle parenthesized expressions in array length (noir-lang/noir#6132)
chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
…ir#6128)

feat: (LSP) remove unused imports (noir-lang/noir#6129)
fix: handle parenthesized expressions in array length (noir-lang/noir#6132)
chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
@AztecBot
Copy link
Collaborator Author

AztecBot commented Sep 24, 2024

Benchmark results

Metrics with a significant change:

  • app_circuit_witness_generation_time_in_ms (SchnorrAccount:verify_private_authwit): 26.3 (-55%)
  • protocol_circuit_simulation_time_in_ms (private-kernel-tail-to-public): 786 (-46%)
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.

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,780 (+1%) 1,549 703 (+1%) 764 (-3%) 764 (-1%)
proof_construction_time_sha256_30_ms 22,868 6,099 2,755 (-1%) 2,782 (-1%) 2,808 (-1%)
proof_construction_time_sha256_100_ms 44,364 11,841 6,138 (+13%) 5,398 5,338 (-1%)
proof_construction_time_poseidon_hash_ms 79.0 (+1%) 34.0 34.0 58.0 (-2%) 87.0 (-1%)
proof_construction_time_poseidon_hash_30_ms 1,536 (+1%) 421 (+1%) 201 226 (+2%) 269 (-3%)
proof_construction_time_poseidon_hash_100_ms 5,681 1,521 672 (-1%) 731 (+2%) 749 (-6%)

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 4,612 8,260 15,556
l1_rollup_calldata_gas 52,804 97,690 187,276
l1_rollup_execution_gas 822,394 1,559,302 3,352,039
l2_block_processing_time_in_ms 244 436 (-2%) 803 (+1%)
l2_block_building_time_in_ms 4,554 8,950 17,732
l2_block_rollup_simulation_time_in_ms 4,553 8,950 17,732
l2_block_public_tx_process_time_in_ms 4,530 8,919 17,699

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 2,773 (-2%) 3,657
node_database_size_in_bytes 12,357,872 16,343,280
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 input_size_in_bytes output_size_in_bytes proving_time_in_ms
private-kernel-init 77.7 (+3%) 390 (-2%) 21,179 44,898 N/A
private-kernel-inner 138 (-1%) 688 (-3%) 72,235 45,020 N/A
private-kernel-reset-tiny 320 (+2%) 698 (-3%) 64,546 44,886 N/A
private-kernel-tail 151 130 (-4%) 50,576 59,239 N/A
public-kernel-setup 52.1 N/A 114,697 79,670 N/A
public-kernel-app-logic 52.0 (-1%) N/A 114,697 79,670 N/A
public-kernel-tail 495 N/A 487,098 16,414 N/A
private-kernel-reset-small 293 (+1%) N/A 66,345 45,629 N/A
private-kernel-tail-to-public ⚠️ 786 (-46%) 600 (-3%) 444,583 1,825 N/A
public-kernel-teardown 52.6 (+1%) N/A 114,697 79,670 N/A
undefined N/A N/A N/A N/A 102,790 (+1%)

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms
ContractClassRegisterer:register 1,344 11,731 344 (-1%)
ContractInstanceDeployer:deploy 1,408 11,731 35.1
MultiCallEntrypoint:entrypoint 1,920 11,731 435 (-2%)
FeeJuice:deploy 1,376 11,731 418 (+1%)
SchnorrAccount:constructor 1,312 11,731 99.9 (-1%)
SchnorrAccount:entrypoint 2,336 11,731 405 (-1%)
FeeJuice:claim 1,344 11,731 51.4 (-1%)
Token:privately_mint_private_note 1,280 11,731 117 (-13%)
FPC:fee_entrypoint_public 1,344 11,731 55.7 (-3%)
Token:transfer 1,312 11,731 165 (+1%)
Benchmarking:create_note 1,344 11,731 100
SchnorrAccount:verify_private_authwit 1,280 11,731 ⚠️ 26.3 (-55%)
Token:unshield 1,376 11,731 577 (-2%)
FPC:fee_entrypoint_private 1,376 11,731 762 (-3%)

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 7.19 (+12%) 1,052 (+1%)
FeeJuice:set_portal 7.32 (-7%) 1,070 (+3%)
Token:constructor 179 (-2%) 7,327 (+3%)
FPC:constructor 14.5 (+28%) 4,757 (+4%)
FeeJuice:check_balance 3.35 (+1%) 936 (+2%)
Token:mint_public 8.00 (+5%) 1,942 (+2%)
Token:assert_minter_and_mint 5.02 (-7%) 1,260 (+2%)
AuthRegistry:set_authorized 2.99 (+8%) 464
FPC:prepare_fee 60.7 (+15%) 1,077 (+1%)
Token:transfer_public 11.6 (+3%) 5,467 (+3%)
FPC:pay_refund 33.4 (-4%) 1,494 (+1%)
Benchmarking:increment_balance 9.94 (+8%) 1,432 (+2%)
Token:_increase_public_balance 4.79 (+2%) 1,097 (+1%)
FPC:pay_refund_with_shielded_rebate 41.1 (-6%) 1,383 (+1%)

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.662 (-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 2.13 (-1%) 3.96 (-2%) 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.111 (-2%) 0.111 (-3%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 11.0 (-3%) 18.3 (-1%) 30.8 58.0 (-1%) 113 (+1%)
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.105 (-3%) 0.107 (-1%) 0.100 0.100 0.101 (+1%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.2 (-3%) 26.1 44.1 81.2 (-1%) 160 (-1%)
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 108 207 355 691 1,363
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.108 (-3%) 0.105 (-1%) 0.102 (-4%) 0.100 (-1%) 0.101 (-2%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.4 (-1%) N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A 132 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A 0.106 (-1%) 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 72,435 671,025

Transaction size based on fee payment method

| Metric | |
| - | |

AztecBot and others added 6 commits September 24, 2024 08:02
…oir-lang/noir#6128)

feat: (LSP) remove unused imports (noir-lang/noir#6129)
fix: handle parenthesized expressions in array length (noir-lang/noir#6132)
chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
…ir#6128)

feat: (LSP) remove unused imports (noir-lang/noir#6129)
fix: handle parenthesized expressions in array length (noir-lang/noir#6132)
chore: remove bubble_up_constrains (noir-lang/noir#6127)
fix: Consider constants as used values to keep their rc ops (noir-lang/noir#6122)
@TomAFrench TomAFrench merged commit 4522c4f into master Sep 24, 2024
51 checks passed
@TomAFrench TomAFrench deleted the sync-noir branch September 24, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bench-all CI: Enables this CI job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants