pub struct ConfigStakerSet { /* private fields */ }Expand description
In-memory StakerSet implementation, built from a parsed
NodeId set or empty.
The runtime wires the chain-backed ChainStakerSet (reads
CapacityBond.getRegisteredNodes() once at startup, then follows the registry’s
membership events via the shared eth_getLogs poll) — see
capacity_bond_registry::bootstrap, #1110. This impl is what tests and
explicit operator-supplied sets use: construct via Self::new with a known
HashSet, or Self::empty. It implements the same StakerSet trait as
the chain-backed impl, so the two are interchangeable.
Implementations§
Trait Implementations§
Source§impl Debug for ConfigStakerSet
impl Debug for ConfigStakerSet
Source§impl StakerSet for ConfigStakerSet
impl StakerSet for ConfigStakerSet
Source§fn active_nodes(&self) -> Vec<NodeId>
fn active_nodes(&self) -> Vec<NodeId>
Snapshot of the active-staker set. Order is unspecified; the caller
MUST randomize before any selection step that an attacker could
influence (e.g. bootstrap target picking).
Source§fn len(&self) -> usize
fn len(&self) -> usize
Cardinality of the active set. Default implementation walks
Self::active_nodes; production impls (chain-backed cache, etc.)
SHOULD override with an O(1) counter.Auto Trait Implementations§
impl Freeze for ConfigStakerSet
impl RefUnwindSafe for ConfigStakerSet
impl Send for ConfigStakerSet
impl Sync for ConfigStakerSet
impl Unpin for ConfigStakerSet
impl UnsafeUnpin for ConfigStakerSet
impl UnwindSafe for ConfigStakerSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.