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: Revert to current date as timestamp for devnet #8193

Closed
wants to merge 2 commits into from

Conversation

spalladino
Copy link
Collaborator

@spalladino spalladino commented Aug 26, 2024

When running devnet, using the slot timestamps instead of current timestmap meant that blocks were often generated with a timestamp much into the future. This screwed up settings such as the min and max time between blocks for a sequencer configuration, which relied on L2 timestamps. In addition, the custom block timestamp interval in anvil meant that we could no longer rely on L1 timestamps for measuring time, which was needed for tracking the time between a block being submitted and its proof.

This PR changes timestamps if devnet is set so that we use the current timestamp for building blocks, do not alter anvil's block timestamp, and drop time validations.

When running devnet, using the slot timestamps instead of current
timestmap meant that blocks were often generated with a timestamp much
into the future. This screwed up settings such as the min and max time
between blocks for a sequencer configuration. In addition, the custom
block timestamp interval in anvil meant that we could no longer rely on
L1 timestamps for measuring time, which was needed for tracking the time
between a block being submitted and its proof.

This PR changes timestamps if devnet is set so that we use the current
timestamp for building blocks, do not alter anvil's block timestamp, and
drop time validations.
@spalladino spalladino force-pushed the palla/timestamps-in-devnet branch from 4780b21 to a23cc41 Compare August 26, 2024 21:34
@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • proof_construction_time_poseidon_hash_100_ms (16): 891 (+29%)
  • proof_construction_time_poseidon_hash_30_ms (16): 289 (+40%)
  • proof_construction_time_sha256_30_ms (16): 1,740 (+23%)
  • avm_simulation_time_ms (Token:mint_public): 70.9 (+60%)
  • avm_simulation_time_ms (Token:assert_minter_and_mint): 41.0 (-39%)
  • avm_simulation_time_ms (Token:transfer_public): 32.9 (+68%)
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,764 (-3%) 1,562 (-2%) 711 (-2%) 756 767 (-4%)
proof_construction_time_sha256_30_ms 11,567 (-2%) 3,115 (-2%) ⚠️ 1,740 (+23%) 1,563 (+8%) 1,531 (+3%)
proof_construction_time_sha256_100_ms 44,026 (-4%) 11,777 (-3%) 5,410 (-4%) 5,437 (-10%) 5,909 (+7%)
proof_construction_time_poseidon_hash_ms 78.0 (-4%) 34.0 (-3%) 34.0 (-3%) 59.0 88.0 (-1%)
proof_construction_time_poseidon_hash_30_ms 1,535 (-3%) 422 (-3%) ⚠️ 289 (+40%) 263 (+14%) 274 (-1%)
proof_construction_time_poseidon_hash_100_ms 5,706 (-2%) 1,517 (-2%) ⚠️ 891 (+29%) 821 (+11%) 790 (+4%)

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,356 7,876 14,884
l1_rollup_calldata_gas 50,268 93,010 178,216
l1_rollup_execution_gas 840,342 1,573,980 3,359,242
l2_block_processing_time_in_ms 255 (-1%) 446 (+1%) 798 (-4%)
l2_block_building_time_in_ms 11,296 22,485 (+1%) 44,559 (+1%)
l2_block_rollup_simulation_time_in_ms 11,295 22,484 (+1%) 44,558 (+1%)
l2_block_public_tx_process_time_in_ms 9,592 20,651 (+1%) 42,644

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 3,008 (+1%) 3,858 (+1%)
node_database_size_in_bytes 12,611,664 16,699,472
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 95.6 406 (+3%) 21,735 44,860 N/A
private-kernel-inner 175 (+1%) 716 (+2%) 72,544 45,007 N/A
private-kernel-reset-tiny 308 (+1%) 736 (+4%) 65,593 44,846 N/A
private-kernel-tail 167 (+1%) 144 (+7%) 50,644 52,257 N/A
base-parity 5.65 (+1%) N/A 160 96.0 N/A
root-parity 36.4 (+3%) N/A 73,948 96.0 N/A
base-rollup 3,480 (+1%) N/A 189,136 664 N/A
block-root-rollup 42.2 (+1%) N/A 58,205 2,448 N/A
public-kernel-setup 85.4 (-1%) N/A 105,085 71,222 N/A
public-kernel-app-logic 97.9 (+1%) N/A 104,911 71,222 N/A
public-kernel-tail 868 (+1%) N/A 390,582 16,414 N/A
private-kernel-reset-small 315 (+1%) N/A 66,341 45,629 N/A
private-kernel-tail-to-public 1,359 629 (+3%) 455,400 1,825 N/A
public-kernel-teardown 84.6 (+1%) N/A 105,349 71,222 N/A
merge-rollup 20.6 (+2%) N/A 38,174 664 N/A
undefined N/A N/A N/A N/A 79,599 (+1%)

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 342
ContractInstanceDeployer:deploy 1,408 11,731 18.5 (+1%)
MultiCallEntrypoint:entrypoint 1,920 11,731 405
FeeJuice:deploy 1,376 11,731 392
SchnorrAccount:constructor 1,312 11,731 73.5 (-1%)
SchnorrAccount:entrypoint 2,304 11,731 396
Token:privately_mint_private_note 1,280 11,731 107 (+3%)
FPC:fee_entrypoint_public 1,344 11,731 26.0 (-3%)
Token:transfer 1,312 11,731 231 (+1%)
Benchmarking:create_note 1,344 11,731 84.4 (-2%)
SchnorrAccount:verify_private_authwit 1,280 11,731 27.7 (-13%)
Token:unshield 1,376 11,731 535 (+1%)
FPC:fee_entrypoint_private 1,376 11,731 717 (+1%)

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 55.3 (+1%) 7,101
FeeJuice:set_portal 11.5 (+23%) 2,128
Token:constructor 79.0 (-4%) 25,285
FPC:constructor 53.6 (+2%) 17,853
FeeJuice:mint_public 38.9 (-3%) 5,415
Token:mint_public ⚠️ 70.9 (+60%) 10,101
Token:assert_minter_and_mint ⚠️ 41.0 (-39%) 6,844
AuthRegistry:set_authorized 46.9 (+23%) 3,969
FPC:prepare_fee 228 6,747
Token:transfer_public ⚠️ 32.9 (+68%) 38,126
FPC:pay_refund 55.8 (+9%) 9,398
Benchmarking:increment_balance 1,212 (+1%) 6,179
Token:_increase_public_balance 40.5 (-4%) 7,705
FPC:pay_refund_with_shielded_rebate 61.3 (-3%) 9,881

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.156 (-1%)

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.23 (+2%) 3.95 (+2%) 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.116 (+3%) 0.112 (+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 (+3%) 17.9 (+1%) 30.9 60.1 (+2%) 112 (-2%)
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 (+3%) 0.103 0.100 0.103 (+1%) 0.100 (-1%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.4 (+1%) 25.9 (+2%) 44.0 83.7 (+2%) 160 (-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.110 (+1%) 0.104 (+1%) 0.106 0.104 (+2%) 0.101 (-2%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.7 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.107 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 | |
| - | |

@spalladino
Copy link
Collaborator Author

Closing in favor of #8211

@spalladino spalladino closed this Aug 27, 2024
spalladino added a commit that referenced this pull request Aug 28, 2024
Reports a new histogram metric with the time that passes between a block
being submitted and its proof. Uses the timestamp from the L2 block
header global variables as block submission time, and the L1 block time
for the proof submission time.

Depends on #8193 

Fixes #7675
spalladino added a commit that referenced this pull request Aug 30, 2024
Reports a new histogram metric with the time that passes between a block
being submitted and its proof. Uses the timestamp from the L2 block
header global variables as block submission time, and the L1 block time
for the proof submission time.

Depends on #8193 

Fixes #7675
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.

2 participants