tape-core 0.5.7

A decentralized object store using Solana.
Documentation
//! Spool index/count types and shared error definitions.
//!
//! The on-chain shape (per-(epoch, group_idx) `Group.spools[MAX_GROUP_SIZE]`) is defined in
//! `solana/api/src/state/group.rs`. The off-chain spooler in the `tape-spooler`
//! crate produces address-keyed assignments that ratify into those `Group`
//! accounts via `vote_assignment`.

mod fold;
mod group;
mod virtual_group;

pub use fold::*;
pub use group::*;
pub use virtual_group::*;

// The spool relationships are:
//
//   - GroupIndex::containing(spool) → group is derived from spool
//   - group.position_of(spool) → slice index is derived from spool + group
//   - group.spool_at(slice) → spool is derived from group + slice
//
//   Given a SpoolIndex, you can always derive the GroupIndex and the SliceIndex within it. So
//   passing spool, group, AND lost is redundant; any one of these plus spool is computable from
//   the other.
//
// A track's leaf carries a VirtualGroup, one of VIRTUAL_GROUP_COUNT, and slices are stored
// under that group's spools for life. A GroupIndex is a live group, the one with a `Group`
// account. GroupFold maps a virtual group to the live group that carries it, so a live spool
// holds the stored spools of every virtual group folded onto its group.

/// Errors used across spool allocation and migration.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SpoolerError {
    CountMismatch,
    TotalMismatch,
    InsufficientNodes,
    SpoolCapExceeded,
    Infeasible,
}