pub struct PixReconstructorConfig {
pub incomplete_commitment_lifetime: Duration,
pub unused_verifier_lifetime: Duration,
pub max_tracked_peers: usize,
pub max_awaiting_acks: usize,
pub max_ack_await_time: Duration,
pub use_batch_verification: bool,
pub early_recovery_threshold: f64,
pub max_ack_buffer_bytes: usize,
}Expand description
Operator-facing mirror of SsaReconstructorConfig, the Exit-side share reconstructor.
Stands in the same relationship to the protocol type that the fields of PixGlobalConfig
stand in to SsaGeneratorConfig: hopr-protocol-pix owns the type the reconstructor is built
from, and this crate owns the shape an operator writes. It exists because none of these seven
values was reachable from a config file at all — both production constructors took
SsaReconstructorConfig::default(), so the Exit side of PIX was unconfigurable while the Entry
side was not.
Duplicating seven fields is the price of the mirror, and two guards pay it. The From impl
below is written exhaustively, so a field added to SsaReconstructorConfig fails to compile
until it is mirrored here; and pix_reconstructor_mirror_matches_the_protocol_defaults asserts
the two default sets still agree. Validation is not duplicated at all — see
validate_pix_reconstructor_config.
Each field’s rationale lives on the protocol type and is linked rather than copied, since a third copy of the same prose is a third thing to keep true.
Fields§
§incomplete_commitment_lifetime: DurationTime until the complete commitment to an SSA must be received.
Defaults to 2 minutes. See
SsaReconstructorConfig::incomplete_commitment_lifetime.
unused_verifier_lifetime: DurationMaximum time an SSA cycle can go without progress before it is discarded.
Defaults to 30 minutes. See SsaReconstructorConfig::unused_verifier_lifetime.
max_tracked_peers: usizeMaximum number of peers tracked simultaneously with unacknowledged shares.
Defaults to 2000, minimum 10. See SsaReconstructorConfig::max_tracked_peers.
max_awaiting_acks: usizeMaximum number of awaited acknowledgements held per peer.
Defaults to 1 000 000, minimum 10 000. See SsaReconstructorConfig::max_awaiting_acks.
max_ack_await_time: DurationMaximum time an acknowledgement is awaited before its share is discarded.
Defaults to 30 seconds. See SsaReconstructorConfig::max_ack_await_time.
use_batch_verification: boolWhether to use the batch verification algorithm for acknowledgements.
Defaults to false. See SsaReconstructorConfig::use_batch_verification, which records
the measurements behind that default and why the knob was kept rather than removed.
early_recovery_threshold: f64Fraction of reconstructed polynomials at which an early recovery notification is emitted.
Defaults to 0.85, range 0.0..=1.0. See
SsaReconstructorConfig::early_recovery_threshold.
max_ack_buffer_bytes: usizeCeiling on the total awaiting-acknowledgement state held across every peer, in bytes.
Defaults to 1 GiB, minimum 25 600 B — 64 entries at the measured per-entry cost. That floor
is a sanity check rather than a sizing recommendation; see
SsaReconstructorConfig::max_ack_buffer_bytes, which is where it is enforced and why it is
deliberately low.
This — not the product of max_tracked_peers and
max_awaiting_acks — is what bounds the reconstructor’s
acknowledgement buffer, and the reconstructor enforces it as shares arrive rather than
checking a workload model here. A model would have to assume a Session count and a packet
rate; maximum_managed_sessions validates to 100 000 and SessionCapability::NoRateControl
removes the rate limiter, so neither assumption survives contact with a legal configuration.
Trait Implementations§
Source§impl Clone for PixReconstructorConfig
impl Clone for PixReconstructorConfig
Source§fn clone(&self) -> PixReconstructorConfig
fn clone(&self) -> PixReconstructorConfig
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 PixReconstructorConfig
Source§impl Debug for PixReconstructorConfig
impl Debug for PixReconstructorConfig
Source§impl Default for PixReconstructorConfig
impl Default for PixReconstructorConfig
Source§fn default() -> Self
fn default() -> Self
Return PixReconstructorConfig { incomplete_commitment_lifetime: SsaReconstructorConfig::DEFAULT_INCOMPLETE_COMMITMENT_LIFETIME, unused_verifier_lifetime: SsaReconstructorConfig::DEFAULT_UNUSED_VERIFIER_LIFETIME, max_tracked_peers: SsaReconstructorConfig::DEFAULT_MAX_TRACKED_PEERS, max_awaiting_acks: SsaReconstructorConfig::DEFAULT_MAX_AWAITING_ACKS, max_ack_await_time: SsaReconstructorConfig::DEFAULT_MAX_ACK_AWAIT_TIME, use_batch_verification: SsaReconstructorConfig::DEFAULT_USE_BATCH_VERIFICATION, early_recovery_threshold: SsaReconstructorConfig::DEFAULT_EARLY_RECOVERY_THRESHOLD, max_ack_buffer_bytes: SsaReconstructorConfig::DEFAULT_MAX_ACK_BUFFER_BYTES }
Source§impl From<PixReconstructorConfig> for SsaReconstructorConfig
impl From<PixReconstructorConfig> for SsaReconstructorConfig
Source§fn from(cfg: PixReconstructorConfig) -> Self
fn from(cfg: PixReconstructorConfig) -> Self
Both sides are written out exhaustively, with no ..Default::default() on either.
That is the guard the mirror rests on: a field added to SsaReconstructorConfig leaves
this initialiser incomplete and a field added to PixReconstructorConfig leaves the
pattern incomplete, so either one fails to compile until it is mirrored. Struct update
syntax would compile in both directions and silently pin the new knob to its default.
Source§impl PartialEq for PixReconstructorConfig
impl PartialEq for PixReconstructorConfig
impl StructuralPartialEq for PixReconstructorConfig
Source§impl Validate for PixReconstructorConfig
impl Validate for PixReconstructorConfig
Auto Trait Implementations§
impl Freeze for PixReconstructorConfig
impl RefUnwindSafe for PixReconstructorConfig
impl Send for PixReconstructorConfig
impl Sync for PixReconstructorConfig
impl Unpin for PixReconstructorConfig
impl UnsafeUnpin for PixReconstructorConfig
impl UnwindSafe for PixReconstructorConfig
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<T> Conv for T
impl<T> Conv for T
§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<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.