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 #6941

Merged
merged 24 commits into from
Jun 6, 2024
Merged

feat: Sync from noir #6941

merged 24 commits into from
Jun 6, 2024

Conversation

AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Jun 6, 2024

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix(elaborator): Lazily elaborate globals (noir-lang/noir#5191)
chore: schnorr signature verification in noir (noir-lang/noir#5188)
fix(experimental elaborator): Fix globals which use function calls (noir-lang/noir#5172)
feat!: restrict noir word size to u32 (noir-lang/noir#5180)
chore: break out helper methods for writing foreign call results (noir-lang/noir#5181)
fix: Fix panic in get_global_let_statement (noir-lang/noir#5177)
fix(elaborator): Invert unconstrained check (noir-lang/noir#5176)
chore: loosen trait bounds on impls depending on AcirField (noir-lang/noir#5115)
feat: support casting in globals (noir-lang/noir#5164)
chore(experimental elaborator): Handle comptime expressions in the elaborator (noir-lang/noir#5169)
chore: avoid manual creation of contract artifact in wasm (noir-lang/noir#5117)
chore: start moving lints into a separate linting directory (noir-lang/noir#5165)
chore: move acir docs to code declaration (noir-lang/noir#5040)
feat!: separate proving from noir_js (noir-lang/noir#5072)
END_COMMIT_OVERRIDE

AztecBot and others added 11 commits June 6, 2024 12:17
…noir#5188)

fix(experimental elaborator): Fix globals which use function calls (noir-lang/noir#5172)
feat!: restrict noir word size to u32 (noir-lang/noir#5180)
chore: break out helper methods for writing foreign call results (noir-lang/noir#5181)
fix: Fix panic in `get_global_let_statement` (noir-lang/noir#5177)
fix(elaborator): Invert unconstrained check (noir-lang/noir#5176)
chore: loosen trait bounds on impls depending on `AcirField` (noir-lang/noir#5115)
feat: support casting in globals (noir-lang/noir#5164)
chore(experimental elaborator): Handle `comptime` expressions in the elaborator (noir-lang/noir#5169)
chore: avoid manual creation of contract artifact in wasm (noir-lang/noir#5117)
chore: start moving lints into a separate linting directory (noir-lang/noir#5165)
chore: move acir docs to code declaration (noir-lang/noir#5040)
feat!: separate proving from `noir_js` (noir-lang/noir#5072)
…#5191)

chore: schnorr signature verification in noir (noir-lang/noir#5188)
fix(experimental elaborator): Fix globals which use function calls (noir-lang/noir#5172)
feat!: restrict noir word size to u32 (noir-lang/noir#5180)
chore: break out helper methods for writing foreign call results (noir-lang/noir#5181)
fix: Fix panic in `get_global_let_statement` (noir-lang/noir#5177)
fix(elaborator): Invert unconstrained check (noir-lang/noir#5176)
chore: loosen trait bounds on impls depending on `AcirField` (noir-lang/noir#5115)
feat: support casting in globals (noir-lang/noir#5164)
chore(experimental elaborator): Handle `comptime` expressions in the elaborator (noir-lang/noir#5169)
chore: avoid manual creation of contract artifact in wasm (noir-lang/noir#5117)
chore: start moving lints into a separate linting directory (noir-lang/noir#5165)
chore: move acir docs to code declaration (noir-lang/noir#5040)
feat!: separate proving from `noir_js` (noir-lang/noir#5072)
chore: schnorr signature verification in noir (noir-lang/noir#5188)
fix(experimental elaborator): Fix globals which use function calls (noir-lang/noir#5172)
feat!: restrict noir word size to u32 (noir-lang/noir#5180)
chore: break out helper methods for writing foreign call results (noir-lang/noir#5181)
fix: Fix panic in `get_global_let_statement` (noir-lang/noir#5177)
fix(elaborator): Invert unconstrained check (noir-lang/noir#5176)
chore: loosen trait bounds on impls depending on `AcirField` (noir-lang/noir#5115)
feat: support casting in globals (noir-lang/noir#5164)
chore(experimental elaborator): Handle `comptime` expressions in the elaborator (noir-lang/noir#5169)
chore: avoid manual creation of contract artifact in wasm (noir-lang/noir#5117)
chore: start moving lints into a separate linting directory (noir-lang/noir#5165)
chore: move acir docs to code declaration (noir-lang/noir#5040)
feat!: separate proving from `noir_js` (noir-lang/noir#5072)
Copy link
Contributor

github-actions bot commented Jun 6, 2024

Changes to circuit sizes

Generated at commit: cac3da4048a11f435c7d233da9bbb694c4677036, compared to commit: 46dcb985e98ca26ee2dd3d2ec98976f1d8f27ba7

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_tail 0 ➖ 0.00% -1,064 ✅ -0.09%
public_kernel_tail 0 ➖ 0.00% -12,105 ✅ -0.27%
private_kernel_init 0 ➖ 0.00% -1,064 ✅ -0.27%
public_kernel_teardown 0 ➖ 0.00% -5,946 ✅ -0.32%
public_kernel_app_logic 0 ➖ 0.00% -5,946 ✅ -0.32%
public_kernel_setup 0 ➖ 0.00% -5,742 ✅ -0.35%
private_kernel_inner 0 ➖ 0.00% -4,638 ✅ -0.36%
private_kernel_tail_to_public 0 ➖ 0.00% -7,710 ✅ -0.38%
private_kernel_reset 0 ➖ 0.00% -15,624 ✅ -0.61%
private_kernel_reset_big 0 ➖ 0.00% -13,080 ✅ -0.77%
private_kernel_reset_medium 0 ➖ 0.00% -11,808 ✅ -0.92%
private_kernel_reset_small 0 ➖ 0.00% -11,172 ✅ -1.05%
rollup_base 0 ➖ 0.00% -24,330 ✅ -1.14%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_tail 19,768 (0) 0.00% 1,249,211 (-1,064) -0.09%
public_kernel_tail 983,065 (0) 0.00% 4,463,468 (-12,105) -0.27%
private_kernel_init 30,382 (0) 0.00% 390,341 (-1,064) -0.27%
public_kernel_teardown 295,149 (0) 0.00% 1,842,270 (-5,946) -0.32%
public_kernel_app_logic 294,951 (0) 0.00% 1,842,031 (-5,946) -0.32%
public_kernel_setup 244,113 (0) 0.00% 1,645,111 (-5,742) -0.35%
private_kernel_inner 53,009 (0) 0.00% 1,278,065 (-4,638) -0.36%
private_kernel_tail_to_public 455,774 (0) 0.00% 2,029,064 (-7,710) -0.38%
private_kernel_reset 241,966 (0) 0.00% 2,530,566 (-15,624) -0.61%
private_kernel_reset_big 178,779 (0) 0.00% 1,688,827 (-13,080) -0.77%
private_kernel_reset_medium 147,187 (0) 0.00% 1,267,959 (-11,808) -0.92%
private_kernel_reset_small 131,390 (0) 0.00% 1,057,524 (-11,172) -1.05%
rollup_base 191,347 (0) 0.00% 2,118,750 (-24,330) -1.14%

@Maddiaa0 Maddiaa0 enabled auto-merge (squash) June 6, 2024 15:35
@Maddiaa0
Copy link
Member

Maddiaa0 commented Jun 6, 2024

note to self: stop merging master

@AztecBot
Copy link
Collaborator Author

AztecBot commented Jun 6, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_proving_time_in_ms (base-rollup): 83,527 (+20%)
  • protocol_circuit_proving_time_in_ms (root-parity): 41,312 (+21%)
  • protocol_circuit_proving_time_in_ms (public-kernel-setup): 44,823 (+19%)
  • protocol_circuit_proving_time_in_ms (public-kernel-app-logic): 46,677 (+20%)
  • protocol_circuit_proving_time_in_ms (public-kernel-teardown): 45,321 (+17%)
  • protocol_circuit_proving_time_in_ms (public-kernel-tail): 182,490 (+18%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 22,845 (+17%)
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,734 1,560 697 754 (+1%) 778 (+1%)
proof_construction_time_sha256_30_ms 11,411 3,057 1,375 1,427 (+1%) 1,451
proof_construction_time_sha256_100_ms 43,854 11,763 5,417 5,358 5,356
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 58.0 88.0
proof_construction_time_poseidon_hash_30_ms 1,522 420 202 222 (-1%) 266
proof_construction_time_poseidon_hash_100_ms 5,760 1,580 728 792 (+3%) 798 (+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,464 9,454 9,452
l1_rollup_execution_gas 610,285 610,275 610,273
l2_block_processing_time_in_ms 698 1,292 (-1%) 2,493 (+2%)
l2_block_building_time_in_ms 22,265 (-1%) 45,913 87,409 (-1%)
l2_block_rollup_simulation_time_in_ms 22,157 (-1%) 45,560 87,008 (-1%)
l2_block_public_tx_process_time_in_ms 19,062 42,126 83,735 (-1%)

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 5,941 (-1%) 8,541 (-1%)
node_database_size_in_bytes 9,482,320 12,738,640
pxe_database_size_in_bytes 9,242 15,127

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 135 467 (-5%) 13,265 (+9%) 20,634 64,614 89,536 2,731 524,288
private-kernel-inner 390 (-1%) 937 (-8%) 50,264 (+11%) 92,326 64,614 89,536 2,731 2,097,152
private-kernel-tail 369 1,974 (+3%) 42,674 (+12%) 96,545 68,261 11,648 297 2,097,152
base-parity 6.48 1,632 (-4%) 2,645 (+5%) 128 64.0 2,208 2.00 131,072
root-parity 49.6 62.0 (+20%) ⚠️ 41,312 (+21%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 7,347 (+13%) 2,390 (+2%) ⚠️ 83,527 (+20%) 119,738 756 3,648 47.0 4,194,304
root-rollup 110 (-1%) 78.3 (+24%) ⚠️ 22,845 (+17%) 25,309 620 3,456 41.0 1,048,576
public-kernel-app-logic 567 (-1%) 3,417 (-3%) ⚠️ 46,677 (+20%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,137 22,324 (-4%) ⚠️ 182,490 (+18%) 403,238 7,646 11,648 297 8,388,608
private-kernel-reset-small 588 1,974 (-4%) 47,687 (+12%) 120,737 64,614 89,536 2,731 2,097,152
public-kernel-setup 659 (-2%) 2,688 (+1%) ⚠️ 44,823 (+19%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-teardown 565 (-1%) 3,448 (-2%) ⚠️ 45,321 (+17%) 108,073 86,550 116,768 3,582 2,097,152
merge-rollup 29.0 (+1%) N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 6,903 (-2%) 53,252 (+10%) N/A N/A 116,768 3,582 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 9,944 464 (-1%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 40.6 (-2%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,769 (-2%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,420 (-3%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,815 (-1%) 16,768 53,881 (+7%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,565 (-6%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 1,036 (-8%) 16,768 11,039 (+9%) 524,288 457
Token:transfer 1,376 9,944 5,327 (-2%) 16,768 53,857 (+11%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,390 (-1%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 75.9 (-1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,892 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,819 N/A N/A N/A N/A

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 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 (-1%) 16.9 (-1%) N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.7 31.8 N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.605 (-1%) 0.518 (-1%) N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 48.6 (-1%) 76.6 134 247 481 (+1%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 288 543 1,055 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.496 (-1%) 0.472 (+1%) 0.458 0.449 0.449 (+1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.5 (-1%) 113 185 356 (-1%) 708 (+1%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 108 208 355 691 1,363 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.506 0.507 0.489 0.482 (-1%) 0.487 (+2%) N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A 59.9 (-1%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A 103
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A 0.550 (-1%)

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 79,470 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@Maddiaa0 Maddiaa0 merged commit bf38cc2 into master Jun 6, 2024
89 checks passed
@Maddiaa0 Maddiaa0 deleted the sync-noir branch June 6, 2024 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants