diff --git a/api/migrations/next.md b/api/migrations/next.md new file mode 100644 index 0000000..3166806 --- /dev/null +++ b/api/migrations/next.md @@ -0,0 +1,41 @@ +# Migrating to the next rsLXST release (draft) + +This draft covers source changes since the current compatibility floor (commit +`1c03765`, LXST 0.6.0 signalling). rsLXST now runs on the rsReticulum release +that follows Reticulum 1.6.0. The release number belongs to the owner. + +## Telephony: outgoing call links + +LXST 0.6.0 opens the call with a plain `RNS.Link(call_destination, ...)` +(`LXST/Primitives/Telephony.py:840-842`). On Reticulum 1.6.0 that link request +carries a stamp at the link cost the destination announced +(`RNS/Link.py:363`). Generating that stamp is CPU work, so building the link +request is now async: + +| Old | New | +| --- | --- | +| `fn TelephonyRnsEndpoint::begin_outgoing_link_with_mode(..) -> Result` | `async fn`; add `.await` | +| `fn TelephonyRnsEndpoint::begin_outgoing_link_with_remote_pubkey(..) -> Result` | `async fn`; add `.await` | + +```rust +// old +let link_id = endpoint.begin_outgoing_link_with_mode(&mut core, identity, pubkey, profile, mode, hops)?; +// new +let link_id = endpoint.begin_outgoing_link_with_mode(&mut core, identity, pubkey, profile, mode, hops).await?; +``` + +To stamp off the caller's task, call +`prepare_outgoing_link_request(&transport_tx, identity, hops).await?` and pass +its `OutgoingLinkRequest` to the synchronous +`TelephonyRnsEndpoint::begin_prepared_outgoing_link`. + +`Error` gains `LinkStamp(rns_link::stamp::LinkStampError)`, so exhaustive +matches on `lxst_telephony::Error` need a new arm. + +## Behaviour an operator sees + +- The telephony destination announces through the stamped announce builder. + Calls stamp and check link requests according to the Reticulum `[stamps]` + settings, as upstream does. +- Call links signal the next hop's MTU when Reticulum's `link_mtu_discovery` + is on (`RNS/Link.py:392-397`). diff --git a/api/snapshots/lxst-telephony.txt b/api/snapshots/lxst-telephony.txt index 42eccf7..dbeab21 100644 --- a/api/snapshots/lxst-telephony.txt +++ b/api/snapshots/lxst-telephony.txt @@ -12,6 +12,7 @@ pub lxst_telephony::Error::LineBusy pub lxst_telephony::Error::LinkDestinationClosed pub lxst_telephony::Error::LinkOperation(alloc::string::String) pub lxst_telephony::Error::LinkProofInvalid(alloc::string::String) +pub lxst_telephony::Error::LinkStamp(rns_link::stamp::LinkStampError) pub lxst_telephony::Error::MediaProfileMismatch pub lxst_telephony::Error::MediaProfileMismatch::active: lxst_core::profile::Profile pub lxst_telephony::Error::MediaProfileMismatch::requested: lxst_core::profile::Profile @@ -262,6 +263,9 @@ impl lxst_telephony::CallerAccessPolicy pub fn lxst_telephony::CallerAccessPolicy::is_allowed(&self, &lxst_telephony::IdentityHash) -> bool impl core::default::Default for lxst_telephony::CallerAccessPolicy pub fn lxst_telephony::CallerAccessPolicy::default() -> Self +pub struct lxst_telephony::OutgoingLinkRequest +impl core::fmt::Debug for lxst_telephony::OutgoingLinkRequest +pub fn lxst_telephony::OutgoingLinkRequest::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub struct lxst_telephony::RemoteTelephonyPeer pub lxst_telephony::RemoteTelephonyPeer::destination_hash: [u8; 16] pub lxst_telephony::RemoteTelephonyPeer::hops: u8 @@ -281,8 +285,9 @@ impl lxst_telephony::TelephonyRnsEndpoint pub fn lxst_telephony::TelephonyRnsEndpoint::announce(&self) -> core::result::Result<(), lxst_telephony::Error> pub fn lxst_telephony::TelephonyRnsEndpoint::await_path_to_identity(&self, lxst_telephony::IdentityHash, core::time::Duration) -> impl core::future::future::Future> + core::marker::Send + 'static pub async fn lxst_telephony::TelephonyRnsEndpoint::begin_outgoing_link(&mut self, &mut lxst_telephony::TelephonyRuntimeCore, lxst_telephony::IdentityHash, core::option::Option, core::time::Duration) -> core::result::Result -pub fn lxst_telephony::TelephonyRnsEndpoint::begin_outgoing_link_with_mode(&mut self, &mut lxst_telephony::TelephonyRuntimeCore, lxst_telephony::IdentityHash, [u8; 64], core::option::Option, core::option::Option, u8) -> core::result::Result -pub fn lxst_telephony::TelephonyRnsEndpoint::begin_outgoing_link_with_remote_pubkey(&mut self, &mut lxst_telephony::TelephonyRuntimeCore, lxst_telephony::IdentityHash, [u8; 64], core::option::Option, u8) -> core::result::Result +pub async fn lxst_telephony::TelephonyRnsEndpoint::begin_outgoing_link_with_mode(&mut self, &mut lxst_telephony::TelephonyRuntimeCore, lxst_telephony::IdentityHash, [u8; 64], core::option::Option, core::option::Option, u8) -> core::result::Result +pub async fn lxst_telephony::TelephonyRnsEndpoint::begin_outgoing_link_with_remote_pubkey(&mut self, &mut lxst_telephony::TelephonyRuntimeCore, lxst_telephony::IdentityHash, [u8; 64], core::option::Option, u8) -> core::result::Result +pub fn lxst_telephony::TelephonyRnsEndpoint::begin_prepared_outgoing_link(&mut self, &mut lxst_telephony::TelephonyRuntimeCore, [u8; 64], core::option::Option, core::option::Option, lxst_telephony::OutgoingLinkRequest) -> core::result::Result pub fn lxst_telephony::TelephonyRnsEndpoint::deregister_destination(&self) -> core::result::Result<(), lxst_telephony::Error> pub fn lxst_telephony::TelephonyRnsEndpoint::deregister_link_destination(&self, lxst_telephony::LinkId) -> core::result::Result<(), lxst_telephony::Error> pub fn lxst_telephony::TelephonyRnsEndpoint::discover_remote_telephony_peer(&self, lxst_telephony::IdentityHash, core::time::Duration) -> impl core::future::future::Future> + core::marker::Send + 'static @@ -376,6 +381,7 @@ pub const lxst_telephony::TELEPHONY_STARTUP_ANNOUNCE_RETRIES: u8 pub const lxst_telephony::TELEPHONY_STARTUP_ANNOUNCE_RETRY_INTERVAL: core::time::Duration pub const lxst_telephony::TELEPHONY_WAIT_TIME: core::time::Duration pub fn lxst_telephony::execute_command_with_link(&tokio::sync::mpsc::bounded::Sender, &[u8; 64], &rns_identity::identity::Identity, &mut rns_link::link::Link, &lxst_telephony::TelephonyCommand) -> core::result::Result +pub async fn lxst_telephony::prepare_outgoing_link_request(&tokio::sync::mpsc::bounded::Sender, lxst_telephony::IdentityHash, u8) -> core::result::Result pub async fn lxst_telephony::request_answer(&tokio::sync::mpsc::bounded::Sender, lxst_telephony::LinkId) -> core::result::Result pub fn lxst_telephony::signalling_packet(lxst_core::wire::Signal) -> lxst_core::wire::LxstPacket pub fn lxst_telephony::signalling_packets_from_commands(&[lxst_telephony::TelephonyCommand]) -> alloc::vec::Vec<(lxst_telephony::LinkId, lxst_core::wire::LxstPacket)> diff --git a/api/stability.json b/api/stability.json index f096157..eff0ba5 100644 --- a/api/stability.json +++ b/api/stability.json @@ -60,8 +60,8 @@ "tier": "experimental", "compatibility": "reviewed-snapshot", "snapshot": "api/snapshots/lxst-telephony.txt", - "itemCount": 385, - "sha256": "1e7083b6302801c0d7f2417ff182e4dc559e1bf5a1ebde8638efaae26af62a24" + "itemCount": 391, + "sha256": "f36724579b879506b8cd4fd3e4378f9b594bf97f169764f1461dd64401679b7a" } ], "newPackages": []