Merge branch 'veilidchat-work' into 'main'

0.1.4

See merge request veilid/veilid!90
This commit is contained in:
Christien Rioux 2023-07-20 01:17:17 +00:00
commit 57b5de0639
13 changed files with 70 additions and 33 deletions

View File

@ -1,5 +1,5 @@
[bumpversion] [bumpversion]
current_version = 0.1.3 current_version = 0.1.4
[bumpversion:file:veilid-server/Cargo.toml] [bumpversion:file:veilid-server/Cargo.toml]
search = name = "veilid-server" search = name = "veilid-server"

24
Cargo.lock generated
View File

@ -4380,9 +4380,9 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.171" version = "1.0.173"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" checksum = "e91f70896d6720bc714a4a57d22fc91f1db634680e65c8efe13323f1fa38d53f"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
@ -4408,9 +4408,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.171" version = "1.0.173"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" checksum = "a6250dde8342e0232232be9ca3db7aa40aceb5a3e5dd9bddbc00d99a007cde49"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -5627,7 +5627,7 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "veilid-cli" name = "veilid-cli"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"arboard", "arboard",
"async-std", "async-std",
@ -5663,7 +5663,7 @@ dependencies = [
[[package]] [[package]]
name = "veilid-core" name = "veilid-core"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"argon2", "argon2",
"async-io", "async-io",
@ -5766,7 +5766,7 @@ dependencies = [
[[package]] [[package]]
name = "veilid-flutter" name = "veilid-flutter"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"allo-isolate", "allo-isolate",
"async-std", "async-std",
@ -5795,7 +5795,7 @@ dependencies = [
[[package]] [[package]]
name = "veilid-server" name = "veilid-server"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"ansi_term", "ansi_term",
"async-std", "async-std",
@ -5845,7 +5845,7 @@ dependencies = [
[[package]] [[package]]
name = "veilid-tools" name = "veilid-tools"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"android-logd-logger", "android-logd-logger",
"async-lock", "async-lock",
@ -5896,7 +5896,7 @@ dependencies = [
[[package]] [[package]]
name = "veilid-wasm" name = "veilid-wasm"
version = "0.1.3" version = "0.1.4"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"console_error_panic_hook", "console_error_panic_hook",
@ -6515,9 +6515,9 @@ checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a"
[[package]] [[package]]
name = "xml-rs" name = "xml-rs"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a56c84a8ccd4258aed21c92f70c0f6dea75356b6892ae27c24139da456f9336" checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1"
[[package]] [[package]]
name = "xmltree" name = "xmltree"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "veilid-cli" name = "veilid-cli"
version = "0.1.3" version = "0.1.4"
authors = ["Veilid Team <contact@veilid.com>"] authors = ["Veilid Team <contact@veilid.com>"]
edition = "2021" edition = "2021"
license = "MPL-2.0" license = "MPL-2.0"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "veilid-core" name = "veilid-core"
version = "0.1.3" version = "0.1.4"
authors = ["Veilid Team <contact@veilid.com>"] authors = ["Veilid Team <contact@veilid.com>"]
edition = "2021" edition = "2021"
build = "build.rs" build = "build.rs"

View File

@ -1046,11 +1046,17 @@ impl NetworkManager {
}; };
if let Some(relay_nr) = some_relay_nr { if let Some(relay_nr) = some_relay_nr {
// Ensure the protocol is forwarded exactly as is // Ensure the protocol used to forward is of the same sequencing requirement
// Address type is allowed to change if connectivity is better // Address type is allowed to change if connectivity is better
let relay_nr = relay_nr.filtered_clone( let relay_nr = if connection_descriptor.protocol_type().is_ordered() {
NodeRefFilter::new().with_protocol_type(connection_descriptor.protocol_type()), // XXX: this is a little redundant
); let (_, nrf) = NodeRefFilter::new().with_sequencing(Sequencing::EnsureOrdered);
let mut relay_nr = relay_nr.filtered_clone(nrf);
relay_nr.set_sequencing(Sequencing::EnsureOrdered);
relay_nr
} else {
relay_nr
};
// Relay the packet to the desired destination // Relay the packet to the desired destination
log_net!("relaying {} bytes to {}", data.len(), relay_nr); log_net!("relaying {} bytes to {}", data.len(), relay_nr);

View File

@ -103,7 +103,7 @@ impl NetworkManager {
target_node_ref: NodeRef, target_node_ref: NodeRef,
data: Vec<u8>, data: Vec<u8>,
) -> EyreResult<NetworkResult<SendDataKind>> { ) -> EyreResult<NetworkResult<SendDataKind>> {
// First try to send data to the last socket we've seen this peer on // First try to send data to the last connection we've seen this peer on
let Some(connection_descriptor) = target_node_ref.last_connection() else { let Some(connection_descriptor) = target_node_ref.last_connection() else {
return Ok(NetworkResult::no_connection_other( return Ok(NetworkResult::no_connection_other(
format!("should have found an existing connection: {}", target_node_ref) format!("should have found an existing connection: {}", target_node_ref)
@ -149,7 +149,7 @@ impl NetworkManager {
.is_some() .is_some()
{ {
return Ok(NetworkResult::no_connection_other( return Ok(NetworkResult::no_connection_other(
format!("failed to send to existing connection: {:?}", connection_descriptor) format!("failed to send to unreachable node over existing connection: {:?}", connection_descriptor)
)); ));
} }

View File

@ -43,12 +43,24 @@ impl RoutingTable {
.set_relay_node_keepalive(Some(cur_ts)) .set_relay_node_keepalive(Some(cur_ts))
.commit(); .commit();
// We need to keep-alive at one connection per ordering for relays
// but also one per NAT mapping that we need to keep open for our inbound dial info
let mut got_unordered = false;
let mut got_ordered = false;
// Look up any NAT mappings we may need to try to preserve with keepalives // Look up any NAT mappings we may need to try to preserve with keepalives
let mut mapped_port_info = self.get_low_level_port_info(); let mut mapped_port_info = self.get_low_level_port_info();
// Relay nodes get pinged over all protocols we have inbound dialinfo for // Relay nodes get pinged over all protocols we have inbound dialinfo for
// This is so we can preserve the inbound NAT mappings at our router // This is so we can preserve the inbound NAT mappings at our router
let mut relay_noderefs = vec![];
for did in &dids { for did in &dids {
// Can skip the ones that are direct, those are not mapped or natted
// because we can have both direct and natted dialinfo on the same
// node, for example ipv4 can be natted, while ipv6 is direct
if did.class == DialInfoClass::Direct {
continue;
}
// Do we need to do this ping? // Do we need to do this ping?
// Check if we have already pinged over this low-level-protocol/address-type/port combo // Check if we have already pinged over this low-level-protocol/address-type/port combo
// We want to ensure we do the bare minimum required here // We want to ensure we do the bare minimum required here
@ -62,16 +74,35 @@ impl RoutingTable {
} else { } else {
false false
}; };
if !needs_ping_for_protocol { if needs_ping_for_protocol {
continue; if pt.is_ordered() {
got_ordered = true;
} else {
got_unordered = true;
}
let dif = did.dial_info.make_filter();
let relay_nr_filtered =
relay_nr.filtered_clone(NodeRefFilter::new().with_dial_info_filter(dif));
relay_noderefs.push(relay_nr_filtered);
} }
}
// Add noderef filters for ordered or unordered sequencing if we havent already seen those
if !got_ordered {
let (_, nrf) = NodeRefFilter::new().with_sequencing(Sequencing::EnsureOrdered);
let mut relay_nr_filtered = relay_nr.filtered_clone(nrf);
relay_nr_filtered.set_sequencing(Sequencing::EnsureOrdered);
relay_noderefs.push(relay_nr_filtered);
}
if !got_unordered {
relay_noderefs.push(relay_nr);
}
for relay_nr_filtered in relay_noderefs {
let rpc = rpc.clone(); let rpc = rpc.clone();
let dif = did.dial_info.make_filter();
let relay_nr_filtered =
relay_nr.filtered_clone(NodeRefFilter::new().with_dial_info_filter(dif));
//#[cfg(feature = "network-result-extra")] #[cfg(feature = "network-result-extra")]
log_rtab!(debug "--> Keepalive ping to {:?}", relay_nr_filtered);
#[cfg(not(feature = "network-result-extra"))]
log_rtab!("--> Keepalive ping to {:?}", relay_nr_filtered); log_rtab!("--> Keepalive ping to {:?}", relay_nr_filtered);
unord.push( unord.push(

View File

@ -1,5 +1,5 @@
name: veilid name: veilid
version: 0.1.3 version: 0.1.4
description: Veilid Framework description: Veilid Framework
homepage: https://veilid.com homepage: https://veilid.com
publish_to: "none" # Remove this line if you wish to publish to pub.dev publish_to: "none" # Remove this line if you wish to publish to pub.dev

View File

@ -1,6 +1,6 @@
[package] [package]
name = "veilid-flutter" name = "veilid-flutter"
version = "0.1.3" version = "0.1.4"
authors = ["Veilid Team <contact@veilid.com>"] authors = ["Veilid Team <contact@veilid.com>"]
license = "MPL-2.0" license = "MPL-2.0"
edition = "2021" edition = "2021"

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "veilid" name = "veilid"
version = "0.1.3" version = "0.1.4"
description = "" description = ""
authors = ["Veilid Team <contact@veilid.com>"] authors = ["Veilid Team <contact@veilid.com>"]
readme = "README.md" readme = "README.md"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "veilid-server" name = "veilid-server"
version = "0.1.3" version = "0.1.4"
authors = ["Veilid Team <contact@veilid.com>"] authors = ["Veilid Team <contact@veilid.com>"]
license = "MPL-2.0" license = "MPL-2.0"
edition = "2021" edition = "2021"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "veilid-tools" name = "veilid-tools"
version = "0.1.3" version = "0.1.4"
authors = ["Veilid Team <contact@veilid.com>"] authors = ["Veilid Team <contact@veilid.com>"]
license = "MPL-2.0" license = "MPL-2.0"
edition = "2021" edition = "2021"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "veilid-wasm" name = "veilid-wasm"
version = "0.1.3" version = "0.1.4"
authors = ["Veilid Team <contact@veilid.com>"] authors = ["Veilid Team <contact@veilid.com>"]
license = "MPL-2.0" license = "MPL-2.0"
edition = "2021" edition = "2021"