mirage / irmin

Irmin is a distributed database that follows the same design principles as Git
https://irmin.org
ISC License
1.85k stars 155 forks source link

Replayable Actions Trace (V0 → V1) #1486

Open Ngoguey42 opened 3 years ago

Ngoguey42 commented 3 years ago

High level goals

Planning

Main steps (ordered):

Upstreaming

Extra steps

Extra optional steps

WIP Branches

Files and Commands Workflow

            (tezos-node) ------> {not yet implemented} ---------\
                  |                                             |
                  v                                             |
          [raw actions trace] -> (manage_actions.exe summarise) |
                  |                            |                |
                  |                            v                |
                  |                 [raw_actions_summary.json]  |
                  |                            |                |
                  |                            v                |
                  |                   (pandas / matplotlib)     |
                  v                                             |
  (manage_actions.exe to-replayable)                            |
                  |                                             |
                  v                                             |
       [replayable actions trace]                               |
                  |                                             |
                  v                                             v
             (tree.exe) -----------------------------> [stat trace]
                                                            |
                                                            v
                                               (manage_stats.exe summarise)
                                                            |
                                                            v
                                                  [stat_summary.json]
                                                            |
                                                            v
                                     (pandas / matplotlib / manage_stats.exe pp)
samoht commented 3 years ago

Related: tezedge has some nice visualisation for the trace statistics on https://tezedge.com/#/resources/storage

Screenshot 2021-07-19 at 18 06 50
Ngoguey42 commented 3 years ago

bpm = blocks per minute tps = transactions per second tx = transaction

bpm decay during replay

For the first time, I've executed a replay from edo up to now (level 1_343_487 to ~1_567_400). (I haven't reimplemented the stat trace yet, only the total runtime is available).

Replaying edo took 5h25, at a rate of 378 bpm and 296 tps.

Replaying flo took 11h45, at a rate of 143 bpm and ~217 tps.

There are 2 reasons for that bpm decay:

In the future, when benchmarking, we will have to choose between replaying from snapshots or from archives.

bpm decay during bootstrap

That same problem can be observed on a bootstraping tezos node when looking at the length of the blocks that got stuck on index merge

The 2 following graphics show the evolution of the block length for 2 bootstrapping tezos nodes. The first one started from genesis and the second one started from a snashot, a few blocks before Edo.

At the beginning of florence, the blocks stuck on merges last ~2.5 min in the first one vs ~40 sec in the second one.

While the average block length is ~0.5 sec in both graphics, it starts to decay from Delphi in the first one. The reason is because the length of the commits blocked on merge start to dominate the over the length of the non-bocked ones.

long

short

Misc

Some stats per protocol extracted from tzstats.com

op_count              15,866,555.00
op_count_tx            1,873,210.00
op_count_contract          6,466.00
blocks                   655,361.00
op_count_tx / block            2.86
Name: genesis, dtype: float64

op_count              5,884,601.00
op_count_tx           1,197,242.00
op_count_contract       607,631.00
blocks                  196,608.00
op_count_tx / block           6.09
Name: babylon, dtype: float64

op_count              12,509,277.00
op_count_tx            4,236,021.00
op_count_contract        907,658.00
blocks                   360,448.00
op_count_tx / block           11.75
Name: carthage, dtype: float64

op_count              5,360,581.00
op_count_tx           2,404,503.00
op_count_contract       442,364.00
blocks                  131,072.00
op_count_tx / block          18.34
Name: dephi, dtype: float64

op_count              8,597,058.00
op_count_tx           5,775,811.00
op_count_contract     2,695,300.00
blocks                  122,878.00
op_count_tx / block          47.00
Name: edo, dtype: float64

op_count              10,602,467.00
op_count_tx            8,519,477.00
op_count_contract      5,047,644.00
blocks                    93,633.00
op_count_tx / block           90.99
Name: florence (so far), dtype: float64

Misc

For reference, the replay rate when starting from genesis is 10k bpm, and the progress rate of mainnet is 1 bpm.