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

test: note processor test rewrite #6836

Merged
merged 8 commits into from
Jun 4, 2024

Conversation

benesjan
Copy link
Contributor

@benesjan benesjan commented Jun 3, 2024

Note processor test became such an abomination that my brain could not comprehend it. So I rewrote it in this PR.

Copy link
Contributor Author

benesjan commented Jun 3, 2024

@benesjan benesjan force-pushed the 06-03-test_note_processor_test_cleanup branch from 61f1314 to e43efdc Compare June 3, 2024 16:22
@benesjan benesjan requested a review from LHerskind June 3, 2024 16:29
@benesjan benesjan marked this pull request as ready for review June 3, 2024 16:29
@benesjan benesjan changed the title test: note processor test cleanup test: note processor test rewrite Jun 3, 2024
@AztecBot
Copy link
Collaborator

AztecBot commented Jun 3, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_simulation_time_in_ms (public-kernel-setup): 666 (-24%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail-to-public): 86,772 (-16%)
  • protocol_circuit_proving_time_in_ms (base-rollup): 65,342 (-20%)
  • protocol_circuit_proving_time_in_ms (root-parity): 33,770 (-17%)
  • protocol_circuit_proving_time_in_ms (public-kernel-tail): 155,409 (-16%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 19,522 (-20%)
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%) 1,547 (-1%) 696 (-1%) 746 (-3%) 776
proof_construction_time_sha256_30_ms 11,744 (-1%) 3,154 (-1%) 1,411 1,435 (-2%) 1,466
proof_construction_time_sha256_100_ms 43,839 (-1%) 11,758 (-1%) 5,420 5,424 5,339
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 57.0 (-2%) 87.0 (-2%)
proof_construction_time_poseidon_hash_30_ms 1,520 (-1%) 417 (-1%) 202 227 (+2%) 267
proof_construction_time_poseidon_hash_100_ms 5,734 (-1%) 1,564 (-1%) 720 (-1%) 768 (-2%) 797 (-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
l1_rollup_calldata_size_in_bytes 1,412 1,412
l1_rollup_calldata_gas 9,464 9,452
l1_rollup_execution_gas 608,000 607,988
l2_block_processing_time_in_ms 709 (-1%) 1,295
l2_block_building_time_in_ms 22,357 (-1%) 45,963 (+1%)
l2_block_rollup_simulation_time_in_ms 22,236 (-1%) 45,615 (+1%)
l2_block_public_tx_process_time_in_ms 19,091 (-1%) 42,196 (+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,963 (+1%) 8,544
node_database_size_in_bytes 9,474,128 12,791,888
pxe_database_size_in_bytes 7,774 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 138 (+1%) 495 (+2%) 12,242 (-7%) 20,634 64,614 89,536 2,731 524,288
private-kernel-inner 414 (+1%) 1,013 (-15%) 45,169 (-12%) 92,326 64,614 89,536 2,731 2,097,152
private-kernel-tail 592 (+2%) 2,816 (+3%) 47,109 (-14%) 96,545 68,261 11,648 297 2,097,152
base-parity 6.52 (+1%) 1,716 2,593 (-4%) 128 64.0 2,208 2.00 131,072
root-parity 49.6 53.2 (-13%) ⚠️ 33,770 (-17%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 5,969 (-1%) 2,322 (-3%) ⚠️ 65,342 (-20%) 119,738 756 3,648 47.0 4,194,304
root-rollup 111 (+1%) 63.6 (-19%) ⚠️ 19,522 (-20%) 25,309 620 3,456 41.0 1,048,576
public-kernel-app-logic 571 3,550 38,705 (-15%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,140 (-4%) 21,249 (-14%) ⚠️ 155,409 (-16%) 403,238 7,646 11,648 297 8,388,608
private-kernel-reset-small 595 (+2%) 2,128 (-2%) 40,790 (-13%) 120,737 64,614 89,536 2,731 2,097,152
public-kernel-setup ⚠️ 666 (-24%) 2,729 (-2%) 37,554 (-14%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-teardown 568 (-2%) 3,549 (-3%) 38,908 (-15%) 108,073 86,550 116,768 3,582 2,097,152
merge-rollup 32.5 (+8%) N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 8,647 (+5%) ⚠️ 86,772 (-16%) 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 478 (-6%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 42.8 (-5%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,811 (-7%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,472 (-5%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,847 16,768 50,431 (-11%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,646 (+3%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 1,128 (+7%) 16,768 9,955 (-13%) 524,288 457
Token:transfer 1,376 9,944 5,485 (-6%) 16,768 47,826 (-12%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,396 N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 77.8 (+1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 4,038 (+4%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,932 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.5 (+1%) 17.1 (+2%) 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.7 N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.607 (+1%) 0.526 (+2%) 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 49.0 (-1%) 76.4 134 (+2%) 248 (+1%) 477 (+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.501 (-1%) 0.470 0.460 (+1%) 0.449 (+1%) 0.445 (+1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.0 (-2%) 113 (+1%) 185 (+1%) 353 (+1%) 631 (+1%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 107 208 355 686 1,263 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.509 (-1%) 0.506 0.488 0.481 (+1%) 0.471 (+1%) 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.3 (-2%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A 101
batch_insert_into_indexed_tree_40_depth_hash_ms 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 79,470 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@benesjan benesjan force-pushed the 06-03-test_note_processor_test_cleanup branch from 4872c90 to 7922063 Compare June 4, 2024 08:39
@benesjan benesjan requested a review from sklppy88 June 4, 2024 09:10
Copy link
Contributor

@sklppy88 sklppy88 left a comment

Choose a reason for hiding this comment

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

Micro nits, looks good. 👍

benesjan and others added 2 commits June 4, 2024 11:51
Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com>
@benesjan benesjan enabled auto-merge (squash) June 4, 2024 09:56
@benesjan benesjan disabled auto-merge June 4, 2024 09:58
@benesjan benesjan enabled auto-merge (squash) June 4, 2024 10:28
@benesjan benesjan merged commit dbef5e4 into master Jun 4, 2024
86 checks passed
@benesjan benesjan deleted the 06-03-test_note_processor_test_cleanup branch June 4, 2024 10:40
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