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 base rollup #3225

Closed
wants to merge 3 commits into from
Closed

chore: Add base rollup #3225

wants to merge 3 commits into from

Conversation

kevaundray
Copy link
Contributor

Adds the base rollup circuit into Noir

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

}

// NOTE!
// We deviate from the cpp implementation.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noting this: for the small optimisation gain, the cpp code was almost unreadable. It makes sense to do it the non-optimal way first and then optimize

calculate_subtree(commitment_tree_leaves)
}

fn check_nullifier_tree_non_membership_and_insert_to_tree(self) -> AppendOnlyTreeSnapshot {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main method that is left to implement, ideally we pull out that logic into a separate module named "indexed_merkle_tree" so it can be tested properly but probably okay to do what the cpp code is doing

@AztecBot
Copy link
Collaborator

AztecBot commented Nov 3, 2023

Benchmark results

Metrics with a significant change:

  • note_trial_decrypting_time_in_ms (8): 3.00 (-97%)
  • note_trial_decrypting_time_in_ms (128): 211 (+57%)
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 d707d4e3 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,444 179,588 716,132
l1_rollup_calldata_gas 222,828 868,172 3,449,480
l1_rollup_execution_gas 841,915 3,595,280 22,204,849
l2_block_processing_time_in_ms 2,006 (+1%) 7,594 29,764
note_successful_decrypting_time_in_ms 298 882 (-1%) 3,216
note_trial_decrypting_time_in_ms ⚠️ 3.00 (-97%) 90.0 (-7%) ⚠️ 211 (+57%)
l2_block_building_time_in_ms 13,145 (-1%) 52,414 (-1%) 209,631
l2_block_rollup_simulation_time_in_ms 11,812 (-1%) 47,091 188,339
l2_block_public_tx_process_time_in_ms 1,295 5,188 (-1%) 20,794 (-1%)

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 21,778 42,554
note_history_successful_decrypting_time_in_ms 2,041 (+1%) 4,013 (+2%)
note_history_trial_decrypting_time_in_ms 120 144 (+1%)
node_database_size_in_bytes 1,632,126 1,097,958
pxe_database_size_in_bytes 29,748 59,307

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 773 61,697 18,905
private-kernel-ordering 124 (+1%) 24,297 8,153
base-rollup 1,772 656,311 814
root-rollup 81.1 (+5%) 4,072 1,097
private-kernel-inner 789 81,568 18,905
public-kernel-private-input 41.7 41,519 18,841
public-kernel-non-first-iteration 26.5 41,497 18,841
merge-rollup 0.899 (-3%) 2,592 873

Miscellaneous

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

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes 8,787 27,548

@Maddiaa0
Copy link
Member

superceded by #3257

@Maddiaa0 Maddiaa0 closed this Nov 27, 2023
@ludamad ludamad deleted the kw/add-base-rollup 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