pub enum SurbPopOrder {
Fifo,
}Expand description
Which end of the per-pseudonym buffer a pop consumes from. Replying side only.
FIFO, oldest first, is the only order. SURBs that carry a PIX share are always consumed before
share-less ones (see “Share-bearing SURBs first” on the internal SurbRingBuffer), and within each
of those two tiers the oldest goes first, whether it is popped or evicted on overflow. The order is
independent of the per-SURB generation tag (SurbReceiverInfo::generation), which handles an
explicit return-path re-plan by clearing superseded SURBs wholesale on the next push.
There used to be a Lifo variant (hoprnet#8328), consuming newest first so that a return-path
change would apply before the buffered SURBs drained. It was removed because PIX cannot work with
it: a share reaches the reconstructor only when its SURB is used, so a LIFO store buries the
oldest shares of the current cycle, and an overflow then evicts exactly those, which loses them for
good. Every node may act as a PIX Exit and nothing in the configuration turns that off
(enforce_pix only makes it mandatory), so the option had no safe use — and what it was for is
what the generation tag does.
What FIFO gives up is that SURBs the sender replaced, because their return path broke, are spent
before their replacements, so a dead relayer’s SURBs are spent into the void until the buffer turns
over. The sender makes up for it: when a relayer is judged dead it advances the session’s SURB
generation, and this side drops everything it holds on the next push (see “Generations” on the
internal SurbRingBuffer). The sender’s judgement of its relayers counts on this order as well: it
reads a race between two SURBs minted together by the one a FIFO replier spends first.
This enum, and the SurbStoreConfig::pop_order field carrying it, remain only so that existing
configurations (pop_order: fifo) and code naming SurbPopOrder::Fifo keep working; they are
candidates for removal in a later major version. pop_order: lifo is rejected as an unknown
variant.
Variants§
Fifo
Oldest first. The only order, and the default.
Trait Implementations§
Source§impl Clone for SurbPopOrder
impl Clone for SurbPopOrder
Source§fn clone(&self) -> SurbPopOrder
fn clone(&self) -> SurbPopOrder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SurbPopOrder
Source§impl Debug for SurbPopOrder
impl Debug for SurbPopOrder
Source§impl Default for SurbPopOrder
impl Default for SurbPopOrder
Source§fn default() -> SurbPopOrder
fn default() -> SurbPopOrder
Source§impl Display for SurbPopOrder
impl Display for SurbPopOrder
impl Eq for SurbPopOrder
Source§impl FromStr for SurbPopOrder
impl FromStr for SurbPopOrder
Source§impl Hash for SurbPopOrder
impl Hash for SurbPopOrder
Source§impl Ord for SurbPopOrder
impl Ord for SurbPopOrder
Source§fn cmp(&self, other: &SurbPopOrder) -> Ordering
fn cmp(&self, other: &SurbPopOrder) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SurbPopOrder
impl PartialEq for SurbPopOrder
Source§impl PartialOrd for SurbPopOrder
impl PartialOrd for SurbPopOrder
impl StructuralPartialEq for SurbPopOrder
Auto Trait Implementations§
impl Freeze for SurbPopOrder
impl RefUnwindSafe for SurbPopOrder
impl Send for SurbPopOrder
impl Sync for SurbPopOrder
impl Unpin for SurbPopOrder
impl UnsafeUnpin for SurbPopOrder
impl UnwindSafe for SurbPopOrder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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