Trait sov_modules_api::SlotData
source · pub trait SlotData: Serialize + DeserializeOwned + PartialEq<Self> + Debug + Clone + Send + Sync {
type BlockHeader: BlockHeaderTrait;
type Cond: ValidityCondition;
// Required methods
fn hash(&self) -> [u8; 32];
fn header(&self) -> &Self::BlockHeader;
fn validity_condition(&self) -> Self::Cond;
}
Expand description
SlotData
is the subset of a DA layer block which is stored in the rollup’s database.
At the very least, the rollup needs access to the hashes and headers of all DA layer blocks, but rollups
may choose to partial (or full) block data as well.
Required Associated Types§
sourcetype BlockHeader: BlockHeaderTrait
type BlockHeader: BlockHeaderTrait
The header type for a DA layer block as viewed by the rollup. This need not be identical to the underlying rollup’s header type, but it must be sufficient to reconstruct the block hash.
For example, most fields of the a Tendermint-based DA chain like Celestia are irrelevant to the rollup.
For these fields, we only ever store their serialized representation in memory or on disk. Only a few special
fields like data_root
are stored in decoded form in the CelestiaHeader
struct.
sourcetype Cond: ValidityCondition
type Cond: ValidityCondition
The validity condition associated with the slot data.
Required Methods§
sourcefn header(&self) -> &Self::BlockHeader
fn header(&self) -> &Self::BlockHeader
The header of the DA layer block.
sourcefn validity_condition(&self) -> Self::Cond
fn validity_condition(&self) -> Self::Cond
Get the validity condition set associated with the slot