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

chore: add linting to avm-transpiler CI #6732

Merged
merged 5 commits into from
May 29, 2024
Merged

chore: add linting to avm-transpiler CI #6732

merged 5 commits into from
May 29, 2024

Conversation

TomAFrench
Copy link
Member

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.

@TomAFrench TomAFrench requested a review from dbanks12 May 29, 2024 13:15
Copy link
Contributor

@dbanks12 dbanks12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this! 🙏

@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • app_circuit_proving_time_in_ms (Token:transfer): 62,387 (+34%)
  • protocol_circuit_proving_time_in_ms (private-kernel-init): 14,260 (+19%)
  • protocol_circuit_proving_time_in_ms (private-kernel-inner): 48,757 (+24%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail-to-public): 109,807 (+20%)
  • protocol_circuit_proving_time_in_ms (base-rollup): 88,230 (+18%)
  • protocol_circuit_proving_time_in_ms (root-parity): 52,393 (+20%)
  • protocol_circuit_proving_time_in_ms (public-kernel-tail): 183,216 (+19%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 23,564 (+21%)
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 | |
| - | |

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,452 9,476 9,476
l1_rollup_execution_gas 616,093 616,117 616,117
l2_block_processing_time_in_ms 1,300 (-1%) 4,854 9,600 (-1%)
l2_block_building_time_in_ms 45,689 180,886 (-1%) 361,630 (-1%)
l2_block_rollup_simulation_time_in_ms 45,518 180,247 (-1%) 360,348 (-1%)
l2_block_public_tx_process_time_in_ms 24,613 102,462 (-1%) 209,608 (-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,471 (-1%) 14,398 (-1%)
node_database_size_in_bytes 14,504,016 21,336,144
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 135 (+2%) 472 (-6%) ⚠️ 14,260 (+19%) 20,630 64,614 89,536 2,731 524,288
private-kernel-inner 402 (-1%) 945 (-6%) ⚠️ 48,757 (+24%) 92,318 64,614 89,536 2,731 2,097,152
private-kernel-tail 581 (-1%) 2,697 (-10%) 41,727 (+14%) 96,541 77,732 11,648 297 2,097,152
base-parity 6.55 (-1%) 1,159 (-10%) 2,872 128 64.0 2,208 2.00 131,072
root-parity 49.3 (-1%) 61.2 (+28%) ⚠️ 52,393 (+20%) 27,084 64.0 2,720 18.0 2,097,152
base-rollup 675 (-7%) 2,452 (+5%) ⚠️ 88,230 (+18%) 119,734 756 3,648 47.0 4,194,304
root-rollup 110 (-2%) 75.3 (+17%) ⚠️ 23,564 (+21%) 25,297 620 3,456 41.0 1,048,576
public-kernel-app-logic 532 (-1%) 3,144 (-2%) 53,954 (+12%) 105,253 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,115 (-1%) 25,644 (+7%) ⚠️ 183,216 (+19%) 401,002 7,646 11,648 297 8,388,608
private-kernel-reset-small 589 1,946 (-12%) 52,045 (+14%) 120,733 64,614 89,536 2,731 2,097,152
merge-rollup 28.6 (-1%) N/A N/A 16,534 756 N/A N/A N/A
public-kernel-setup 643 (-2%) N/A N/A 105,253 86,550 N/A N/A N/A
public-kernel-teardown 545 (-3%) N/A N/A 105,253 86,550 N/A N/A N/A
private-kernel-tail-to-public N/A 8,702 (+2%) ⚠️ 109,807 (+20%) 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 469 (-1%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 41.5 (-2%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,430 (-2%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 975 (-2%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,095 (-1%) 16,768 55,632 (+14%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,106 (-3%) N/A N/A N/A N/A
Token:transfer 1,376 9,944 4,002 (-2%) 16,768 ⚠️ 62,387 (+34%) 2,097,152 457
Benchmarking:create_note 1,312 9,944 951 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 227 (+1%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 77.5 (-7%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,246 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,019 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 (-1%) 17.0 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.605 (-1%) 0.519 (-1%) 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.5 (-1%) 76.5 246 (-1%) 474 (-1%) 937 1,847 (-1%) 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.495 (-1%) 0.471 0.446 (-1%) 0.443 (-1%) 0.443 0.440 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 58.2 (-1%) 113 (-1%) 357 697 (-1%) 1,396 2,772 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.503 (-1%) 0.505 (-1%) 0.484 0.479 (-1%) 0.481 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.6 (-1%)
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 (-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 84,050 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@TomAFrench TomAFrench merged commit 57864f9 into master May 29, 2024
87 checks passed
@TomAFrench TomAFrench deleted the tf/avm-linting branch May 29, 2024 16:33
TomAFrench added a commit that referenced this pull request May 29, 2024
* 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)
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.

3 participants