mirror of
https://github.com/ratspeak/rsLXMF
synced 2026-11-22 23:10:35 +00:00
propagation: a node announces the LXMF version it follows
This commit is contained in:
1 parent
49728b0f4a
commit
caeb3ffd1b
5 files changed
+16
-5
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<String>,
|
||||
/// [`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<String>,
|
||||
/// Binary metadata entries, such as [`PN_META_NAME`].
|
||||
pub metadata: HashMap<u8, Vec<u8>>,
|
||||
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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!(
|
||||
|
||||
Reference in new issue
Block a user