pub enum SoftwareVersionDetail {
Full,
Minor,
Off,
}Expand description
How much of its own build a node reveals when it advertises (dig_ecosystem#2215).
Advertising an exact build is a fingerprinting aid — it tells an observer precisely which peers run a version with a publicly disclosed defect. This is the operator’s dial between that cost and the diagnostic value of knowing what the network is running.
It lives here, beside PeerSoftware, because rendering and parsing are two halves of one
format: a node that hand-rolled its own product/version string would be re-implementing half
the contract, and the two halves would drift. A node picks a mode; this type renders it.
Variants§
Full
Advertise the exact build, e.g. dig-node/0.99.1. The default: the diagnostic value is why
the field exists, and an operator who disagrees opts down explicitly.
Minor
Advertise only the major and minor level, e.g. dig-node/0.99.0. Hides the patch level, and
any pre-release or build metadata, while remaining READABLE at the far end.
Off
Advertise nothing. Indistinguishable from a peer built before this field existed, and reads
as PeerSoftware::Unknown.
Implementations§
Source§impl SoftwareVersionDetail
impl SoftwareVersionDetail
Sourcepub fn render(self, product: &str, version: &Version) -> String
pub fn render(self, product: &str, version: &Version) -> String
Render the advertisement a node with this setting puts on its handshake.
The result is ALWAYS either the empty string or a value PeerSoftware::parse reads back
as Reported. Coarsening reduces PRECISION; it never produces a value that reads as
Unknown while pretending to be a report. Two consequences follow, and both are tested:
MinorrendersMAJOR.MINOR.0, never a bareMAJOR.MINOR— two-part versions are not valid semver, so that spelling would read as Unknown and become a second, confusing spelling ofOff.Minorof a0.0.xbuild renders the EMPTY STRING, because its coarsening is version zero and version zero is the “unknown” sentinel. There is no coarser representable value, so it advertises nothing rather than advertising the sentinel as if it were a report.
A coarsened 1.4.0 is indistinguishable from a genuine 1.4.0. That is the point of
coarsening, not a defect in it.
Trait Implementations§
Source§impl Clone for SoftwareVersionDetail
impl Clone for SoftwareVersionDetail
Source§fn clone(&self) -> SoftwareVersionDetail
fn clone(&self) -> SoftwareVersionDetail
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more