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

refactor: contract deployment cleanup #4137

Closed
wants to merge 24 commits into from

Conversation

benesjan
Copy link
Contributor

@benesjan benesjan commented Jan 18, 2024

There were too many wrappers around a simple deployment L1 contract functions and a ton of unused abstractions that I decided to clean it all up.

Copy link
Contributor Author

benesjan commented Jan 18, 2024

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@AztecBot
Copy link
Collaborator

AztecBot commented Jan 18, 2024

Benchmark results

Metrics with a significant change:

  • note_successful_decrypting_time_in_ms (8): 309 (-31%)
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.

Values are compared against data from master at commit 09dbfcd7 and shown if the difference exceeds 1%.

L2 block published to L1

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

Metric 8 txs 32 txs 128 txs
l1_rollup_calldata_size_in_bytes 45,412 179,524 716,068
l1_rollup_calldata_gas 221,560 867,028 3,448,480
l1_rollup_execution_gas 313,979 984,700 3,668,069
l2_block_processing_time_in_ms 1,571 (+9%) 5,273 (-5%) 20,692
note_successful_decrypting_time_in_ms ⚠️ 309 (-31%) 925 (-2%) 3,547 (+6%)
note_trial_decrypting_time_in_ms 22.9 (-62%) 52.6 (-23%) 142 (-1%)
l2_block_building_time_in_ms 16,408 (+2%) 65,114 (+2%) 262,670 (+3%)
l2_block_rollup_simulation_time_in_ms 11,935 (+2%) 47,456 (+2%) 192,126 (+3%)
l2_block_public_tx_process_time_in_ms 4,438 (+2%) 17,571 (+2%) 70,259 (+2%)

L2 chain processing

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

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 15,905 (-2%) 30,373 (-3%)
note_history_successful_decrypting_time_in_ms 2,151 (-4%) 4,418 (-3%)
note_history_trial_decrypting_time_in_ms 107 (-16%) 151 (-31%)
node_database_size_in_bytes 3,517,970 3,553,831
pxe_database_size_in_bytes 29,923 59,478

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 214 (+1%) 44,681 25,561
private-kernel-ordering 167 (+1%) 43,753 14,809
base-rollup 1,213 (+2%) 128,338 881
root-rollup 78.8 (-1%) 4,088 677
private-kernel-inner 296 (+1%) 71,208 25,561
public-kernel-private-input 208 (+1%) 31,863 25,561
public-kernel-non-first-iteration 206 (+1%) 31,905 25,561
merge-rollup 7.58 (-1%) 2,608 881

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 2 leaves 8 leaves 16 leaves 32 leaves 128 leaves 64 leaves 512 leaves 1024 leaves 2048 leaves 8192 leaves
batch_insert_into_append_only_tree_16_depth_ms 12.2 18.6 13.5 20.0 24.5 (+1%) 66.3 (-4%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.9 17.5 23.0 31.6 47.0 143 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.635 (+3%) 0.683 (+5%) 0.546 0.553 (+1%) 0.483 0.442 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A N/A N/A N/A 82.3 (-3%) 51.9 250 (-1%) 475 (-1%) 914 (-1%) 3,556
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A N/A N/A N/A 159 96.0 543 1,055 2,079 8,223
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A N/A N/A N/A 0.471 (-1%) 0.501 (+1%) 0.442 (+1%) 0.436 0.430 0.426
batch_insert_into_indexed_tree_20_depth_ms N/A N/A N/A N/A N/A 116 (-6%) 62.5 367 (-2%) 767 (-2%) 1,443 (-14%) 5,595 (-1%)
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A N/A N/A N/A 197 104 691 1,363 2,707 10,771
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A N/A N/A N/A 0.500 (-4%) 0.510 (+1%) 0.477 0.486 0.475 (-6%) 0.472
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A 67.6 (-1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A 94.1 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A 0.600 N/A N/A N/A N/A N/A N/A N/A

Miscellaneous

Transaction sizes based on how many contracts are deployed in the tx.

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes 15,455 32,219

Transaction processing duration by data writes.

Metric 0 new commitments 1 new commitments
tx_pxe_processing_time_ms 380 (+1%) 1,090
Metric 1 public data writes
tx_sequencer_processing_time_ms 540 (+1%)

@benesjan benesjan force-pushed the 01-18-feat_publish_block_body_separately branch from b9e80cc to 86428cf Compare January 19, 2024 07:59
@benesjan benesjan force-pushed the 01-18-refactor_contract_deployment_cleanup branch from 766e985 to 055a4ce Compare January 19, 2024 09:31
Base automatically changed from 01-18-feat_publish_block_body_separately to master January 19, 2024 10:49
@benesjan benesjan marked this pull request as ready for review January 19, 2024 11:34
@@ -25,6 +25,7 @@
],
"dependencies": {
"@aztec/foundation": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems like an anti-pattern. Pretty much everything in yarn-project will now depend on l1-artifacts when most of it shouldn't need to should it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps look to extract ethereum from so far up the dependency tree if we want to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I checked and negatively affected by this are these packages:

Boxes
Pxe
Sequencer-client
Circuit-types
aztec.js
Aztec-node
Aztec-faucet

I will rework this.

@benesjan benesjan marked this pull request as draft January 19, 2024 12:33
@benesjan benesjan closed this Jan 30, 2024
@ludamad ludamad deleted the 01-18-refactor_contract_deployment_cleanup branch August 22, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants