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:
- FullyCompatible —
R == local - BackwardCompatible —
R < localbutR >= min_compatible(we speak down to them) - ForwardCompatible —
R > local(they are newer; we use our feature set) - Incompatible —
R < 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§
- Negotiation
Result - The outcome of a successful protocol version negotiation between two peers.
- Protocol
Descriptor - Full description of a protocol as advertised by one side of a connection.
- Protocol
Version - A semantic version triple for a protocol (
major.minor.patch). - Protocol
Version Manager - Central registry and negotiation engine for protocol versions.
- Version
Stats - Running statistics for all negotiation attempts handled by a
ProtocolVersionManager.
Enums§
- Compatibility
Level - Classification of the compatibility relationship between two protocol version endpoints.