DAL/Proto: introduce & plug a dynamic case for attestation_lag_kind
For deps, see https://docs.google.com/spreadsheets/d/1rak6nBXnlNggnOnA5WTF7idHNXn0hsSCnVqrypHBew0/edit?usp=sharing
Handled item from original MR !19500 (merged):
- Enable alternate lag (internal): the ability to have a different lag than the legacy one, still not user-exposed.
- Plug the ability to provide the lag from outside (i.e., when calling cell addition functions).
What changes
-
Type:
attestation_lag_kind = Legacy | Dynamic of int -
Encoding: add new dynamic cases for cell content (unpublished_dyn/published_dyn) so that:
-
Legacy cells keep identical bytes/hashes (backward compatible).
-
Dynamic n cells serialize n and thus commit to it in the cell hash.
-
APIs: extend
-
Slots_history.update_skip_list[_no_cache] ... ~attestation_lag -
Storage wrapper and caller to
update_skip_listnow passDynamic attestation_lag, whereattestation_lagos taken from protocol constants. -
Tests: updated to provide
~attestation_lag:Legacy. We could provideDynamic lag, when the lag is known as well.
Compatibility guarantees
- No behavior change for existing data: legacy cells decode as Legacy, are re-serialized identically.
- New cells can be produced with
Dynamic n(currently fed from constants), but no external config exposed yet. - The use of
Dynamic legacy_attestation_lagshould guarantee the same semantics and behaviour (skip-list shape, refutation proofs, ...) as usingLegacy