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

Merged
merged 9 commits into from
Jul 1, 2024
Merged

feat: Sync from noir #7248

merged 9 commits into from
Jul 1, 2024

Conversation

AztecBot
Copy link
Collaborator

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: fix examples (noir-lang/noir#5357)
chore: static_assert error message fix and split into is-dynamic and is-false (noir-lang/noir#5353)
fix: ignore calls to Intrinsic::AsWitness during brillig codegen (noir-lang/noir#5350)
fix: address compiler warnings coming from stdlib (noir-lang/noir#5351)
feat: static_assert builtin (noir-lang/noir#5342)
feat: Sync from aztec-packages (noir-lang/noir#5347)
chore: replace regression_5202 with more manageably sized program (noir-lang/noir#5345)
feat: disable nargo color output if stderr is tty (noir-lang/noir#5346)
END_COMMIT_OVERRIDE

AztecBot and others added 6 commits June 29, 2024 22:47
chore: `static_assert` error message fix and split into is-dynamic and is-false (noir-lang/noir#5353)
fix: ignore calls to `Intrinsic::AsWitness` during brillig codegen (noir-lang/noir#5350)
fix: address compiler warnings coming from stdlib (noir-lang/noir#5351)
feat: `static_assert` builtin (noir-lang/noir#5342)
feat: Sync from aztec-packages (noir-lang/noir#5347)
chore: replace `regression_5202` with more manageably sized program (noir-lang/noir#5345)
feat: disable nargo color output if stderr is tty (noir-lang/noir#5346)
* master: (29 commits)
  refactor: gets rid of unencrypted emit in private_context (#7236)
  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
  fix: reran pil->cpp codegen & encode_and_encrypt_event_with_randomness fix (#7247)
  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!: extend storage read oracle to receive address and block number (#7243)
  feat: example of private token transfer event (#7242)
  feat: Constant Honk proof sizes (#6954)
  feat: add outgoing keys support to getEvents (#7239)
  feat: Sync from noir (#7223)
  feat!: split storage access oracles (#7237)
  feat: add new lenses for encryted notes (#7238)
  feat(avm): calldata gadget preliminaries (#7227)
  fix(docs): Historical reference library updates (#7166)
  chore: avoid building contracts when producing gates report (#7136)
  ...
@TomAFrench TomAFrench enabled auto-merge (squash) July 1, 2024 13:49
@AztecBot
Copy link
Collaborator Author

AztecBot commented Jul 1, 2024

Benchmark results

Metrics with a significant change:

  • avm_simulation_time_ms (Token:mint_public): 74.8 (-87%)
  • avm_simulation_time_ms (Token:assert_minter_and_mint): 214 (+283%)
  • avm_simulation_time_ms (Token:transfer_public): 35.4 (-41%)
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_30_ms 11,828 3,182 1,480 (+3%) 1,618 (+2%) 1,511 (-3%)
proof_construction_time_sha256_100_ms 43,969 11,812 5,457 5,430 5,389
proof_construction_time_poseidon_hash_ms 79.0 34.0 (-3%) 34.0 (-3%) 58.0 (-2%) 86.0 (-2%)
proof_construction_time_poseidon_hash_30_ms 1,527 419 202 234 (+2%) 266 (-2%)
proof_construction_time_poseidon_hash_100_ms 5,778 1,582 728 (+1%) 790 (+1%) 792 (-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,476 9,468 9,476
l1_rollup_execution_gas 611,215 611,358 611,517
l2_block_processing_time_in_ms 763 (+1%) 1,418 2,722 (+1%)
l2_block_building_time_in_ms 24,335 (-1%) 49,119 95,784 (-1%)
l2_block_rollup_simulation_time_in_ms 24,335 (-1%) 49,118 95,784 (-1%)
l2_block_public_tx_process_time_in_ms 20,901 (-1%) 45,465 92,204 (-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 7,134 (+1%) 9,821
node_database_size_in_bytes 12,243,024 16,166,992
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 114 (-1%) 486 (+5%) 12,570 (-8%) 20,634 67,190 92,352 2,819 524,288
private-kernel-inner 358 (-1%) 931 (-9%) 51,286 (-1%) 94,902 67,190 92,352 2,819 2,097,152
private-kernel-tail 300 (-1%) 1,770 (+1%) 49,440 (-1%) 99,121 71,733 14,912 399 2,097,152
base-parity 6.39 1,790 (-2%) 2,695 (-5%) 128 64.0 2,208 2.00 131,072
root-parity 48.5 (-2%) 71.6 (+1%) 40,123 (-4%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 7,662 5,024 85,165 (-1%) 170,330 728 3,648 47.0 4,194,304
root-rollup 110 (-1%) 86.1 (+2%) 22,990 (+4%) 25,253 620 3,456 41.0 1,048,576
public-kernel-setup 639 3,792 (-1%) 43,972 (-6%) 116,905 93,334 125,344 3,850 2,097,152
public-kernel-app-logic 583 4,742 (-2%) 46,542 (-2%) 116,905 93,334 125,344 3,850 2,097,152
public-kernel-tail 1,374 (-1%) 35,608 (-15%) 190,808 (-2%) 511,910 10,014 14,912 399 8,388,608
private-kernel-reset-small 549 (-1%) 2,103 (-5%) 47,027 (-5%) 123,313 67,190 92,352 2,819 2,097,152
public-kernel-teardown 575 (-1%) 4,795 (-1%) 46,789 (-2%) 116,905 93,334 125,344 3,850 2,097,152
merge-rollup 28.9 (-1%) N/A N/A 16,486 728 N/A N/A N/A
private-kernel-tail-to-public N/A 7,176 (+3%) 95,768 (-9%) 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 407 (-1%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 39.6 (-1%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,295 (-1%) N/A N/A N/A N/A
GasToken:deploy 1,376 9,944 957 (-1%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 489 (-1%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 1,868 (-1%) 16,768 55,914 (-1%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 642 N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 302 (-3%) 16,768 11,138 (-5%) 524,288 457
Token:transfer 1,312 9,944 2,904 16,768 22,592 (-5%) 1,048,576 457
AuthRegistry:set_authorized (avm) 20,954 N/A N/A 94,336 1,330 (-1%) N/A N/A
FPC:prepare_fee (avm) 28,396 N/A N/A 94,400 2,937 (-2%) N/A N/A
Token:transfer_public (avm) 44,612 N/A N/A 94,400 3,893 N/A N/A
AuthRegistry:consume (avm) 34,832 N/A N/A 94,336 2,912 (-2%) N/A N/A
FPC:pay_refund (avm) 38,561 N/A N/A 94,368 23,063 (-2%) N/A N/A
Benchmarking:create_note 1,344 9,944 478 N/A N/A N/A N/A
SchnorrAccount:verify_private_authwit 1,280 9,944 72.4 N/A N/A N/A N/A
Token:unshield 1,376 9,944 2,719 (+1%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 3,478 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 69.2 13,790
GasToken:set_portal 17.2 (+9%) 3,305
Token:constructor 102 23,658
FPC:constructor 61.9 (-3%) 13,592
GasToken:mint_public 51.3 (-1%) 10,158
Token:mint_public ⚠️ 74.8 (-87%) 19,000
Token:assert_minter_and_mint ⚠️ 214 (+283%) 12,891
AuthRegistry:set_authorized 31.9 (-2%) 7,812
FPC:prepare_fee 134 (+5%) 15,062
Token:transfer_public ⚠️ 35.4 (-41%) 31,184
FPC:pay_refund 162 (+11%) 25,260
Benchmarking:increment_balance 2,592 (-1%) 15,233
Token:_increase_public_balance 55.1 (-3%) 14,972
FPC:pay_refund_with_shielded_rebate 131 26,347

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.152 (-4%)

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.3 (-1%) 16.7 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.597 (-1%) 0.514 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 48.0 (-1%) 75.8 132 244 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.491 (-1%) 0.466 0.454 0.443 0.439
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.3 (-1%) 111 (-1%) 182 352 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.501 (-1%) 0.500 0.483 (+1%) 0.477 0.474
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 72.6 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.517 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,707 670,983

Transaction size based on fee payment method

| Metric | |
| - | |

@TomAFrench TomAFrench merged commit eb9e9f6 into master Jul 1, 2024
90 checks passed
@TomAFrench TomAFrench deleted the sync-noir branch July 1, 2024 17:49
TomAFrench added a commit that referenced this pull request Jul 1, 2024
* master: (37 commits)
  feat: Sync from noir (#7248)
  chore: remove 4738 ref (#7254)
  refactor: use options.limit as upper limit for note-getter loop (#7253)
  feat: unconstrained variants for event emission (#7251)
  refactor: add log_hash as input in log emission in private context (#7249)
  feat: function selector opcode in AVM (#7244)
  feat: store shared mutable hash (#7169)
  feat: wonky rollups (#7189)
  refactor: gets rid of unencrypted emit in private_context (#7236)
  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
  fix: reran pil->cpp codegen & encode_and_encrypt_event_with_randomness fix (#7247)
  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!: extend storage read oracle to receive address and block number (#7243)
  feat: example of private token transfer event (#7242)
  ...
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