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: prototype for using the databus with ACIR opcode #6366

Merged
merged 26 commits into from
May 22, 2024

Conversation

guipublic
Copy link
Contributor

@guipublic guipublic commented May 13, 2024

Related to noir-lang/noir#4974

The PR implements logic in BB to handle ACIR opcodes for the databus.
Because the databus in BB works only with Goblin which is not yet supported by Noir, the code is not fully tested, so this is only prototype code.
Using the databus with UltraPlonk will result in a failing ASSERT.
I have updated the BB unit test to work with GoblinPlonk, so the BB code is tested.

@AztecBot
Copy link
Collaborator

AztecBot commented May 15, 2024

Benchmark results

No base data found for comparison.

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 5,701 1,553 710 749 775

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 772 772 772
l1_rollup_calldata_gas 6,856 6,880 6,844
l1_rollup_execution_gas 587,396 587,420 587,384
l2_block_processing_time_in_ms 1,356 5,081 10,128
l2_block_building_time_in_ms 32,471 127,779 258,713
l2_block_rollup_simulation_time_in_ms 32,285 127,120 257,418
l2_block_public_tx_process_time_in_ms 17,025 71,098 145,433

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,168 28,365
node_database_size_in_bytes 21,225,552 37,904,464
pxe_database_size_in_bytes 29,868 59,425

Circuits stats

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

Circuit protocol_circuit_simulation_time_in_ms protocol_circuit_witness_generation_time_in_ms protocol_circuit_proving_time_in_ms protocol_circuit_input_size_in_bytes protocol_circuit_output_size_in_bytes protocol_circuit_proof_size_in_bytes protocol_circuit_num_public_inputs protocol_circuit_size_in_gates
private-kernel-init 159 3,666 22,368 19,960 61,343 86,720 2,643 1,048,576
private-kernel-inner 599 5,170 40,462 88,229 61,204 86,720 2,643 2,097,152
private-kernel-reset-small 582 2,410 23,448 117,961 61,999 86,720 2,643 1,048,576
private-kernel-tail 534 2,858 39,872 86,849 79,454 10,688 267 2,097,152
base-parity 7.26 677 8,105 128 64.0 2,208 2.00 131,072
root-parity 49.8 205 100,259 27,064 64.0 2,720 18.0 2,097,152
base-rollup 739 6,259 90,778 111,156 955 3,120 31.0 2,097,152
root-rollup 90.3 121 11,875 11,507 815 3,440 41.0 524,288
public-kernel-app-logic 242 272 595 96,623 84,789 100,838 3,572 4,096
public-kernel-tail 864 608 761 381,077 7,753 10,160 251 512
public-kernel-setup 181 282 644 116,399 79,160 100,438 3,572 4,096
public-kernel-teardown 195 218 678 124,673 80,432 103,440 3,572 4,096
private-kernel-reset 677 N/A N/A 219,992 46,118 N/A N/A N/A
private-kernel-ordering 444 N/A N/A 70,968 45,252 N/A N/A N/A
merge-rollup 6.44 85.5 2,227 2,760 957 3,120 31.0 65,536
private-kernel-tail-to-public N/A 10,227 72,208 N/A N/A 116,960 3,588 4,194,304

Stats on running time collected for app circuits

Function app_circuit_proof_size_in_bytes app_circuit_proving_time_in_ms app_circuit_size_in_gates app_circuit_num_public_inputs
SchnorrAccount:entrypoint 16,128 47,527 2,097,152 437
Test:emit_nullifier 16,128 2,448 65,536 437
FPC:fee_entrypoint_public 16,128 8,432 524,288 437
FPC:fee_entrypoint_private 16,128 8,918 524,288 437
Token:unshield 16,128 49,517 2,097,152 437
SchnorrAccount:spend_private_authwit 16,128 2,719 131,072 437
Token:transfer 16,128 35,006 2,097,152 437

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 11.4 18.6 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.7 31.8 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.667 0.573 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 53.1 81.1 262 504 990 1,964 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 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.543 0.500 0.476 0.471 0.470 0.469 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 63.9 119 378 740 1,472 2,942 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 106 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.553 0.536 0.513 0.509 0.510 0.512 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 68.3
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.595

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 83,961 766,866

Transaction size based on fee payment method

| Metric | |
| - | |

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms 20,999 4,263 100,335
Metric 0 public data writes 1 public data writes 2 public data writes 4 public data writes 8 public data writes
tx_sequencer_processing_time_ms 1,102 2,224 1,738 2,801 1,773

Copy link
Contributor

@ledwards2225 ledwards2225 left a comment

Choose a reason for hiding this comment

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

LGTM. I just left one comment around how block constraints are set. It seems to me that there's room for improvement there but this might not be the time/place. If you feel like adding some comments there though that would be helpful

@guipublic guipublic merged commit 9f746d9 into master May 22, 2024
72 checks passed
@guipublic guipublic deleted the gd/databus_prototype branch May 22, 2024 10:16
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.

4 participants