Skip to main content

Crate hopr_transport

Crate hopr_transport 

Source
Expand description

The crate aggregates and composes individual transport level objects and functionality into a unified crate::HoprTransport object with the goal of isolating the transport layer and defining a fully specified transport API.

See also the hopr_protocol_start crate for details on Start sub-protocol which initiates a Session.

As such, the transport layer components should be only those that are directly necessary to:

  1. send and receive a packet, acknowledgement or ticket aggregation request
  2. send and receive a network telemetry request
  3. automate transport level processes
  4. algorithms associated with the transport layer operational management
  5. interface specifications to allow modular behavioral extensions

Re-exportsΒ§

pub use crate::config::HoprProtocolConfig;
pub use crate::protocol::PeerProtocolCounterRegistry;
pub use hopr_transport_session as session;
pub use hopr_api as api;

ModulesΒ§

config
Configuration of the crate::HoprTransport.
constants
Constants used and exposed by the crate.
errors
Errors used by the crate.
multiaddrs πŸ”’
path
Graph-based path planning for the HOPR transport layer. Graph-based path planning for the HOPR transport layer.
pipeline πŸ”’
protocol
Transport binary protocol layer (codec, pipeline, heartbeat, stream). Collection of objects and functionality allowing building of p2p or stream protocols for the higher business logic layers.
socket

StructsΒ§

ApplicationData
Represents the to-be-sent or received decrypted packet carrying the application-layer data.
ApplicationDataIn
Wrapper for incoming ApplicationData with optional IncomingPacketInfo.
ApplicationDataOut
Wrapper for outgoing ApplicationData with optional IncomingPacketInfo.
ChainKeypair
Represents a keypair consisting of a secp256k1 private and public key
FlowControlConfig
Client-tunable flow-control parameters. Defaults are deliberately conservative (anti-grief-preserving): the window starts at the floor and only grows on proven delivery, and the opt-in robustness knobs are off. This is the clean profile.
HalfKeyChallenge
Represents a challenge for the half-key in Proof of Relay.
HoprPixSpec
Current specification of the PIX protocol in HOPR.
HoprSession
Represents the Session protocol socket over HOPR.
HoprSessionConfigurator
Allows configuration of one specific HoprSession.
HoprTransport
Interface into the physical transport mechanism allowing all off-chain HOPR-related tasks on the transport.
MemorySurbStore
Basic SurbStore implementation based on an in-memory cache.
Multiaddr
Representation of a Multiaddr.
NeighborTelemetry
Intermediate neighbor telemetry object.
OffchainKeypair
Represents a keypair consisting of an Ed25519 private and public key
OffchainPublicKey
Represents an Ed25519 public key in its compact (compressed) form.
PathTelemetry
Path telemetry data for multi-hop loopback probing.
PeerId
Identifier of a peer of the network.
PingQueryReplier
Helper object allowing to send a ping query as a wrapped channel combination that can be filled up on the transport part and awaited locally by the Pinger.
PixParams
Everything about PIX two nodes must agree on for a Session, and the only encoding of it: three dimensions and the curve suite they are dimensions of.
RANDOM_DATA πŸ”’
RecoveredSsa
Contains the already recovered secret scalar corresponding to a specific SSA.
SESSION_INITIATION_TIMEOUT_MAX πŸ”’
SessionClientConfig
Configuration for the session.
SimplePseudonym
Represents a simple UUID-like pseudonym consisting of 10 bytes.
SurbBalancerConfig
Configuration for the SurbBalancer.
TagAllocatorConfig
Configuration for the tag allocator partitions.

EnumsΒ§

Health
Network health represented with colors, where green is the best and red is the worst possible observed network quality.
HoprTransportProcess
InvalidPixParams
Why a PixParams quadruple was rejected.
ProbeError
Protocol
Protocol describes all possible multiaddress protocols.
RoutingOptions
Represents routing options in a mixnet with a maximum number of hops.
SessionCapability
Individual capabilities of a Session.
SessionManagerError
SessionTarget
Defines what should happen with the data at the recipient where the data from the established session are supposed to be forwarded to some target.
Tag
Tags distinguishing different application-layer protocols.
TransportSessionError
Enumeration of errors thrown from this library.

ConstantsΒ§

APPLICATION_TAG_RANGE
COUNTER_FLUSH_ACK_GRACE_DIVISOR πŸ”’
Share of the counter flush interval a conformance report waits for its packets’ acknowledgments.
LOCAL_PIX_SUITE
The elliptic curve suite this build instantiates PIX over, as announced to peers.
PACKET_PAYLOAD_SIZE
Maximum application-layer payload that fits in a single HOPR sphinx packet (bytes).
PIX_EVENT_DISPATCH_CONCURRENCY πŸ”’
How many PIX share resolutions may be dispatched into the SessionManager at once.
SESSION_MTU
Number of bytes that can be sent in a single Session protocol payload.
SURB_BUFFER_TARGET_DENOMINATOR πŸ”’
SURB_BUFFER_TARGET_NUMERATOR πŸ”’
Fraction of the SURB ring buffer a Session’s balancer target may occupy.
SURB_SIZE
Size of the HOPR SURB in bytes.

TraitsΒ§

Keypair
Represents a generic key pair The keypair contains a private key and public key. Must be comparable in constant time and zeroized on drop.
NetworkView
Trait representing a read-only view of the network state.
PixSpec
Re-exported so a consumer can name <HoprPixSpec as PixSpec>::DepositAddress and assert at compile time that it is the variant it can actually settle. Which instantiation is in play is a feature-graph outcome rather than a local decision, and getting it wrong is otherwise silent until deposits stop happening at runtime. Specification of the Protocol for Incentivization of eXits (PIX) instantiation.
SurbStore
A trait defining the operations required to store and retrieve SURBs (Single Use Reply Blocks) and their reply openers.

FunctionsΒ§

commitment_resolution_stream πŸ”’
Turns the reconstructor’s synchronous resolution wake-up into an asynchronous stream.
counter_flush_ack_grace πŸ”’
How long each protocol-conformance report waits for acknowledgments of the packets it counts.
dispatch_share_resolution πŸ”’
Notifies the SessionManager about a single PIX share resolution and returns the upper-layer [PixEvent] it produces, if any.
peer_id_to_public_key
Reads the packet key out of an Ed25519 PeerId’s multihash.
pix_event_stream πŸ”’
Builds the merged PIX event stream feeding the upper layer.
recovered_ssa_to_pix_event πŸ”’
Maps a fully recovered SSA into the downstream event that carries the recovered deposit key to the withdrawal strategy.
session_pix_event_to_pix_event πŸ”’
Maps a HoprSessionOutPixEvent into the upper-layer [PixEvent] carrying the deposit instruction for the funding strategy.
ssa_reconstructor πŸ”’
Builds the Exit-side SSA reconstructor from operator configuration.
surb_buffer_target_ceiling πŸ”’
Largest SURB buffer target a Session may request, given the ring buffer capacity backing it.
transfer_session
Bidirectionally forwards all data between two streams until either side closes, with an equally sized buffer in both directions.
transfer_session_datagram
Datagram-boundary-preserving variant of transfer_session for UDP session bridges.
wire_exit_pix πŸ”’
Wires the Exit-side PIX machinery: PixToolbox, the recovered-share channel and the HoprTransportProcess::PixEvents task, returning the toolbox and the pipeline builder with share processing attached.

Type AliasesΒ§

Hash
Represents an Ethereum 256-bit hash value.
HoprPseudonym
Alias for the Pseudonym used in the HOPR protocol.
HoprSessionManager πŸ”’
HOPR protocol specific instantiation of the SessionManager.
IncomingSession
Wrapper for an incoming HoprSession carrying the SessionId and SessionTarget extracted from the Start protocol during session establishment.
ServiceId
Identifies a node-local service target.
SessionAdmissionReply
Where a SessionAdmissionRequest’s answer is delivered.
SessionAdmissionSink
How the SessionManager reaches whoever decides admission.
SessionCapabilities
Set of Session capabilities.
SessionId
Identity of a HOPR Session.