Skip to main content

Module selector

Module selector 

Source

StructsΒ§

ContinuedValueFn πŸ”’
Continues a fold that an earlier traversal started: it starts from initial and hands the wrapped function each edge’s index shifted by offset.
HoprGraphPathSelector
A lightweight graph-backed path selector.
MetricsValueFn πŸ”’
Wraps an EdgeValueFn<f64, W> as a ValueFn whose Value type carries both the cost and per-path quality aggregates.
PathCostWithMetrics πŸ”’
Accumulated path cost and quality aggregates, folded edge-by-edge during DFS.

ConstantsΒ§

MIDDLE_HOP_SHARE πŸ”’
A relayer may sit past the first position in at most n.div_ceil(MIDDLE_HOP_SHARE) of the n candidates take_relayer_diverse keeps, while the pool allows it, counted over every position past the first together: a relayer in the second position of some paths and the third of others costs as many paths when it dies as one in either alone.
SHARE_SEARCHES πŸ”’
How many times search_share searches one first relayer’s continuations at most.

FunctionsΒ§

compute_paths πŸ”’
Compute candidate paths from src to dest through graph.
compute_paths_spread πŸ”’
Candidate paths from src to dest, spread evenly over src’s first relayers.
distinct_first_relayers πŸ”’
Number of distinct first relayers across paths.
opt_min πŸ”’
Returns the minimum of two Option<T> values, preferring Some over None.
prune_for_consistency
Trim the candidate set to lower median latency and minimise variance while preserving an anonymity floor and relayer diversity in every position.
search_share πŸ”’
One first relayer’s continuations for its share of the pool.
take_relayer_diverse πŸ”’
Takes n candidates from sorted, preferring not-yet-represented first relayers and bounding how often any relayer recurs past the first position.