diff --git a/api/migrations/next.md b/api/migrations/next.md index 2bfd79a..198ffa2 100644 --- a/api/migrations/next.md +++ b/api/migrations/next.md @@ -176,6 +176,12 @@ Exhaustive literals and matches over these types need updating: Costs below their floor are raised to it, as `lxmd.py` does (`LXMF/Utilities/lxmd.py:187-215`); a cost of 100 or more, which upstream accepts but no stamp can meet, is rejected at load. +- **Announced node version.** A propagation node announces the LXMF release + it follows (`lxmf_core::constants::LXMF_COMPAT_VERSION`, "1.3.0") as its + version, where it announced the Rust crate version + (`LXMF/LXMRouter.py`, `get_propagation_node_announce_metadata`). + `PropagationNodeAnnounceData::new` sets it. `lxmd-rs --version` still names + both versions. - **Stored files.** - Delivered message ids are journaled in `delivery_claims` in the router's storage directory. diff --git a/crates/lxmf-core/src/constants.rs b/crates/lxmf-core/src/constants.rs index b79c49d..0ebed99 100644 --- a/crates/lxmf-core/src/constants.rs +++ b/crates/lxmf-core/src/constants.rs @@ -88,6 +88,10 @@ pub const COMMENT_FOR: u8 = 0x00; pub const CONTINUATION_OF: u8 = 0x00; pub const PN_META_VERSION: u8 = 0x00; +/// The LXMF release this port follows. A propagation node announces it as +/// its [`PN_META_VERSION`], where upstream announces `LXMF.__version__` +/// (LXMRouter.py, `get_propagation_node_announce_metadata`). +pub const LXMF_COMPAT_VERSION: &str = "1.3.0"; pub const PN_META_NAME: u8 = 0x01; pub const PN_META_SYNC_STRATUM: u8 = 0x02; pub const PN_META_SYNC_THROTTLE: u8 = 0x03; diff --git a/crates/lxmf-core/src/handlers.rs b/crates/lxmf-core/src/handlers.rs index e1db28d..4e874d1 100644 --- a/crates/lxmf-core/src/handlers.rs +++ b/crates/lxmf-core/src/handlers.rs @@ -116,7 +116,8 @@ pub struct PropagationNodeAnnounceData { pub peering_cost: f64, /// [`PN_META_IMPL_NAME`] string; `new` sets `"lxmd"` as upstream does. pub impl_name: Option, - /// [`PN_META_VERSION`] string; `new` sets this crate's version. + /// [`PN_META_VERSION`] string; `new` sets the LXMF version this port + /// follows, [`LXMF_COMPAT_VERSION`], as upstream sets `LXMF.__version__`. pub version: Option, /// Binary metadata entries, such as [`PN_META_NAME`]. pub metadata: HashMap>, @@ -144,7 +145,7 @@ impl PropagationNodeAnnounceData { stamp_flex, peering_cost, impl_name: Some(PN_IMPL_NAME.to_string()), - version: Some(env!("CARGO_PKG_VERSION").to_string()), + version: Some(LXMF_COMPAT_VERSION.to_string()), metadata: HashMap::new(), } } diff --git a/crates/lxmf-tools/src/lxmd_cli.rs b/crates/lxmf-tools/src/lxmd_cli.rs index 558072d..f208ff4 100644 --- a/crates/lxmf-tools/src/lxmd_cli.rs +++ b/crates/lxmf-tools/src/lxmd_cli.rs @@ -26,8 +26,9 @@ impl SendMethod { } } -/// The LXMF release `lxmd-rs` follows, named in its `--version` line. -pub const LXMF_COMPAT_VERSION: &str = "1.3.0"; +/// The LXMF release `lxmd-rs` follows, named in its `--version` line and +/// announced as its propagation node version. +pub const LXMF_COMPAT_VERSION: &str = lxmf_core::constants::LXMF_COMPAT_VERSION; #[derive(Parser)] #[command( diff --git a/crates/lxmf-tools/src/lxmd_runtime.rs b/crates/lxmf-tools/src/lxmd_runtime.rs index 1b25281..f6cb525 100644 --- a/crates/lxmf-tools/src/lxmd_runtime.rs +++ b/crates/lxmf-tools/src/lxmd_runtime.rs @@ -480,7 +480,6 @@ mod tests { ); data.timebase = 1_700_000_000; data.set_name("Node"); - data.version = Some("1.3.0".into()); // Upstream metadata order: 0xFE impl name, 0x00 version, then binary 0x01 name. assert_eq!(