diff --git a/Cargo.lock b/Cargo.lock index 481d0f891..4d172493c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1105,7 +1105,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "beacon" version = "0.1.0" -source = "git+https://github.com/helium/gateway-rs.git?branch=jg/temp-skf-proto-update#ff10a6f373d086a4711cb6487b403ad66f54f5d7" +source = "git+https://github.com/helium/gateway-rs.git?branch=main#6fee25879eb308f159cb5d4ead77e3806a0a9971" dependencies = [ "base64 0.21.0", "byteorder", @@ -2879,7 +2879,7 @@ dependencies = [ [[package]] name = "helium-proto" version = "0.1.0" -source = "git+https://github.com/helium/proto?branch=macpie/skf#28bf8b31f9806e0e1f387144c376430ad99f944f" +source = "git+https://github.com/helium/proto?branch=master#3061e06dff4f4a643dd9e2bf98bc24b462071de3" dependencies = [ "bytes", "prost", diff --git a/Cargo.toml b/Cargo.toml index 2f28b82ba..ee5fd89e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,14 +55,14 @@ sqlx = {version = "0", features = [ ]} helium-crypto = {version = "0.6.8", features=["sqlx-postgres", "multisig"]} -helium-proto = {git = "https://github.com/helium/proto", branch = "macpie/skf", features = ["services"]} +helium-proto = {git = "https://github.com/helium/proto", branch = "master", features = ["services"]} hextree = "*" solana-client = "1.14" solana-sdk = "1.14" solana-program = "1.11" spl-token = "3.5.0" reqwest = {version = "0", default-features=false, features = ["gzip", "json", "rustls-tls"]} -beacon = {git = "https://github.com/helium/gateway-rs.git", branch = "jg/temp-skf-proto-update"} +beacon = {git = "https://github.com/helium/gateway-rs.git", branch = "main"} humantime = "2" metrics = "0" metrics-exporter-prometheus = "0" diff --git a/iot_config/src/main.rs b/iot_config/src/main.rs index 4543a532d..dc2d2623a 100644 --- a/iot_config/src/main.rs +++ b/iot_config/src/main.rs @@ -114,6 +114,12 @@ impl Daemon { region_updater, )?; + let pubkey = settings + .signing_keypair() + .map(|keypair| keypair.public_key().to_string())?; + tracing::debug!("listening on {listen_addr}"); + tracing::debug!("signing as {pubkey}"); + let server = transport::Server::builder() .http2_keepalive_interval(Some(Duration::from_secs(250))) .http2_keepalive_timeout(Some(Duration::from_secs(60))) diff --git a/iot_config/src/route.rs b/iot_config/src/route.rs index f2ca77e83..c1bcbb115 100644 --- a/iot_config/src/route.rs +++ b/iot_config/src/route.rs @@ -141,15 +141,15 @@ pub async fn create_route( signer, signature: vec![], }; - signing_key + _ = signing_key .sign(&update.encode_to_vec()) - .map_err(|err| anyhow!(format!("error signing route stream response: {err:?}"))) + .map_err(|err| tracing::error!("error signing route stream response: {err:?}")) .and_then(|signature| { update.signature = signature; update_tx.send(update).map_err(|err| { - anyhow!(format!("error broadcasting route stream response: {err:?}")) + tracing::warn!("error broadcasting route stream response: {err:?}") }) - })?; + }); }; Ok(new_route) @@ -206,12 +206,12 @@ pub async fn update_route( _ = signing_key .sign(&update_res.encode_to_vec()) - .map_err(|err| anyhow!(format!("error signing route stream response: {err:?}"))) + .map_err(|err| tracing::error!("error signing route stream response: {err:?}")) .and_then(|signature| { update_res.signature = signature; - update_tx.send(update_res).map_err(|err| { - anyhow!(format!("error broadcasting route stream response: {err:?}")) - }) + update_tx + .send(update_res) + .map_err(|err| tracing::warn!("error broadcasting route stream response: {err:?}")) }); Ok(updated_route) diff --git a/iot_config/src/route_service.rs b/iot_config/src/route_service.rs index 127ed517d..a1e5ada1a 100644 --- a/iot_config/src/route_service.rs +++ b/iot_config/src/route_service.rs @@ -155,10 +155,15 @@ impl RouteService { .await; for update in updates { - if !ranges.iter().any(|range| range.contains_addr(update.devaddr.into())) { + let devaddr = update.devaddr.into(); + if !ranges.iter().any(|range| range.contains_addr(devaddr)) { + let ranges = ranges + .iter() + .map(|r| format!("{} -- {}", r.start_addr, r.end_addr)) + .collect::>() + .join(", "); return Err(Status::invalid_argument(format!( - "devaddr {} not within registered ranges for route {}", - update.devaddr, route_id + "devaddr {devaddr} not within registered ranges for route {route_id} :: {ranges}" ))); } } @@ -890,7 +895,7 @@ struct DevAddrEuiValidator { #[derive(thiserror::Error, Debug)] enum DevAddrEuiValidationError { - #[error("devaddr or range outside of bounds {0}")] + #[error("devaddr range outside of constraint bounds {0}")] DevAddrOutOfBounds(String), #[error("no route for update {0}")] NoRouteId(String),