pub struct IncomingSessionPixConfig {
pub enforce_pix: bool,
pub quota_range: RangeInclusive<u64>,
pub max_ssa_delivery_time: Duration,
pub max_deposit_wait: Duration,
pub ssas_per_request: usize,
}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 per one SSA in bytes.
If an Entry sends PIX parameters for SSA reconstruction that are outside this quota range, the incoming Session will be rejected.
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: the range expresses how much data this Exit is willing to serve
per SSA cycle, and accepting more than our own nominal dimensions would raise both that
exposure and the reconstructor memory held per Session. An Exit that wants to serve Entries
configured with larger dimensions must widen this range explicitly.
The quota it is compared against counts the surplus — polys × (threshold + surplus) × PAYLOAD_SIZE — 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
(≈ 162 MiB to ≈ 649 MiB, inclusive).
max_ssa_delivery_time: DurationMaximum time to wait for the SSA to be fully committed and delivered to the Exit.
The Session is allowed to be used unincentivized for max_deposit_time + max_ssa_delivery_time the deposit
wait time because the Client has to be able to deliver its SSA commitment.
max_deposit_wait: DurationMaximum time to wait for the funds to be deposited in the SSA.
The Session is allowed to be used unincentivized for max_deposit_time + max_ssa_delivery_time the deposit
wait time because the Client has to be able to deliver its SSA commitment.
Default is 1 minute.
ssas_per_request: usizeNumber of SSAs this Exit asks the Entry to commit to in a single
[SsaServerCommitmentMessage].
Batching amortizes the round trip over several deposit cycles, at the cost of holding that many live reconstructor cycles at once (≈49 MiB of peak state each at the profiled dimensions) and fronting that many SSA quotas of unincentivized service before the first deposit lands. It applies to every request, including the first one at Session establishment.
The deposit deadline scales with it: each cycle in a batch gets a kill switch at
ssas_per_request × (max_deposit_wait + max_ssa_delivery_time), and the deposit awaiter’s
timeout is scaled by the same factor, so a batch is judged as a whole rather than per cycle.
This must not exceed the peer Entry’s max_ssas_per_request. There is no negotiation of
the batch size — StartSession.additional_data is fully allocated (PIX dimensions in the
upper 32 bits, SURB balancer target in the lower 32), so the Entry has no way to advertise its
cap and this Exit has no way to learn it. An Entry that considers the batch too large rejects
the whole request and replies with a
[StartErrorReason::UnacceptablePixParams] SessionError, which closes the Session on both
sides within about a round trip — see refuse_ssa_request. Every Session is still lost, so
raising this requires raising pix.max_ssas_per_request on every Entry that will use this
Exit; the reply only means the failure is immediate and reported rather than showing up as a
deposit timeout after the whole ssas_per_request-scaled window has elapsed.
Clamped to 1..=MAX_SSA_BATCH_SIZE in SessionManager::new.
Defaults to DEFAULT_SSAS_PER_SSA_REQUEST (1), which reproduces the unbatched exchange
exactly.
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§fn default() -> Self
fn default() -> Self
Return IncomingSessionPixConfig { enforce_pix: false, quota_range: DEFAULT_PIX_SSA_QUOTA / DEFAULT_PIX_QUOTA_RANGE_SPAN ..= DEFAULT_PIX_SSA_QUOTA, max_ssa_delivery_time: Duration::from_secs(20), max_deposit_wait: Duration::from_secs(60), ssas_per_request: DEFAULT_SSAS_PER_SSA_REQUEST }
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.