Module tezos_smart_rollup::dac
source · Expand description
Defines dac related types and functions.
Modules
- Encoding of Dac certificates. Dac certificates are versioned: the first byte in a serialized Dac certificate is indicative of the version of the certificate itself.
- Encoding of DAC payload as a Merkle tree with an arbitrary branching factor greater or equal to 2. The serialization process works as follows:
Structs
- A 33-byte hash corresponding to a preimage.
- Content page consisting of a dynamic number of bytes.
- Hash page consisting of a dynamic number of
PreimageHash. - Borrowing version of V0ContentPage.
- Borrowing version of V0HashPage.
Enums
- A Dac page: either a leaf node of contents, or node of hashes.
- A Dac Page that borrows the underlying buffer.
- Errors that may occur when dealing with SlicePage.
Constants
- Maximum size of dac pages is 4Kb.
Functions
- Fetches a page of data from file
hashintobufferusing Runtime::reveal_preimage. Returns a tuple of the raw page and remaining buffer. - Hashes
contentinto a preimage hash. - Generates the preimages of the given content.
- Recursively traverses a Merkle Tree of hashes up to
max_dac_levelsdepth where each hash corresponds to a preimage that can be revealed via Runtime::reveal_preimage. The closuresave_contentis applied on each content page found.