pub struct IncomingSessionPixConfig {
pub enforce_pix: bool,
pub quota_range: RangeInclusive<u64>,
pub max_live_cycle_bytes: u64,
pub supervision: SupervisorConfig,
}Expand description
Configuration of the PIX protocol for incoming Sessions on Exit nodes.
Fields§
§enforce_pix: boolIf set to true, incoming Session without the Capability::UsePIX will be rejected.
Default false.
quota_range: RangeInclusive<u64>Acceptable range of data quota in bytes.
With dynamic SSA batches enabled, the Exit selects the smallest batch up to
SupervisorConfig::ssas_per_request whose total batch_size × quota_per_ssa is inside this
range. With dynamic batches disabled, the Entry’s per-SSA quota itself must be inside the
range and the configured batch size is used exactly. An offer that satisfies neither rule is
rejected before the Session is established.
The default is derived from the default PIX dimensions
(crate::DEFAULT_PIX_POLYS_PER_SSA × (crate::DEFAULT_PIX_SHARES_PER_POLY +
crate::DEFAULT_PIX_SURPLUS_SHARES)) rather than hard-coded, so that an Entry running the
default configuration is always accepted. The upper bound is exactly
DEFAULT_PIX_SSA_QUOTA. Since every dynamic batch has at least one member, that upper bound
still caps the data served by any one SSA cycle. Accepting larger dimensions would raise both
that exposure and the reconstructor memory held per Session, so an Exit that wants to serve
them must widen this range explicitly.
The quota it is compared against counts the surplus — polys × (threshold + surplus) × PIX_QUOTA_BYTES_PER_SHARE — so this bounds the traffic actually served rather than the
fraction of it the threshold accounts for. It used to bound only the latter, which understated
the exposure by the surplus factor: 1.25× at the deployed dimensions.
Defaults to DEFAULT_PIX_SSA_QUOTA / 4 ..= DEFAULT_PIX_SSA_QUOTA
(≈ 227 MiB to ≈ 908 MiB, inclusive).
max_live_cycle_bytes: u64Ceiling on the live Exit-side reconstructor state this node will commit to, in bytes.
This, not SessionManagerConfig::maximum_sessions, is what bounds reconstructor
memory. A PIX Session reserves MAX_OVERLAPPING_BATCHES × ssas_per_request × hopr_protocol_pix::peak_cycle_bytes(offered params) when it is accepted and holds it until
it closes; a Session that does not fit is refused with
StartErrorReason::NoSlotsAvailable before any state is allocated for it. The reservation
is computed from the parameters the peer offered, so a Session asking for smaller
dimensions costs proportionally less of the budget.
Enforced at admission rather than validated as a product of the configuration, for the reason
SsaReconstructorConfig::max_ack_buffer_bytes gives: maximum_sessions validates to
100 000, and the resulting product is a number no node could hold, so validating it would
only ever reject the shipping defaults. Counting what has actually been committed to is
indifferent to how the ceiling was configured.
Default is 3 GiB. Derived from the deployed operating point rather than picked: at the
default dimensions a Session reserves ≈82 MiB, so this admits ≈37 concurrent PIX Sessions,
comfortably covering the 10–30 clients per Exit the calibration profile models. The same
defaults with maximum_sessions = 100 and no budget imply ≈8 GiB.
A ceiling on reservations, not an allocation: nothing is claimed up front, and because the reservation is denominated at the adversarial peak, a node serving conforming peers holds an order of magnitude less than it has reserved. The number exists to stop an Exit selling more service than its memory can hold, not to describe what it will typically use.
supervision: SupervisorConfigDeadlines, fault limits and service budget the Exit-side PIX supervisor enforces on a Session.
These live together rather than spread across this struct because they are only meaningful
as a set: crate::validate_pix_supervision checks them against each other and against the
reconstructor’s lifetimes, and the node’s config validator runs that at load time.
Implementations§
Source§impl IncomingSessionPixConfig
impl IncomingSessionPixConfig
Sourcefn effective_for(
&self,
decision: &SessionAdmissionDecision,
) -> EffectivePixAdmission
fn effective_for( &self, decision: &SessionAdmissionDecision, ) -> EffectivePixAdmission
The terms one Session is judged on, once the session server has had its say.
The configured quota_range is an envelope, not a default: it is what
validate_incoming_session_pix_config checked the deadlines and memory ceiling against,
and what start_protocol_channel_capacity sized a preallocated ring from, both once at
startup. So a decision’s range is intersected with it rather than replacing it — a Session
may be held to less than the node advertises, never to more than it was configured to
honour. An operator wanting a wider class configures a wider envelope and narrows the rest.
enforce_pix carries no such coupling and is simply overridden.
Sourcepub fn supervisor_config(&self) -> SupervisorConfig
pub fn supervisor_config(&self) -> SupervisorConfig
The supervisor configuration for Sessions accepted under these settings.
Trait Implementations§
Source§impl Clone for IncomingSessionPixConfig
impl Clone for IncomingSessionPixConfig
Source§fn clone(&self) -> IncomingSessionPixConfig
fn clone(&self) -> IncomingSessionPixConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IncomingSessionPixConfig
impl Debug for IncomingSessionPixConfig
Source§impl Default for IncomingSessionPixConfig
impl Default for IncomingSessionPixConfig
Source§impl<'de> Deserialize<'de> for IncomingSessionPixConfigwhere
IncomingSessionPixConfig: Default,
impl<'de> Deserialize<'de> for IncomingSessionPixConfigwhere
IncomingSessionPixConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for IncomingSessionPixConfig
impl PartialEq for IncomingSessionPixConfig
Source§impl Serialize for IncomingSessionPixConfig
impl Serialize for IncomingSessionPixConfig
impl StructuralPartialEq for IncomingSessionPixConfig
Auto Trait Implementations§
impl Freeze for IncomingSessionPixConfig
impl RefUnwindSafe for IncomingSessionPixConfig
impl Send for IncomingSessionPixConfig
impl Sync for IncomingSessionPixConfig
impl Unpin for IncomingSessionPixConfig
impl UnsafeUnpin for IncomingSessionPixConfig
impl UnwindSafe for IncomingSessionPixConfig
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<'de, T> BorrowedRpcObject<'de> for Twhere
T: RpcBorrow<'de> + RpcSend,
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<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<'de, T> RpcBorrow<'de> for T
impl<T> RpcObject for Twhere
T: RpcSend + RpcRecv,
impl<T> RpcRecv for T
impl<T> RpcSend for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.