Reduce preserved cycles
Motivation
The goal of this MR is manifold. In the scope of the "Reduce blocktime project", it is needed to improve the performance on several places. Indeed, reducing the block time will increase the number of blocks per cycle (~50% if we reach 10s), lowering the performances of the storage and improving it's footprint as a side effect. Here, we are interested in reducing the disk footprint and rework some storage format to result in a performance improvement.
Scope
To do so, we first need to rework the preserved_cycles, which are the number of cycles in the future that are used to compute the consensus rights. In the shell, it is used to determine the last_allowed_fork_level -- that is used to trigger storage maintenance (store and context GCs). Then, thanks to a clearer definition of preserved cycles, we will be able to propagate reductions in the data to keep on the disk. In addition to that, it is also important to consider reworking the way attestations are store on disk, by factorizing the redundant data. This would allow a 40% disk footprint reduction for the attestations of each block (from ~400 to ~200 Mb per cycle)
Design
See:
-
LPBL: Last Preserved Block Level
-
LFBL: Last Finalized Block Level
Work breakdown
Improve last allowed fork level semantics (2 weeks -- ETA: End of December)
-
Prerequisite: -
Environment v12 -
Protocol Alpha (targeting P) with the v12 environment
-
-
Backport LPBL into environments < 12 such as LPBL = LAFL !11201 (merged) -
(day) s/lafl/lpbl/ !11201 (merged) -
(day) expose the LPBL (LAFL’s successor) !11201 (merged) -
(day) expose the LFBL (last_finalized_block_level) !11201 (merged) -
(days) handle backward compatibility
Reduce LPBL and LFBL (1 week -- ETA: end of December)
-
Prerequisite: -
Improve last allowed fork level semantics -
Protocol Alpha that sets preserved_cycles to the adequate value
-
-
(days) Protocol Alpha that sets LFBL to head~2 !11262 (merged) -
(days) align checkpoint to LFBL !11262 (merged) -
(days) handle migration LPBL -
(hours) test default migration (create one big cemented file out of N cycles) -
(day) optional (really?): monitor node migration and storage on mainnet -
(days) optional: proto plugin to align to cycles #6746 (closed)
-
Optimise attestations encodings (2 weeks -- ETA: end of January)
-
(days) Introduce a protocol plugin to decode attestations !11234 (closed) -
(days) Introduce a new encoding for attestations -
(week) Handle upgrade procedure (TBD Vincent Botbol) -
Rewrite attestations for < v12 && >= TB envs
-
-
(days) Benchmark -
Introduce a non-mergeable framework to -
compare the disk size footprint -
compare the r/w io speeds -
prototype vicall@bench_store_attestations_encodings
-
-