Skip to main content

DeterministicStewardList

Struct DeterministicStewardList 

Source
pub struct DeterministicStewardList { /* private fields */ }

Implementations§

Source§

impl DeterministicStewardList

Source

pub fn empty( conversation_id: impl Into<Vec<u8>>, config: StewardListConfig, ) -> Self

Joiner-side: empty list. The coordinator fills it from the ConversationSync it receives after the welcome.

Source

pub fn with_creator( conversation_id: impl Into<Vec<u8>>, creator_identity: Vec<u8>, config: StewardListConfig, ) -> Result<Self, CoreError>

Creator-side: bootstrap with the creator as the sole steward at epoch 0. No election, no retries.

Trait Implementations§

Source§

impl Debug for DeterministicStewardList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StewardListPlugin for DeterministicStewardList

Source§

fn config(&self) -> &StewardListConfig

Steward list bounds + protocol-level flags.
Source§

fn set_config(&mut self, config: StewardListConfig)

Replace the active config — joiner sync path adopts the conversation-wide values. Preserves list and retry state; subsequent install_list calls use the new bounds.
Source§

fn current_list(&self) -> Option<&StewardList>

Borrow the active list. None for joiners pre-ConversationSync.
Source§

fn election_epoch(&self) -> Option<u64>

Epoch at which the active list was elected. None if no list.
Source§

fn retry_round(&self) -> u32

Current retry round (0 for fresh elections, bumped on each rejected proposal within the same MLS epoch). Distinct from the list’s frozen retry_round historical tag.
Source§

fn max_retries(&self) -> u32

Conversation-configured ceiling on steward-election retries. Joiners pick this up via ConversationSync.
Source§

fn set_max_retries(&mut self, max: u32)

Source§

fn is_steward(&self, identity: &[u8]) -> bool

True iff identity sits in the active list.
Source§

fn is_exhausted(&self, epoch: u64) -> bool

True iff epoch falls outside the list’s covered window [election_epoch, election_epoch + len). A new election MUST follow once the list is exhausted.
Source§

fn epoch_steward<F: Fn(&[u8]) -> bool>( &self, epoch: u64, eligible: F, ) -> Option<&[u8]>

Steward responsible for epoch, walking the rotation past any candidate for whom eligible returns false. Pass |_| true for the nominal position.
Source§

fn epoch_and_backup<F: Fn(&[u8]) -> bool>( &self, epoch: u64, eligible: F, ) -> (Option<&[u8]>, Option<&[u8]>)

Live epoch steward + backup, guaranteed distinct when ≥2 are eligible. Backup is None when fewer than two stewards are eligible.
Source§

fn steward_members<F: Fn(&[u8]) -> bool>(&self, eligible: F) -> Vec<Vec<u8>>

Steward roster filtered by eligible. Used by the coordinator to build ConversationSync.steward_members so joiners don’t inherit ghosts or members queued for removal.
Source§

fn election_proposer<F: Fn(&[u8]) -> bool>(&self, eligible: F) -> Option<&[u8]>

Deterministic election proposer when the list exhausts. Walks rotation from index 0; returns None if no steward is eligible.
Source§

fn install_list( &mut self, epoch: u64, candidate_pool: &[Vec<u8>], sn: usize, retry_round: u32, ) -> Result<Vec<StewardListEvent>, CoreError>

Generate and install a steward list of size sn from candidate_pool. retry_round is the seed fed into the SHA256 sort and stored on the resulting list as its historical tag — pass the round from the accepted election proposal, or 0 for creator bootstrap and sn_min auto-fills (no election).
Source§

fn validate_proposed( &self, proposed: &[Vec<u8>], epoch: u64, candidate_pool: &[Vec<u8>], retry_round: u32, ) -> Result<bool, CoreError>

True iff proposed matches what this plug-in would generate for the same parameters. Coordinator calls this on the joiner path before applying an election result.
Source§

fn propose_election<F: Fn(&[u8]) -> bool>( &self, epoch: u64, candidate_pool: &[Vec<u8>], self_identity: &[u8], eligible: F, recovery: bool, ) -> Result<ElectionDecision, CoreError>

Decide whether this node SHOULD file a steward-election proposal and, if so, return the proposal contents. Coordinator passes the candidate pool it built (MLS members minus pending-removal targets minus any extra excludes), the eligibility predicate (typically the same set as the pool), recovery = true to bypass the list-exhaustion gate, and the node’s own identity. Plug-in handles authorization + ordering; coordinator handles has_election_in_flight + the I/O submit.
Source§

fn maybe_auto_fill( &mut self, epoch: u64, members: &[Vec<u8>], ) -> Result<Vec<StewardListEvent>, CoreError>

Re-install the list when membership policy says it must change (e.g. RFC rule: members.len() < sn_min ⇒ everyone is a steward). Coordinator calls this after every membership-changing commit without checking the rule itself; the plug-in decides whether to act. Returns events only when a re-install actually fired.
Source§

fn bump_retry(&mut self) -> Vec<StewardListEvent>

Increment the retry round. Emits StewardListEvent::RetryExhausted once the new round exceeds max_retries.
Source§

fn reset_retry(&mut self)

Reset the retry round to 0 (called on accepted election or successful commit).

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> Classify for T

Source§

type Classified = T

Source§

fn classify(self) -> T

Source§

impl<T> Declassify for T

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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