1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! 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`.
pub use *;
pub use *;
pub use *;
// 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.