Skip to main content

hopr_transport/protocol/
mod.rs

1//! Collection of objects and functionality allowing building of p2p or stream protocols for the higher business logic
2//! layers.
3//!
4//! ## Contents
5//!
6//! Supported protocol configurations:
7//!
8//! - `mix`
9//! - `ack`
10//! - `heartbeat`
11
12/// Coder and decoder for the transport binary protocol layer
13mod codec;
14
15/// Per-peer protocol conformance counters.
16pub mod counters;
17
18/// Errors produced by the crate.
19pub mod errors;
20
21// protocols
22/// `heartbeat` p2p protocol
23pub mod heartbeat;
24
25/// Packet pipeline for the HOPR protocol.
26mod pipeline;
27/// Stream processing utilities
28pub mod stream;
29
30/// A bounded map of minted SURBs that evicts a random record when full.
31#[cfg(feature = "testing")]
32pub mod surb_map;
33#[cfg(not(feature = "testing"))]
34pub(crate) mod surb_map;
35
36/// Records SURB round-trips as network graph edge telemetry.
37pub mod surb_telemetry;
38
39pub use counters::{PeerProtocolCounterRegistry, PeerProtocolCounters};
40pub use pipeline::{
41    AcknowledgementPipelineConfig, NodeType, NopExitAcknowledgementShareProcessor, PacketPipelineBuilder,
42    PacketPipelineConfig, PacketPipelineProcesses, PoolArbitrationConfig, Unset,
43};
44
45const HOPR_PACKET_SIZE: usize = hopr_crypto_packet::prelude::HoprPacket::SIZE;
46
47pub type HoprBinaryCodec = codec::FixedLengthCodec<HOPR_PACKET_SIZE>;
48// The larger fixed-size packets cannot be decoded by peers using the previous wire format.
49// Version 1.2.0 uses generation-tagged SURBs with the previous packet payload size.
50pub const CURRENT_HOPR_MSG_PROTOCOL: &str = "/hopr/mix/1.3.0";