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

Merged
merged 8 commits into from
May 29, 2024
Merged

feat: Sync from noir #6730

merged 8 commits into from
May 29, 2024

Conversation

AztecBot
Copy link
Collaborator

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: remove duplicated code from LSP (noir-lang/noir#5116)
fix(experimental elaborator): Avoid calling add_generics twice on trait methods (noir-lang/noir#5108)
fix(experimental elaborator): Fix duplicate resolve_type on self type and don't leak a trait impl's generics (noir-lang/noir#5102)
feat: replace stdlib poseidon implementation with optimized version (noir-lang/noir#5122)
fix(experimental elaborator): Only call add_generics once (noir-lang/noir#5091)
fix(experimental elaborator): Fix panic in the elaborator (noir-lang/noir#5082)
chore: move is_native_field up into noirc_frontend (noir-lang/noir#5119)
END_COMMIT_OVERRIDE

AztecBot and others added 2 commits May 29, 2024 11:45
fix(experimental elaborator): Avoid calling `add_generics` twice on trait methods (noir-lang/noir#5108)
fix(experimental elaborator): Fix duplicate `resolve_type` on self type and don't leak a trait impl's generics (noir-lang/noir#5102)
feat: replace stdlib poseidon implementation with optimized version (noir-lang/noir#5122)
fix(experimental elaborator): Only call `add_generics` once (noir-lang/noir#5091)
fix(experimental elaborator): Fix panic in the elaborator (noir-lang/noir#5082)
chore: move `is_native_field` up into `noirc_frontend` (noir-lang/noir#5119)
* master:
  feat: prepare circuit output for validation (#6678)
  chore: stop building/publishing `acvm_backend.wasm` (#6584)
  chore: add bench programs (#6566)
  chore: make public data update requests, note hashes, and unencrypted logs readonly in TS (#6658)
  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
  feat: update honk recursion constraint (#6545)
  feat: Add code-workspace and update build dirs (#6723)
  feat: Sync from noir (#6717)
  feat: folding acir programs (#6685)
  feat: sumcheck part of ECCVM recursive verifier instantiated as an UltraCircuit (#6413)
@TomAFrench
Copy link
Member

🤦 Always forget I can just approve these myself.

@TomAFrench TomAFrench enabled auto-merge (squash) May 29, 2024 12:18
@AztecBot
Copy link
Collaborator Author

AztecBot commented May 29, 2024

Benchmark results

Metrics with a significant change:

  • proof_construction_time_poseidon_hash_ms (1): 79.0 (-66%)
  • proof_construction_time_poseidon_hash_ms (4): 34.0 (-57%)
  • proof_construction_time_poseidon_hash_ms (16): 34.0 (-41%)
  • proof_construction_time_poseidon_hash_ms (32): 58.0 (-35%)
  • proof_construction_time_poseidon_hash_ms (64): 88.0 (-41%)
  • proof_construction_time_poseidon_hash_100_ms (1): 5,756 (-49%)
  • proof_construction_time_poseidon_hash_100_ms (4): 1,561 (-49%)
  • proof_construction_time_poseidon_hash_100_ms (16): 723 (-47%)
  • proof_construction_time_poseidon_hash_100_ms (32): 769 (-45%)
  • proof_construction_time_poseidon_hash_100_ms (64): 793 (-45%)
  • proof_construction_time_poseidon_hash_30_ms (1): 1,519 (-74%)
  • proof_construction_time_poseidon_hash_30_ms (4): 419 (-73%)
  • proof_construction_time_poseidon_hash_30_ms (16): 202 (-72%)
  • proof_construction_time_poseidon_hash_30_ms (32): 223 (-71%)
  • proof_construction_time_poseidon_hash_30_ms (64): 265 (-66%)
  • protocol_circuit_witness_generation_time_in_ms (root-parity): 61.7 (-38%)
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,723 1,553 (+1%) 697 (-1%) 757 (+3%) 779 (+1%)
proof_construction_time_sha256_30_ms 11,749 (+3%) 3,166 (+3%) 1,405 (+3%) 1,436 (+1%) 1,463 (+1%)
proof_construction_time_sha256_100_ms 43,786 11,707 (-1%) 5,410 5,385 (-11%) 5,344 (-1%)
proof_construction_time_poseidon_hash_ms ⚠️ 79.0 (-66%) ⚠️ 34.0 (-57%) ⚠️ 34.0 (-41%) ⚠️ 58.0 (-35%) ⚠️ 88.0 (-41%)
proof_construction_time_poseidon_hash_30_ms ⚠️ 1,519 (-74%) ⚠️ 419 (-73%) ⚠️ 202 (-72%) ⚠️ 223 (-71%) ⚠️ 265 (-66%)
proof_construction_time_poseidon_hash_100_ms ⚠️ 5,756 (-49%) ⚠️ 1,561 (-49%) ⚠️ 723 (-47%) ⚠️ 769 (-45%) ⚠️ 793 (-45%)

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 1,412 1,412 1,412
l1_rollup_calldata_gas 9,464 9,476 9,476
l1_rollup_execution_gas 616,105 616,117 616,117
l2_block_processing_time_in_ms 1,286 4,810 9,568
l2_block_building_time_in_ms 45,433 (-1%) 180,487 360,729 (-1%)
l2_block_rollup_simulation_time_in_ms 45,258 (-1%) 179,845 359,462 (-1%)
l2_block_public_tx_process_time_in_ms 24,397 (-1%) 102,231 209,195 (-1%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 9,474 14,405
node_database_size_in_bytes 14,520,400 21,356,624
pxe_database_size_in_bytes 18,071 29,868

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 134 (-1%) 477 (-2%) 12,427 (-13%) 20,630 64,614 89,536 2,731 524,288
private-kernel-inner 407 932 (+2%) 46,890 92,318 64,614 89,536 2,731 2,097,152
private-kernel-tail 583 2,639 (+1%) 43,996 (-2%) 96,541 77,732 11,648 297 2,097,152
base-parity 6.43 1,207 (+6%) 2,800 (+1%) 128 64.0 2,208 2.00 131,072
root-parity 48.7 ⚠️ 61.7 (-38%) 52,218 (+3%) 27,084 64.0 2,720 18.0 2,097,152
base-rollup 722 (-1%) 2,408 87,816 (+4%) 119,734 756 3,648 47.0 4,194,304
root-rollup 109 77.5 (-1%) 23,196 (+1%) 25,297 620 3,456 41.0 1,048,576
public-kernel-app-logic 532 3,078 52,978 (+3%) 105,253 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,110 (-1%) 22,827 (-4%) 177,403 401,002 7,646 11,648 297 8,388,608
private-kernel-reset-small 590 2,104 49,638 120,733 64,614 89,536 2,731 2,097,152
merge-rollup 28.5 N/A N/A 16,534 756 N/A N/A N/A
public-kernel-setup 639 (-1%) N/A N/A 105,253 86,550 N/A N/A N/A
public-kernel-teardown 540 (-1%) N/A N/A 105,253 86,550 N/A N/A N/A
private-kernel-tail-to-public N/A 8,147 (-3%) 105,196 (-1%) N/A N/A 116,768 3,582 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 461 N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 40.9 (-2%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,673 (+1%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,417 N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,605 16,768 54,584 (+2%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,525 (-1%) N/A N/A N/A N/A
Token:transfer 1,376 9,944 4,875 16,768 57,963 (+1%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,406 N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 225 N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 76.6 (-1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,699 N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,554 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 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 16.9 N/A 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 N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.602 0.516 N/A 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.3 76.0 248 476 928 1,846 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.494 0.469 0.448 0.444 0.441 0.440 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 57.8 113 356 (+1%) 699 1,387 2,765 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 106 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.500 0.505 0.483 (+1%) 0.480 0.480 0.480 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 62.4
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 107
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.554

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 84,050 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

TomAFrench added a commit that referenced this pull request May 29, 2024
This PR adds linting and formatting to the AVM transpiler's CI checks.
My main reasoning for this is that I noticed in #6730 that we're pulling
in the whole of the Noir compiler for some reason but not actually using
it, this could have been caught with clippy lints.

I've also copied across the `.rustfmt.toml` from Noir as this prevents
some shorter lines being split over multiple lines (which improves
readability imo). Happy to revert this change if it's unwanted.
* master:
  chore: add linting to avm-transpiler CI (#6732)
  feat(avm): poseidon2 gadget (#6504)
  chore(ci): try a different ubuntu runner (#6740)
  feat(nargo): hidden option to show contract artifact paths written by `nargo compile` (#6131)
  feat(avm): sha256_compression (#6452)
@TomAFrench TomAFrench merged commit 46c2ad0 into master May 29, 2024
90 checks passed
@TomAFrench TomAFrench deleted the sync-noir branch May 29, 2024 17:32
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.

2 participants