DAL: prepare skip-list cells to carry attestation lag (semantics & hash-preserving)
Overall Plan (attempt)
- This MR (preparatory, no behavior change): extend DAL skip-list types/encodings so cells can carry the attestation lag used when they were produced, while preserving hashes for all legacy cells.
- 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).
- (3-b) Adapt plugin if needed.
- Adapt the refutation games' code.
- Adapt the Rollup node.
Current stack of MRs:
For deps, see https://docs.google.com/spreadsheets/d/1rak6nBXnlNggnOnA5WTF7idHNXn0hsSCnVqrypHBew0/edit?usp=sharing
What this MR does
Type extensions (backward compatible):
- Add
attestation_lag_kind = Legacyandlegacy_attestation_lag = 8. - Introduce
cell_id = { header_id : Header.id; attestation_lag : attestation_lag_kind }. - Change skip-list cell content to store lag:
Unpublished of cell_idPublished of { header : Header.t; attestation_lag : attestation_lag_kind; ... }
- Provide helpers:
attestation_lag_value, equality/pretty-printers, andcontent_id : cell_content -> cell_id.
Encoding strategy (hash-preserving):
- Keep existing legacy encodings (
tags 2/3) and serialize exactly as before (no lag field in bytes), so pre-T cells keep identical hashes. - On decode, legacy cells are decorated in memory with
attestation_lag = Legacy; this decoration is not re-serialized in legacy cases.
API/Call-site updates (mechanical):
- Adjust modules and callers to go through Slots_history.content_id → cell_id.header_id when they need the slot id.
- Add a client-side safety check in dal_plugin_registration.ml: verify
attested_level = published_level + attestation_lag_valuefor fetched cells; introduce errorAttested_level_mismatch(no behavior change unless mismatch).
Semantics preserving:
- No change to ordering/search: still compare by (published_level, slot_index) for now.
- No change to attestation logic, proofs, or import rules.
- No new configuration exposed.
Edited by Mohamed IGUERNLALA