Skip to main content

SsaReconstructorConfig

Struct SsaReconstructorConfig 

Source
pub struct SsaReconstructorConfig {
    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

Configuration for the SSA reconstructor.

Fields§

§incomplete_commitment_lifetime: Duration

Time until the complete commitment to an SSA must be received.

Default is 2 minutes.

§unused_verifier_lifetime: Duration

Maximum time an SSA cycle can go without progress before it is discarded.

Measured from the last acknowledged share anywhere in the cycle, not per polynomial — see SsaCycle for why that distinction is load-bearing. A cycle that is still being served therefore never expires, whatever the line rate.

Default is 30 minutes.

§max_tracked_peers: usize

Maximum number of peers that can be tracked simultaneously with unacknowledged shares.

Default is 2000, minimum is 10.

This is a per-peer fan-out bound, and it guards the opposite concentration to max_awaiting_acks: traffic spread thinly across many first-relayers. The two cannot both be saturated at once, which is why their product is not the reconstructor’s memory bound — see PixReconstructorConfig in hopr-transport for the bound that is.

§max_awaiting_acks: usize

Maximum number of awaited acknowledgements to extract a single share.

This corresponds to the maximum number of unacknowledged HOPR packets awaiting acknowledgement.

Default is 1 000 000, must be at least 10 000.

Sizes one inner cache per peer, so it must cover the concentrated case: every Session on the node returning through a single first-relayer. At the operating point tests/memory_profile.rs models that is ~542 000 entries, which is what makes a cap of this order the right one rather than an oversight.

§max_ack_await_time: Duration

Maximum time an acknowledgement can be awaited before it is discarded.

Default is 30 seconds.

Multiplies the whole awaiting-ack buffer: the reachable state is the Exit’s share-emission rate times this window, so it — not either cap above — is the dial that actually sizes the buffer.

§use_batch_verification: bool

Indicates whether to use batch verification algorithm for acknowledgements.

Default is false.

Batching only covers the acknowledgement signature check. While each share also cost a threshold-term multi-scalar multiplication, that MSM dominated and the choice was immaterial — measured 2.46 MiB/s batched against 2.50 MiB/s unbatched. Committing to the constant term alone removed the MSM, and the batching overhead is no longer hidden by it: the same benchmark then measures 50.2 MiB/s batched against 92.8 MiB/s unbatched, so batching costs 46 % of the sustained rate.

Settled against the concurrent pipeline shape, which is what the Exit actually runs and what the sequential figures above could not speak to. concurrent_quota_rate on 48 cores at production width, aggregate MiB/s of Session quota:

callersunbatchedbatched
190.946.4unbatched 1.96×
10130.2126.2tie — confidence intervals overlap
48139.8152.6batched 1.09×

So batching does eventually pay, but only above the concurrency the pipeline is configured for: DEFAULT_ACK_INPUT_CONCURRENCY is 10, which is precisely the row where the two are indistinguishable. false stays the default because it is far better at low concurrency and no worse at the configured one, making it the safer choice across the range an operator can set — not because batching is slower everywhere.

Kept configurable for the operator who raises ack_input_concurrency well past its default, where the last row says the choice flips.

Headroom is narrower than it looks. A deployed Exit serves 10–30 clients at 16–20 Mbps, so it absorbs 19–72 MiB/s; against the 130 MiB/s above that is 1.8× at the top of the range, not the 7.3× an earlier reading of these figures claimed. That claim came from comparing against the benchmark suite’s own model of production — 100 Sessions at 1.5 Mbps, 18.75 MiB/s — which understates real per-Session rate by 13×. The rates here are also measured at 4096 polynomials rather than the 512 used previously, which costs about 5 %.

§early_recovery_threshold: f64

Fraction of reconstructed polynomials at which to emit an early recovery notification, triggering pipelined SSA request preparation.

Range: 0.0..1.0. Default: 0.85.

§max_ack_buffer_bytes: usize

Ceiling on the total live state held in the awaiting-acknowledgement buffer, across every peer, in bytes.

This is the global bound; max_tracked_peers and max_awaiting_acks are per-dimension backstops and their product is not one. See SsaReconstructor::insert_encrypted_share for why the product overstates by roughly three thousandfold and why bounding it instead would lose shares.

Enforced at insertion time rather than by validating a workload model. A model has to assume a Session count and a packet rate; the node enforces neither — maximum_managed_sessions validates to 100 000 and SessionCapability::NoRateControl removes the rate limiter entirely — so a configuration can be perfectly valid and still exceed any modelled budget. Counting what is actually held is indifferent to all of that.

Default is 1 GiB, which at AWAITING_ACK_ENTRY_BYTES is ~2.68 M shares in flight.

The minimum is 25 600 B — 64 entries. That is a sanity floor, not a sizing recommendation: its only job is to stop the budget rounding down to a handful of shares. Whether a given value is adequate depends on the node’s traffic, which is exactly the thing this design stopped trying to predict, so the floor deliberately does not pretend to encode it. A node configured near it will drop shares and say so.

Implementations§

Source§

impl SsaReconstructorConfig

The defaults, named so that a mirror can share them instead of restating them.

hopr-transport’s PixReconstructorConfig is the operator-facing shape of this struct, and a second copy of these literals over there would be a second thing to keep true. Referencing them from both #[default(…)] sites means the two cannot disagree by construction, which is a stronger guarantee than any test comparing them after the fact.

Trait Implementations§

Source§

impl Clone for SsaReconstructorConfig

Source§

fn clone(&self) -> SsaReconstructorConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SsaReconstructorConfig

Source§

impl Debug for SsaReconstructorConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SsaReconstructorConfig

Source§

fn default() -> Self

Return SsaReconstructorConfig { incomplete_commitment_lifetime: Self::DEFAULT_INCOMPLETE_COMMITMENT_LIFETIME, unused_verifier_lifetime: Self::DEFAULT_UNUSED_VERIFIER_LIFETIME, max_tracked_peers: Self::DEFAULT_MAX_TRACKED_PEERS, max_awaiting_acks: Self::DEFAULT_MAX_AWAITING_ACKS, max_ack_await_time: Self::DEFAULT_MAX_ACK_AWAIT_TIME, use_batch_verification: Self::DEFAULT_USE_BATCH_VERIFICATION, early_recovery_threshold: Self::DEFAULT_EARLY_RECOVERY_THRESHOLD, max_ack_buffer_bytes: Self::DEFAULT_MAX_ACK_BUFFER_BYTES }

Source§

impl PartialEq for SsaReconstructorConfig

Source§

fn eq(&self, other: &SsaReconstructorConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SsaReconstructorConfig

Source§

impl Validate for SsaReconstructorConfig

Source§

fn validate(&self) -> Result<(), ValidationErrors>

Source§

impl<'v_a> ValidateArgs<'v_a> for SsaReconstructorConfig

Source§

type Args = ()

Source§

fn validate_with_args(&self, args: Self::Args) -> Result<(), ValidationErrors>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more