Leios.Base

This module defines core components for the base layer of Leios protocol. It includes stake distribution, ranking blocks, and base layer abstractions.
Type family for communicating with the base functionality.

INIT: Initialize the base layer with a certificate validation function.

Parameters: - (EndorserBlock × Cert → Bool): A validation function that checks whether an endorser block and certificate pair is valid. Returns True if the pair is valid, False otherwise.

SUBMIT: Submit a ranking block to the base layer for processing.

Parameters: - RankingBlock: A ranking block containing either an endorser block, a list of transactions, or both (using the These type constructor). This represents new content to be added to the ledger.

FTCH-LDG: Request to fetch the current ledger state.

This input has no parameters and is used to query the current state of the base layer ledger.

FTCH-SLOT: Request to fetch the current slot.

This input has no parameters and is used to query the current slot of the base layer ledger.

The base layer can produce four types of outputs: - Stake distribution information - Empty response (no meaningful output) - Base layer ledger contents - Curreent slot of the base layer

STAKE: Output containing the current stake distribution.

Parameters: - StakeDistr: A total map from pool identifiers to their stake amounts (ℕ). This represents how stake is distributed across different pools in the system.

EMPTY: Empty output indicating no meaningful result.

This output is used when an operation completes successfully but produces no data that needs to be returned to the caller.

BASE-LDG: Output containing the base layer ledger contents.

Parameters: - List RankingBlock: A list of ranking blocks that constitute the current state of the base layer ledger. Each ranking block may contain endorser blocks, transactions, or both.

SLOT: Output containing the current slot.

Parameters: - ℕ: the current slot of the base machine. Should always be greater or equal than the slot of the last processed block