package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Dal_slot_repr/History/index.html
Module Dal_slot_repr.History
Source
This module provides an abstract data structure (type t
) that represents a skip list used to store successive DAL slots confirmed/attested on L1. There is one slot per cell in the skip list. The slots are sorted in increasing order by level, and by slot index, for the slots of the same level.
This module also defines a bounded history cache (type History_cache.t
) that allows to remember recent values of a skip list of type t
(indexed by the skip lists' hashes). This structure is meant to be maintained and used by the rollup node to produce refutation proofs involving DAL slot inputs.
Note on terminology: "confirmed slot" is another name for "attested slot".
Abstract representation of a skip list specialized for confirmed slot headers.
Type of hashes of history.
Encoding of the datatype.
The History_cache.t
structure is basically a bounded lookup table of t
skip lists. (See Bounded_history_repr.S
). In the L1 layer, the capacity (bound) is set to zero (nothing is remembered). By contrast, the rollup node uses a history cache with a (sufficiently) large capacity to participate in all potential refutation games occurring during the challenge period. Indeed, the successive recent skip-lists stored in the cache are needed to produce proofs involving slots' pages.
val add_confirmed_slot_headers :
t ->
History_cache.t ->
Header.t list ->
(t * History_cache.t) Tezos_protocol_environment_alpha.Error_monad.tzresult
add_confirmed_slots hist cache slot_headers
updates the given structure hist
with the list of slot_headers
. The given cache
is also updated to add successive values of cell
to it.
val add_confirmed_slot_headers_no_cache :
t ->
Header.t list ->
t Tezos_protocol_environment_alpha.Error_monad.tzresult
add_confirmed_slot_headers_no_cache cell slot_headers
same as add_confirmed_slot_headers
, but no cache is updated.
Dal slots/pages proofs
When a SCORU kernel's inputs come from the DAL, they are provided as pages' content for confirmed slots, or None in case the slot doesn't exist or is not confirmed.
In a refutation game involving an import tick of a Dal page input, a honest user should be able to provide:
- When the PVM is requesting a page of a confirmed slot: a proof that the slot is confirmed, in addition to needed information to check that the page (whose id and content are given) is part of the slot;
- When the opponent pretends that the PVM is requesting a page of some unconfirmed slot, but that slot is not published or not confirmed on L1: a proof that the slot (whose id is given via the page's id) cannot be confirmed on L1.
See the documentation in the ml file for more technical details.
Encoding for proof
.
val pp_proof :
serialized:bool ->
Tezos_protocol_environment_alpha.Format.formatter ->
proof ->
unit
Pretty-printer for proof
. If serialized
is false
it will print the abstracted proof representation, otherwise if it's true
it will print the serialized version of the proof (i.e. a sequence of bytes).
val produce_proof :
parameters ->
Page.t ->
page_info:(Page.content * Page.proof) option ->
get_history:(hash -> t option Tezos_protocol_environment_alpha.Lwt.t) ->
t ->
(proof * Page.content option)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
produce_proof dal_parameters page_id page_info ~get_history slots_hist
produces a proof that either:
- there exists a confirmed slot in the skip list that contains the page identified by
page_id
whose data and slot inclusion proof are given bypage_info
, or - there cannot exist a confirmed slot in the skip list (whose head is given by
slots_hist
) containing the page identified bypage_id
.
In the first case above, page_info
should contain the page's content and the proof that the page is part of the (confirmed) slot whose id is given in page_id
. In the second case, no page content or proof should be provided, as they are not needed to construct a non-confirmation proof.
dal_parameters
is used when verifying that/if the page is part of the candidate slot (if any).
val verify_proof :
parameters ->
Page.t ->
t ->
proof ->
Page.content option Tezos_protocol_environment_alpha.Error_monad.tzresult
verify_proof dal_params page_id snapshot proof
verifies that the given proof
is a valid proof to show that either:
- the page identified by
page_id
belongs to a confirmed slot stored in the skip list whose head issnapshot
, or - there is not confirmed slot in the skip list (whose head is)
snapshot
that could contain the page identified bypage_id
.
dal_parameters
is used when verifying that/if the page is part of the candidate slot (if any).