Kaustinen analytics

Last updated: 2023-11-05

The following is an automatically generated report from a modified geth node that captures metrics from the Kaustinen network.

This modified geth node is planned to continue running in Kaustinen, so as the state grows and have bigger state we can keep track if the metrics makes sense considering the design.

Once in a while I'll be updating this document with fresher reports.

Warn: take numbers with a grain of salt we're in early stages of Kaustinen and the geth-vkt version is underly heavy development. There might be bugs, optimizable code, etc. If something looks odd, ask!

Tree stats report

The analyzer tracks every 200 blocks:

  • block_number: the block number where these metrics where collected.
  • depthX_count: how many leaf nodes are at this particular depth.
  • leaf_node_count: how many leaf nodes are in the tree.
  • internal_node_count: how many non-leaf nodes are in the tree.
  • keyvalue_count: how many key-values are stored in the tree.

The following are the stats for the latest registered block:

block_number depth1_count depth2_count depth3_count depth4_count depth5_count leaf_node_count internal_node_count keyvalue_count
153200 0 1849 335473 7080 30 344432 67136 1377975

Interpretation hints:

  • We could get an average leaf-node fill factor by computing kevalue_count/leaf_node_count. Currently, this value is ~5 which makes sense since this is the fill factor for accounts.
  • The distribution of leaf node depths should be coherent with some ~expected depth regarding log_256(keyvalue_count), with reasonable outliers.

Witness stats report

For each witness in a block we register:

  • block_numer: the block number of the analyzed witness.
  • gas_used: gas used in the block.
  • ssz_total_size: the total bytes size of the SSZ encoded witness.
  • ssz_statediff_size: the total bytes of the SSZ encoded statediff part of the witness.
  • ssz_verkleproof_size: the total bytes of the SSZ encoded verkleproof par of the witness.
  • statediff_stem_count: how many stems are in the statediff.
  • statediff_currentvalue_non-nil_count: how many currentValue in the statediff aren't null.
  • statediff_newvalue_non-nil_count: how many newValue in the statediff aren't null.

The following are the top 10 witnesses ordered by ssz_total_size desc:

block_number gas_used ssz_total_size ssz_statediff_size ssz_verkleproof_size statediff_stem_count statediff_currentvalue_nonnil_count statediff_newvalue_nonnil_count
136133 3430000 41914 26960 14946 102 408 103
136127 3430000 41914 26960 14946 102 408 103
132149 3430000 41914 26960 14946 102 408 103
132140 3430000 41914 26960 14946 102 408 103
132136 3430000 41914 26960 14946 102 408 103
132115 3430000 41914 26960 14946 102 408 103
132111 3430000 41914 26960 14946 102 408 103
132092 3430000 41914 26960 14946 102 408 103
131814 3430000 41914 26960 14946 102 408 103
131782 3430000 41914 26960 14946 102 408 103

Interpretation notes:

  • Note that ssz_total_size ~= ssz_statediff_size + ssz_verkleproof_size, the separation is done to know how many bytes from the total size come from the statediff vs the proof.

Proof verification report

This report shows some experimental metrics of the e2e proof verification times:

  • num_keys: how many keys are proven in this proof.
  • numopenings: how many openings are part of this Multiproof.
  • prestate_getelementsforproof_ms: how many ms takes to collect proof elements from the reconstructed pre-state tree.
  • verify_multiproof_ms: how many ms takes to do the Multiproof verification.
  • e2e_verif_time_ms: how many ms takes for all witness verificatio work (deserializing, reconstructing tree, verifying Multiproof, etc).

The following are the top 10 results ordered by num_keys desc:

num_keys numopenings prestate_getelementsforproof_ms verify_multiproof_ms e2e_verif_time_ms
510 1620 14 8 36
510 1620 13 9 35
510 1620 14 8 33
510 1620 13 9 32
510 1620 14 7 35
510 1620 13 10 34
510 1620 14 9 35
510 1620 13 8 33
510 1620 14 11 35
510 1620 19 8 41

Interpretation notes:

  • The block number for each case isn't registered since it's mostly irrelevant for the metrics. What matters is num_keys and/or numopenings.

Proof generation report

This report shows some experimental metrics of the e2e proof generation times:

  • num_keys: how many keys are proven in this proof.
  • numopenings: how many openings are part of this Multiproof.
  • prestate_getelementsforproof_ms: how many ms takes to collect proof elements from the reconstructed pre-state tree.
  • create_multiproof_ms: how many ms takes to do the Multiproof proof generation.
  • e2e_gen_time_ms: total time to generate the proof to be inserted in the block.
  • e2e_gen_time_ms: how many ms takes to generate the witness (get elements from tree, generate Multiproof, serialize, etc).
num_keys numopenings prestate_getelementsforproof_ms create_multiproof_ms e2e_gen_time_ms
510 1620 115 51 166
510 1620 110 50 161
510 1620 128 49 178
510 1620 108 51 159
510 1620 137 55 194
510 1620 109 48 159
510 1620 112 48 161
510 1620 137 48 186
510 1620 136 52 189
510 1620 108 48 158

Interpretation notes:

  • The block number for each case isn't registered since it's mostly irrelevant for the metrics. What matters is num_keys and/or numopenings.