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: Configurable mainnet fork resources #8342

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

PhilWindle
Copy link
Collaborator

This PR allows us to specify mainnet fork resources on an environment basis

@PhilWindle PhilWindle merged commit 279f2bb into provernet Sep 3, 2024
23 checks passed
@PhilWindle PhilWindle deleted the pw/config-mainnet-fork branch September 3, 2024 08:46
@AztecBot
Copy link
Collaborator

AztecBot commented Sep 3, 2024

Benchmark results

Metrics with a significant change:

  • avm_simulation_time_ms (Token:mint_public): 71.4 (+69%)
  • avm_simulation_time_ms (Token:assert_minter_and_mint): 41.2 (-39%)
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_ms 5,680 (-1%) 1,540 (-1%) 700 765 (+3%) 764
proof_construction_time_sha256_30_ms 11,647 (-2%) 3,122 (-1%) 1,398 (-2%) 1,436 (-1%) 1,472
proof_construction_time_sha256_100_ms 44,260 (-2%) 11,996 (-1%) 5,396 5,381 (-1%) 5,350 (-1%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 58.0 (-2%) 87.0
proof_construction_time_poseidon_hash_30_ms 1,508 (-1%) 418 (-1%) 202 221 (-3%) 267
proof_construction_time_poseidon_hash_100_ms 5,591 (-1%) 1,498 (-1%) 671 (-1%) 717 (-2%) 749

L2 block published to L1

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

Metric 4 txs 8 txs 16 txs
l1_rollup_calldata_size_in_bytes 4,324 7,844 14,852
l1_rollup_calldata_gas 49,600 92,464 177,584
l1_rollup_execution_gas 1,383,041 2,130,873 3,958,032
l2_block_processing_time_in_ms 245 (-2%) 451 (+1%) 821 (-1%)
l2_block_building_time_in_ms 9,288 (+1%) 17,930 35,591
l2_block_rollup_simulation_time_in_ms 9,288 (+1%) 17,929 35,590
l2_block_public_tx_process_time_in_ms 7,804 (+1%) 16,393 34,002

L2 chain processing

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

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 2,985 3,973 (+3%)
node_database_size_in_bytes 12,628,048 16,691,280
pxe_database_size_in_bytes 16,254 26,813

Circuits stats

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

Circuit simulation_time_in_ms witness_generation_time_in_ms input_size_in_bytes output_size_in_bytes proving_time_in_ms
private-kernel-init 96.3 (-1%) 397 (+4%) 21,673 44,858 N/A
private-kernel-inner 162 (-1%) 711 (+3%) 72,309 45,005 N/A
private-kernel-reset-tiny 499 905 (+4%) 65,974 44,844 N/A
private-kernel-tail 206 167 (+4%) 50,728 52,256 N/A
base-parity 5.57 (+1%) N/A 160 96.0 N/A
root-parity 33.6 (+2%) N/A 69,084 96.0 N/A
base-rollup 2,814 N/A 187,817 664 N/A
root-rollup 39.1 (+2%) N/A 54,525 716 N/A
public-kernel-setup 87.2 N/A 103,760 71,222 N/A
public-kernel-app-logic 99.1 N/A 103,599 71,222 N/A
public-kernel-tail 574 (+1%) N/A 409,190 16,414 N/A
private-kernel-reset-small 497 (+2%) N/A 66,085 45,629 N/A
private-kernel-tail-to-public 1,053 (-11%) 659 (+4%) 492,960 1,697 N/A
public-kernel-teardown 86.2 (+1%) N/A 104,005 71,222 N/A
merge-rollup 19.6 (+2%) N/A 35,742 664 N/A
undefined N/A N/A N/A N/A 66,337

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms
ContractClassRegisterer:register 1,344 11,731 341
ContractInstanceDeployer:deploy 1,408 11,731 18.4
MultiCallEntrypoint:entrypoint 1,920 11,731 421
FeeJuice:deploy 1,376 11,731 399 (+3%)
SchnorrAccount:constructor 1,312 11,731 107 (+2%)
SchnorrAccount:entrypoint 2,304 11,731 432 (+1%)
Token:privately_mint_private_note 1,280 11,731 143 (+3%)
FPC:fee_entrypoint_public 1,344 11,731 27.4 (+3%)
Token:transfer 1,312 11,731 278 (+4%)
Benchmarking:create_note 1,344 11,731 103 (+4%)
SchnorrAccount:verify_private_authwit 1,280 11,731 28.6 (+3%)
Token:unshield 1,376 11,731 580 (+2%)
FPC:fee_entrypoint_private 1,376 11,731 786 (+2%)

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 54.8 (+4%) 8,139
FeeJuice:set_portal 11.2 (+18%) 2,362
Token:constructor 84.3 (+3%) 31,107
FPC:constructor 56.0 (+5%) 22,380
FeeJuice:mint_public 38.3 (+1%) 6,150
Token:mint_public ⚠️ 71.4 (+69%) 11,720
Token:assert_minter_and_mint ⚠️ 41.2 (-39%) 8,028
AuthRegistry:set_authorized 36.4 (+2%) 4,537
FPC:prepare_fee 234 8,812
Token:transfer_public 22.7 (-3%) 47,358
FPC:pay_refund 54.8 (-1%) 12,082
Benchmarking:increment_balance 960 7,450
Token:_increase_public_balance 43.2 (+13%) 8,960
FPC:pay_refund_with_shielded_rebate 68.7 (+2%) 12,631

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.159 (-3%)

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 256 leaves 512 leaves 1024 leaves
batch_insert_into_append_only_tree_16_depth_ms 2.21 (+1%) 3.89 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.7 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.115 (+2%) 0.110 (+2%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 11.6 17.8 (-4%) 31.1 63.7 (+6%) 114 (+1%)
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 287 543 1,055
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.112 (+1%) 0.103 (-3%) 0.101 (+1%) 0.109 (+6%) 0.102 (+1%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.5 (-1%) 25.4 (-3%) 43.5 85.0 (+1%) 161 (-1%)
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 109 207 355 691 1,363
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.109 (-1%) 0.103 (-3%) 0.105 0.104 (+1%) 0.102 (+1%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.5 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A 132 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A 0.106 N/A N/A N/A N/A

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 64,779 668,997

Transaction size based on fee payment method

| Metric | |
| - | |

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.

3 participants