Expand description
Functions and type for implementing the onion service directory ring.
The onion service directory ring is an ordered ring of the all of relays in
the consensus with the HsDir flag. The HSDirs change their position in this
index every TimePeriod, and every time that the shared random value in
the consensus changes. (These events are typically synchronized, for
reasonable network configurations.)
Each onion service is also (semi-privately) associated with “N” positions on the ring based on its blinded ID and the current time period. When upload or downloading an onion service descriptor descriptor, we look at the ring at each of these positions, and consider the “S” relays that fall at that position or later. (“N” is a “number of replicas” parameter, and “S” is a “Spread” parameter.)
Re-exports§
use std::collections::HashMap;🔒use std::fmt::Debug;🔒use std::fmt::Debug;🔒use derive_more::AsRef;🔒use derive_more::From;🔒use derive_more::Into;🔒use digest::Digest;🔒use typed_index_collections::TiVec;🔒use tor_basic_utils::impl_debug_hex;🔒use tor_hscrypto::pk::HsBlindId;🔒use tor_hscrypto::time::TimePeriod;🔒use tor_llcrypto::d::Sha3_256;🔒use tor_llcrypto::pk::ed25519::Ed25519Identity;🔒use crate::hsdir_params::HsDirParams;🔒use crate::NetDir;🔒use crate::RouterStatusIdx;🔒
Structs§
- HsDir
Index 🔒 - A sort key determining a position in the onion service directory ring.
- HsDir
Pos 🔒 - Position in the hsdir hash ring
- HsDir
Ring 🔒 - A hash ring as used in
NetDir.
Functions§
- relay_
hsdir_ 🔒index - Compute the
HsDirIndexfor a given relay. - service_
hsdir_ 🔒index - Compute the starting
HsDirIndexfor a given descriptor replica.