Skip to main content

FoldedRoster

Struct FoldedRoster 

Source
pub struct FoldedRoster {
Show 18 fields pub roles: CommunityRoles, pub role_authors: Vec<PublicKey>, pub grant_authors: Vec<PublicKey>, pub gapped_entities: Vec<[u8; 32]>, pub skipped: usize, pub fetched: usize, pub heads: Vec<EntityHead>, pub banned: Vec<String>, pub banlist_author: Option<PublicKey>, pub dissolved_by: Vec<PublicKey>, pub banlist_head: Option<EntityHead>, pub invite_link_sets: Vec<InviteLinkSet>, pub root_meta: Option<CommunityMetadata>, pub root_author: Option<PublicKey>, pub root_head: Option<EntityHead>, pub root_candidates: Vec<RootCandidate>, pub channel_meta: Vec<ChannelMetaHead>, pub channel_candidates: Vec<ChannelMetaHead>,
}
Expand description

The outcome of folding the control plane.

Fields§

§roles: CommunityRoles

The anchored, bound, validly-signed heads. This is “validly signed, anchored, and current” — NOT yet “authorized.” authorize_delegation is the next layer: it filters these by the delegation chain (each signer must outrank what it defines, chaining to the owner). Use the authorized result for any authority decision; this raw roster is the binding-layer output.

§role_authors: Vec<PublicKey>

The signer (inner real-npub author) of each entry in roles.roles, SAME ORDER — so authorize_delegation can check whether that signer was allowed to define the role.

§grant_authors: Vec<PublicKey>

The signer of each entry in roles.grants, SAME ORDER (the delegation chain needs the granter).

§gapped_entities: Vec<[u8; 32]>

Entity ids whose head is NOT chain-anchored (a gap, §version). These are quarantined — NOT folded into roles (fail closed). A bootstrapping joiner re-verifies them via authority before trusting; a tracking client refetches the missing prereqs.

§skipped: usize

Count of editions dropped: bad signature, missing/duplicate fields, an entity_id↔content mismatch, unparseable content, or beyond the cap. Nonzero ⇒ the roster may be degraded (a role/grant could be silently missing), so the caller should refetch rather than trust it.

§fetched: usize

Count of RAW control editions the source fetch returned (before opening/folding). Set by fetch_control_folded; 0 for a roster folded from a hand-supplied edition set (tests, prefolds). fetch_and_apply_control surfaces it so an admin-write guard can tell “≥1 relay responded” (any raw event) from total network isolation — without a second, throwaway probe fetch.

§heads: Vec<EntityHead>

The current head (entity_hex, version, self_hash) of every successfully-bound ROLE/GRANT entity, for the caller to advance set_edition_head (monotonic). Excludes the banlist (its head is banlist_head, advanced by the banlist path) and gapped/quarantined entities.

§banned: Vec<String>

The folded banlist content (banned pubkeys, lowercase hex) — only meaningful once the BAN authority of banlist_author is checked against the authorized roster. Empty if no banlist edition folded (distinct from “an authored empty banlist,” which the caller learns via banlist_head/banlist_author being Some).

§banlist_author: Option<PublicKey>

The signer (inner real-npub author) of the folded banlist head, so the caller can verify they held BAN. None if no banlist edition folded.

§dissolved_by: Vec<PublicKey>

The DISTINCT signers of every well-formed GroupDissolved tombstone (vsk=10) at dissolved_locator Detection is owner-SIGNATURE-filtered, NOT position/version dependent: the fold scans the locator directly (NOT via the version-chain version::fold — the tombstone has no chain) and lists each authoring npub, so a flood of forged NON-owner editions can never bury the real owner’s signer out of the MAX_CONTROL_EDITIONS cap and truncate the true tombstone away. The CALLER treats the community as dissolved ONLY if the proven owner is in this set (mirrors banlist_author’s BAN check). A malformed edition at the locator is dropped (skipped), never honored.

§banlist_head: Option<EntityHead>

The banlist entity’s current head, for the banlist path to advance set_edition_head.

§invite_link_sets: Vec<InviteLinkSet>

Folded per-creator invite-link sets (vsk=8, one per creator at invite_links_locator(cid, creator)). Each holds that creator’s active link locators + head. The caller authorizes each creator (held CREATE_INVITE) and UNIONS the locators into the aggregate active-set — the source of truth for the Public/Private mode + registry-authoritative joins. No shared registry.

§root_meta: Option<CommunityMetadata>

The folded GroupRoot (community metadata, vsk=0 at entity_id == community_id). None if no GroupRoot edition folded. Applied only once the caller checks root_author held MANAGE_METADATA.

§root_author: Option<PublicKey>

The signer of the folded GroupRoot head, so the caller can verify they held MANAGE_METADATA.

§root_head: Option<EntityHead>

The GroupRoot entity’s current head, for the metadata path to advance set_edition_head.

§root_candidates: Vec<RootCandidate>

Every gap-vetted GroupRoot candidate at-or-above the floor (fork members included), highest version first (deterministic inner-id tiebreak within a version). The consumer applies the highest whose author is CURRENTLY authorized (MANAGE_METADATA) — an author-aware descending scan (B1b), so a demoted author’s edition (incl. a same-version forgery) can’t be the head, and a fresh fold converges to the highest authorized edition (the owner’s re-assert). root_head is root_candidates[0] (the author-blind head) for back-compat.

§channel_meta: Vec<ChannelMetaHead>

Folded per-channel metadata (vsk=2, one per channel entity_id == channel_id) — the author-blind top head per channel (back-compat: used by the demoted-author re-assert path). For convergence the consumer scans Self::channel_candidates instead.

§channel_candidates: Vec<ChannelMetaHead>

Every gap-vetted channel-metadata candidate at-or-above each channel’s floor (fork members included), highest version first with the deterministic inner-id tiebreak — the per-channel mirror of Self::root_candidates. Grouped contiguously per channel (sorted within each channel). The consumer applies, per channel, the highest whose author CURRENTLY holds MANAGE_CHANNELS — an author-aware scan, so a demoted author’s same-version forgery can’t orphan an authorized re-assert and a concurrent same-version rename converges to one deterministic winner on every client.

Trait Implementations§

Source§

impl Clone for FoldedRoster

Source§

fn clone(&self) -> FoldedRoster

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more