---
# System prepended metadata

title: Reduce preserved cycles

---

Reduce preserved cycles
=======================

Context:
- Reducing the block time will increase number of blocks per cycle by X% (probably 50% for 10s)


Benefits:
- Full nodes will have less Irmin history to retain
- Rolling nodes will have less Irmin history to retain and less blocks stored

Definition/Relations of preserved cycles:
- Determines last allowed fork level
- Number of cycles in the future to compute consensus rights

=> Protocol
- s/preserved cycles/future cycles (determine a better name)/ (= 5)
- recycle max_slashable_period/re-introduce preserved cycles for the past (= 2 cycles)
- set Last allowed fork level to level(HEAD~2)

E.g.
Last preserved block level = HEAD - N*|Cycle|

=> Environment
- Introduce "Last preserved block level" in the latest environment (old environments => lafl = lpbl)

=> Store
- Replace last allowed fork level by last preserved block level

=> Stitching

|cycle| = 10

0(lafl=0)..10(lafl=0)..20(lafl=0)..30(lafl=0)..40(lafl=0)..50(lafl=0)..60(lafl=10)..70(lafl=20)..80(lafl=30)...|||90(lpbl=70)

0_10 11_20 21_30 ... 31_70

- Solution 1: do nothing and let the store dump a 4 cycle cycle
- Solution 2: protocol plugin for store => on transition, compute real cycles for the 31_70 interval and slice them properly
    - Follow-up of store's protocol plugin: aggregate redundant information for efficient disk representation
        - would allow reducing by 2 the disk footprint of consensus votes
