Skip to main content

Module protocol_version

Module protocol_version 

Source
Expand description

Protocol versioning and compatibility negotiation for P2P connections.

This module provides:

  • Semantic version representation for protocols (ProtocolVersion)
  • Compatibility classification between local and remote protocol versions
  • Protocol descriptor with feature advertisement
  • Multi-protocol version negotiation (ProtocolVersionManager)
  • Statistics tracking for negotiation outcomes

§Design Rationale

Compatibility is evaluated against a per-protocol min_compatible floor. A remote peer speaking version R is:

  • FullyCompatibleR == local
  • BackwardCompatibleR < local but R >= min_compatible (we speak down to them)
  • ForwardCompatibleR > local (they are newer; we use our feature set)
  • IncompatibleR < min_compatible (wire format too old to speak safely)

Feature negotiation produces the intersection of advertised feature sets. Features present locally but absent from the intersection are recorded in NegotiationResult::dropped_features.

Structs§

NegotiationResult
The outcome of a successful protocol version negotiation between two peers.
ProtocolDescriptor
Full description of a protocol as advertised by one side of a connection.
ProtocolVersion
A semantic version triple for a protocol (major.minor.patch).
ProtocolVersionManager
Central registry and negotiation engine for protocol versions.
VersionStats
Running statistics for all negotiation attempts handled by a ProtocolVersionManager.

Enums§

CompatibilityLevel
Classification of the compatibility relationship between two protocol version endpoints.