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

Closed
wants to merge 3 commits into from
Closed

feat: Sync from noir #7072

wants to merge 3 commits into from

Conversation

AztecBot
Copy link
Collaborator

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace is_bn254 implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into Expr values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add set and set_unchecked methods to Vec and BoundedVec (noir-lang/noir#5241)
fix: Disable if optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into noirc_driver (noir-lang/noir#5218)
END_COMMIT_OVERRIDE

AztecBot and others added 3 commits June 17, 2024 17:58
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
Copy link
Contributor

github-actions bot commented Jun 17, 2024

Changes to circuit sizes

Generated at commit: c809bb9a77927b1596216e9e69ea0926fcfcc217, compared to commit: 0ce27e05c4c099167d0d98300f6d73ced22639ad

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_tail +703 ❌ +0.06% +703 ❌ +0.01%
rollup_base +258 ❌ +0.08% +258 ❌ +0.01%
public_kernel_teardown -1 ✅ -0.00% -1 ✅ -0.00%
public_kernel_app_logic -1 ✅ -0.00% -1 ✅ -0.00%
private_kernel_reset_small -3,448 ✅ -2.62% -16,022 ✅ -1.50%
private_kernel_reset_medium -6,904 ✅ -4.69% -32,056 ✅ -2.50%
private_kernel_reset_big -13,816 ✅ -7.72% -64,124 ✅ -3.77%
private_kernel_reset -27,640 ✅ -11.42% -128,260 ✅ -5.04%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_tail 1,217,550 (+703) +0.06% 5,427,798 (+703) +0.01%
rollup_base 339,357 (+258) +0.08% 3,097,045 (+258) +0.01%
public_kernel_teardown 340,719 (-1) -0.00% 2,026,420 (-1) -0.00%
public_kernel_app_logic 340,521 (-1) -0.00% 2,026,181 (-1) -0.00%
private_kernel_reset_small 128,036 (-3,448) -2.62% 1,055,579 (-16,022) -1.50%
private_kernel_reset_medium 140,377 (-6,904) -4.69% 1,249,980 (-32,056) -2.50%
private_kernel_reset_big 165,057 (-13,816) -7.72% 1,638,780 (-64,124) -3.77%
private_kernel_reset 214,420 (-27,640) -11.42% 2,416,383 (-128,260) -5.04%

@AztecBot
Copy link
Collaborator Author

AztecBot commented Jun 17, 2024

Benchmark results

Metrics with a significant change:

  • proof_construction_time_poseidon_hash_ms (16): 34.0 (-36%)
  • proof_construction_time_poseidon_hash_30_ms (1): 1,515 (-25%)
  • avm_simulation_time_ms (Token:transfer_public): 55.2 (+38%)
  • avm_simulation_time_ms (FPC:pay_refund): 121 (+73%)
  • avm_simulation_time_ms (FPC:pay_refund_with_shielded_rebate): 109 (+111%)
  • avm_simulation_bytecode_size_in_bytes (FPC:pay_refund): 28,061 (+40%)
  • avm_simulation_bytecode_size_in_bytes (FPC:pay_refund_with_shielded_rebate): 29,148 (+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_30_ms 11,368 3,049 (-4%) 1,560 (+12%) 1,551 (+9%) 1,641 (+12%)
proof_construction_time_sha256_100_ms 44,660 (-6%) 12,016 (-2%) 5,658 (-1%) 5,551 5,488 (-1%)
proof_construction_time_poseidon_hash_ms 78.0 46.0 (-16%) ⚠️ 34.0 (-36%) 57.0 (-8%) 88.0 (-5%)
proof_construction_time_poseidon_hash_30_ms ⚠️ 1,515 (-25%) 418 202 221 263 (-2%)
proof_construction_time_poseidon_hash_100_ms 5,732 1,568 (-1%) 726 793 (+1%) 803

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,456 9,476
l1_rollup_execution_gas 610,297 610,277 610,297
l2_block_processing_time_in_ms 766 (+1%) 1,399 2,703 (+1%)
l2_block_building_time_in_ms 25,573 50,778 99,699 (-1%)
l2_block_rollup_simulation_time_in_ms 25,474 50,476 99,346 (-1%)
l2_block_public_tx_process_time_in_ms 21,892 46,725 95,630 (-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 6,930 9,733 (+1%)
node_database_size_in_bytes 12,144,720 16,089,168
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 132 (+2%) 475 (-12%) 12,862 (+1%) 20,634 67,190 92,352 2,819 524,288
private-kernel-inner 392 960 (-1%) 50,095 (+2%) 94,902 67,190 92,352 2,819 2,097,152
private-kernel-tail 372 1,844 (+2%) 51,164 (+2%) 99,121 71,733 14,912 399 2,097,152
base-parity 6.26 (-1%) 1,896 (+3%) 2,816 (-2%) 128 64.0 2,208 2.00 131,072
root-parity 49.9 (+2%) 72.4 (+12%) 41,108 (+3%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 7,886 4,461 (+2%) 84,559 (-2%) 170,330 756 3,648 47.0 4,194,304
root-rollup 110 85.4 (+12%) 24,053 (+5%) 25,309 620 3,456 41.0 1,048,576
public-kernel-setup 726 (+1%) 3,339 (+2%) 45,703 (-3%) 116,905 93,334 125,344 3,850 2,097,152
public-kernel-app-logic 612 4,166 (-2%) 46,117 (-2%) 116,905 93,334 125,344 3,850 2,097,152
public-kernel-tail 1,424 (+1%) 35,590 (-6%) 190,043 (-4%) 511,910 10,014 14,912 399 8,388,608
private-kernel-reset-small 595 2,096 (-3%) 45,960 (-3%) 123,313 67,190 92,352 2,819 2,097,152
public-kernel-teardown 622 (+1%) 4,163 (-3%) 45,843 (-8%) 116,905 93,334 125,344 3,850 2,097,152
merge-rollup 28.8 N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 6,970 (-13%) 100,928 (+6%) N/A N/A 125,344 3,850 4,194,304
avm-circuit N/A N/A 4,016 (-1%) N/A N/A 87,734 0.00 0.00

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 402 N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 39.9 (-1%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,771 N/A N/A N/A N/A
GasToken:deploy 1,376 9,944 965 N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,416 (-1%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,806 (-2%) 16,768 54,720 (-4%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,609 (-3%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 358 (+2%) 16,768 11,436 (-4%) 524,288 457
Token:transfer 1,312 9,944 4,726 (-2%) 16,768 51,766 (+2%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,366 (-2%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 76.0 (-16%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,890 (-3%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 5,024 (+1%) 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 73.9 (+10%) 13,873
GasToken:set_portal 18.5 (+11%) 3,495
Token:constructor 96.9 (+1%) 24,207
FPC:constructor 62.0 (-11%) 13,893
GasToken:mint_public 52.0 (-7%) 10,241
Token:mint_public 633 (+4%) 19,216
Token:assert_minter_and_mint 58.9 (-2%) 13,034
AuthRegistry:set_authorized 32.1 (-1%) 7,869
FPC:prepare_fee 80.4 (-2%) 15,187
Token:transfer_public ⚠️ 55.2 (+38%) 31,425
FPC:pay_refund ⚠️ 121 (+73%) ⚠️ 28,061 (+40%)
Benchmarking:increment_balance 2,669 15,465
Token:_increase_public_balance 58.4 15,089
FPC:pay_refund_with_shielded_rebate ⚠️ 109 (+111%) ⚠️ 29,148 (+38%)

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.183

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.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.602 (+1%) 0.513 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%) 75.7 (+1%) 132 (+1%) 243 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.496 (+1%) 0.465 (+1%) 0.452 0.441 0.439
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.1 111 183 (+1%) 350 693
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.500 0.500 0.484 (+1%) 0.475 0.476
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 72.5 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,672 670,983

Transaction size based on fee payment method

| Metric | |
| - | |

@TomAFrench TomAFrench closed this Jun 18, 2024
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