From a1fa38018e0160484cfe1152b13a653e503d43b5 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Sun, 15 Feb 2026 13:51:02 +0100 Subject: [PATCH] protocol: Depend on `cypheraddr` not `cyphernet` `radicle-protocol` depends on `cyphernet`, but only uses the module `cyphernet::addr`, which is a re-export of `cypheraddr`, which is unnecessary (as `cypheraddr` alone would do), and invites accidentally pulling in more dependencies via `cyphernet`. To prevent accidentally depending on further types from `cyphernet`, change this to more conservativeley depend on `cypheraddr`. --- Cargo.lock | 3 ++- Cargo.toml | 1 + crates/radicle-protocol/Cargo.toml | 2 +- crates/radicle-protocol/src/wire.rs | 4 ++-- crates/radicle-protocol/src/wire/message.rs | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42d1d378..4b4f214e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -679,6 +679,7 @@ dependencies = [ "amplify", "base32", "cyphergraphy", + "serde", "sha3", ] @@ -3083,7 +3084,7 @@ dependencies = [ "bloomy", "bytes", "crossbeam-channel", - "cyphernet", + "cypheraddr", "fastrand", "log", "nonempty", diff --git a/Cargo.toml b/Cargo.toml index 0946af70..bc66135a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ bytes = "1.11.1" chrono = { version = "0.4.26", default-features = false } colored = "2.1.0" crossbeam-channel = "0.5.6" +cypheraddr = "0.4.0" cyphernet = "0.5.2" dunce = "1.0.5" fastrand = { version = "2.0.0", default-features = false } diff --git a/crates/radicle-protocol/Cargo.toml b/crates/radicle-protocol/Cargo.toml index 561a7b77..5435aae6 100644 --- a/crates/radicle-protocol/Cargo.toml +++ b/crates/radicle-protocol/Cargo.toml @@ -15,7 +15,7 @@ test = ["radicle/test", "radicle-crypto/test", "radicle-crypto/cyphernet", "qche bloomy = "1.2" bytes = { workspace = true } crossbeam-channel = { workspace = true } -cyphernet = { workspace = true, features = ["tor"] } +cypheraddr = { workspace = true, features = ["serde", "tor"] } fastrand = { workspace = true } log = { workspace = true, features = ["std"] } nonempty = { workspace = true, features = ["serialize"] } diff --git a/crates/radicle-protocol/src/wire.rs b/crates/radicle-protocol/src/wire.rs index 9f949536..591e9a86 100644 --- a/crates/radicle-protocol/src/wire.rs +++ b/crates/radicle-protocol/src/wire.rs @@ -15,7 +15,7 @@ use std::string::FromUtf8Error; use bytes::{Buf, BufMut}; -use cyphernet::addr::tor; +use cypheraddr::tor; use radicle::crypto::{PublicKey, Signature, Unverified}; use radicle::git; @@ -257,7 +257,7 @@ impl Encode for Refs { } } -impl Encode for cyphernet::addr::tor::OnionAddrV3 { +impl Encode for cypheraddr::tor::OnionAddrV3 { fn encode(&self, buf: &mut impl BufMut) { self.into_raw_bytes().encode(buf) } diff --git a/crates/radicle-protocol/src/wire/message.rs b/crates/radicle-protocol/src/wire/message.rs index 7d3bb985..62e22c61 100644 --- a/crates/radicle-protocol/src/wire/message.rs +++ b/crates/radicle-protocol/src/wire/message.rs @@ -2,7 +2,7 @@ use std::{mem, net}; use bytes::Buf; use bytes::BufMut; -use cyphernet::addr::{tor, HostName, NetAddr}; +use cypheraddr::{tor, HostName, NetAddr}; use radicle::crypto::Signature; use radicle::git::Oid; use radicle::identity::RepoId;