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: add gas portal to l1 contract addresses #5265

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

alexghr
Copy link
Contributor

@alexghr alexghr commented Mar 16, 2024

Add gasPortalAddress to config and optionally deploy the portal and gas token at bootstrap. This enables reading the correct canonical gas token everywhere.

Fix #5022

Copy link
Contributor Author

alexghr commented Mar 16, 2024

@AztecBot
Copy link
Collaborator

AztecBot commented Mar 16, 2024

Benchmark results

No metrics with a significant change found.

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 b2df9790 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 64 txs
l1_rollup_calldata_size_in_bytes 5,668 18,820 36,356
l1_rollup_calldata_gas 66,328 239,020 469,700
l1_rollup_execution_gas 647,426 929,378 1,305,880
l2_block_processing_time_in_ms 1,306 (-1%) 4,810 (+1%) 9,251 (-2%)
note_successful_decrypting_time_in_ms 189 (+4%) 537 (+3%) 980 (+2%)
note_trial_decrypting_time_in_ms 98.4 (+9%) 57.7 (+51%) 111 (+18%)
l2_block_building_time_in_ms 18,429 (+1%) 68,579 136,746
l2_block_rollup_simulation_time_in_ms 8,076 28,880 56,459 (-1%)
l2_block_public_tx_process_time_in_ms 10,333 (+2%) 39,643 (-1%) 80,188

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 14,099 (-1%) 27,043 (-3%)
note_history_successful_decrypting_time_in_ms 1,237 (+2%) 2,363 (-1%)
note_history_trial_decrypting_time_in_ms 84.7 (+35%) 118 (+3%)
node_database_size_in_bytes 19,075,152 35,614,800
pxe_database_size_in_bytes 29,859 59,414

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 280 44,366 28,244
private-kernel-ordering 212 (-2%) 52,868 14,326
base-parity 1,810 (+1%) 128 311
base-rollup 717 165,787 925
root-parity 1,527 (-5%) 1,244 311
root-rollup 62.7 (+20%) 4,487 789 (+9%)
private-kernel-inner 635 (-3%) 73,771 28,244
public-kernel-app-logic 452 35,260 28,215
public-kernel-tail 174 (-1%) 40,926 28,215
merge-rollup 8.24 2,696 925

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 9.98 15.9 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.8 31.6 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.583 0.492 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 45.9 71.8 (-1%) 231 446 (+1%) 869 (-2%) 1,721 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 96.0 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.472 0.444 0.422 (+1%) 0.418 (+1%) 0.414 (-2%) 0.412 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 54.0 (-3%) 106 (-1%) 335 (-1%) 654 (-1%) 1,313 2,614 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 104 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.482 (-3%) 0.479 (-1%) 0.457 0.451 0.455 0.455 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 61.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 109
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.535

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes
tx_size_in_bytes 22,012

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 3,202 (-2%) 1,726 (-2%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 11.5 (+7%) 1,255

@alexghr alexghr force-pushed the alexg/feat/gas-token-portal-address branch 4 times, most recently from 0b94879 to a26f1a0 Compare March 17, 2024 22:39
@alexghr alexghr marked this pull request as ready for review March 18, 2024 07:15
@alexghr alexghr force-pushed the alexg/feat/gas-token-portal-address branch 5 times, most recently from b8c6299 to 12101f5 Compare March 18, 2024 15:50
Copy link
Contributor

@just-mitch just-mitch left a comment

Choose a reason for hiding this comment

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

Looks good to me after we fix the tests.

@alexghr alexghr force-pushed the alexg/feat/gas-token-portal-address branch 3 times, most recently from aa5e662 to 5b64cf1 Compare March 19, 2024 10:40
Copy link
Contributor

github-actions bot commented Mar 19, 2024

Changes to circuit sizes

Generated at commit: d72670810e68d0b5447bd6de87718cd76a11da90, compared to commit: acffa7b4d41496dea0d16fd94ab98a1a977d14a8

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
rollup_root -1,098 ✅ -50.14% -26,213 ✅ -25.18%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
rollup_root 1,092 (-1,098) -50.14% 77,898 (-26,213) -25.18%

@alexghr alexghr force-pushed the alexg/feat/gas-token-portal-address branch from 5b64cf1 to 3216d40 Compare March 19, 2024 11:35
@alexghr alexghr requested a review from just-mitch March 19, 2024 11:55
@alexghr alexghr merged commit 640c89a into master Mar 19, 2024
99 of 101 checks passed
@alexghr alexghr deleted the alexg/feat/gas-token-portal-address branch March 19, 2024 12:11
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.

Deploy gas token as part of sandbox bootstrap
3 participants