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

feat: adding poseidon2 hashing to native and recursive transcript #3652

Closed
wants to merge 22 commits into from

Conversation

lucasxia01
Copy link
Contributor

Replacing pedersen and blake3 hashing in native transcript with native poseidon2 hash.

Add hashing to recursive transcript.

Resolves AztecProtocol/barretenberg#777

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).

@lucasxia01 lucasxia01 changed the base branch from master to lx/poseidon2-stdlib December 11, 2023 20:25
@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • note_history_trial_decrypting_time_in_ms (10): 234 (-36%)
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 c7f18787 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,900 868,232 3,449,612
l1_rollup_execution_gas 841,987 3,595,340 22,204,981
l2_block_processing_time_in_ms 2,199 8,492 35,027 (-1%)
note_successful_decrypting_time_in_ms 313 934 3,336 (-1%)
note_trial_decrypting_time_in_ms 22.5 (-3%) 60.5 197 (-2%)
l2_block_building_time_in_ms 20,119 (-1%) 79,844 (-1%) 321,245 (-1%)
l2_block_rollup_simulation_time_in_ms 16,590 (-1%) 65,887 (-1%) 265,426 (-1%)
l2_block_public_tx_process_time_in_ms 3,499 13,886 55,567

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 25,026 47,761
note_history_successful_decrypting_time_in_ms 2,205 (-2%) 4,250
note_history_trial_decrypting_time_in_ms 164 (+1%) ⚠️ 234 (-36%)
node_database_size_in_bytes 3,616,223 3,910,626
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 199 (-1%) 43,109 20,441
private-kernel-ordering 115 25,833 9,689
base-rollup 2,956 667,692 873
root-rollup 90.1 (-1%) 4,072 881
private-kernel-inner 260 64,516 20,441
public-kernel-private-input 171 (-1%) 25,203 20,441
public-kernel-non-first-iteration 168 (-1%) 25,245 20,441
merge-rollup 10.8 (-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 10,323 25,938

@lucasxia01 lucasxia01 self-assigned this Dec 14, 2023
@lucasxia01 lucasxia01 added the crypto cryptography label Dec 14, 2023
@lucasxia01 lucasxia01 marked this pull request as draft December 14, 2023 20:07
Base automatically changed from lx/poseidon2-stdlib to master January 11, 2024 23:18
@codygunton
Copy link
Contributor

Replaced by #4161

@codygunton codygunton closed this Feb 2, 2024
@lucasxia01 lucasxia01 deleted the lx/poseidon2-transcript branch February 23, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto cryptography
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

adding updating native transcript with poseidon2, modify transcript to be vector of bn254 fr
3 participants