Skip to content

Commit

Permalink
refactor: cleanup internal dependency references (#2976)
Browse files Browse the repository at this point in the history
## Description

- no more patching
- always use local path deps for workspace dependencies
- fix clippy complaints on rust `1.83`

## Breaking Changes

None

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [x] All breaking changes documented.
  • Loading branch information
dignifiedquire authored Nov 28, 2024
1 parent 73c9b75 commit fb20176
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 80 deletions.
59 changes: 19 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,3 @@ unexpected_cfgs = { level = "warn", check-cfg = ["cfg(iroh_docsrs)"] }

[workspace.lints.clippy]
unused-async = "warn"

# Temporary fix for dependencies
[patch.crates-io]
iroh = { path = "./iroh" }
iroh-base = { path = "./iroh-base" }
iroh-metrics = { path = "./iroh-metrics" }
iroh-test = { path = "./iroh-test" }
2 changes: 1 addition & 1 deletion iroh-base/src/relay_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl fmt::Debug for RelayUrl {
/// output.
struct DbgStr<'a>(&'a str);

impl<'a> fmt::Debug for DbgStr<'a> {
impl fmt::Debug for DbgStr<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, r#""{}""#, self.0)
}
Expand Down
6 changes: 3 additions & 3 deletions iroh-dns-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ governor = "0.6.3" #needs new release of tower_governor for 0.7.0
hickory-proto = "=0.25.0-alpha.2"
hickory-server = { version = "=0.25.0-alpha.2", features = ["dns-over-rustls"] }
http = "1.0.0"
iroh-metrics = { version = "0.28.0" }
iroh-metrics = { version = "0.28.0", path = "../iroh-metrics" }
lru = "0.12.3"
parking_lot = "0.12.1"
pkarr = { version = "2.2.0", features = [ "async", "relay", "dht"], default-features = false }
Expand Down Expand Up @@ -60,8 +60,8 @@ z32 = "1.1.1"

[dev-dependencies]
hickory-resolver = "=0.25.0-alpha.2"
iroh = { version = "0.28.0" }
iroh-test = "0.28.0"
iroh = { version = "0.28.0", path = "../iroh" }
iroh-test = { version = "0.28.0", path = "../iroh-test" }
pkarr = { version = "2.2.0", features = ["rand"] }

[package.metadata.docs.rs]
Expand Down
6 changes: 3 additions & 3 deletions iroh-net-report/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ derive_more = { version = "1.0.0", features = ["display"] }
futures-buffered = "0.2.8"
futures-lite = "2.3"
hickory-resolver = "=0.25.0-alpha.2"
iroh-base = { version = "0.28.0", default-features = false, features = ["relay"] }
iroh-metrics = { version = "0.28.0", default-features = false, optional = true }
iroh-base = { version = "0.28.0", path = "../iroh-base", default-features = false, features = ["relay"] }
iroh-metrics = { version = "0.28.0", path = "../iroh-metrics", default-features = false, optional = true }
iroh-relay = { version = "0.28", path = "../iroh-relay" }
netwatch = { version = "0.1.0", path = "../net-tools/netwatch" }
portmapper = { version = "0.1.0", path = "../net-tools/portmapper" }
Expand All @@ -39,7 +39,7 @@ url = { version = "2.4" }

[dev-dependencies]
iroh-relay = { version = "0.28", path = "../iroh-relay", features = ["test-utils", "server"] }
iroh-test = "0.28.0"
iroh-test = { version = "0.28.0", path = "../iroh-test" }
once_cell = "1.18.0"
pretty_assertions = "1.4"
testresult = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion iroh-node-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ workspace = true
anyhow = "1"
clap = { version = "4", features = ["derive"], optional = true }
tokio = "1"
iroh = { path = "../iroh" }
iroh = { version = "0.28.1", path = "../iroh" }
tempfile = "3"
strum = "0.26"
nested_enum_utils = "0.1.0"
Expand Down
9 changes: 3 additions & 6 deletions iroh-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ http = "1"
http-body-util = "0.1.0"
hyper = { version = "1", features = ["server", "client", "http1"] }
hyper-util = "0.1.1"
iroh-base = { version = "0.28.0", features = ["key"] }
iroh-metrics = { version = "0.28.0", default-features = false }
iroh-base = { version = "0.28.0", path = "../iroh-base", features = ["key"] }
iroh-metrics = { version = "0.28.0", path = "../iroh-metrics", default-features = false }
libc = "0.2.139"
num_enum = "0.7"
once_cell = "1.18.0"
Expand Down Expand Up @@ -110,12 +110,9 @@ tokio = { version = "1", features = [
"test-util",
] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
iroh-test = "0.28.0"
iroh-test = { version = "0.28.0", path = "../iroh-test" }
serde_json = "1"

[build-dependencies]
duct = "0.13.6"

[features]
default = ["metrics", "server"]
server = [
Expand Down
28 changes: 14 additions & 14 deletions iroh-relay/src/protos/relay.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
//! This module implements the relaying protocol used the [`crate::server`] and [`crate::client`].
//!
//! Protocol flow:
//!
//! Login:
//! * client connects
//! * -> client sends `FrameType::ClientInfo`
//!
//! Steady state:
//! * server occasionally sends `FrameType::KeepAlive` (or `FrameType::Ping`)
//! * client responds to any `FrameType::Ping` with a `FrameType::Pong`
//! * clients sends `FrameType::SendPacket`
//! * server then sends `FrameType::RecvPacket` to recipient
use std::time::Duration;

Expand Down Expand Up @@ -51,21 +63,9 @@ pub(crate) const PER_CLIENT_READ_QUEUE_DEPTH: usize = 512;
/// with nodes running earlier protocol versions.
pub(crate) const PROTOCOL_VERSION: usize = 3;

///
/// Protocol flow:
///
/// Login:
/// * client connects
/// * -> client sends FrameType::ClientInfo
///
/// Steady state:
/// * server occasionally sends FrameType::KeepAlive (or FrameType::Ping)
/// * client responds to any FrameType::Ping with a FrameType::Pong
/// * clients sends FrameType::SendPacket
/// * server then sends FrameType::RecvPacket to recipient
/// Indicates this IS the client's home node
const PREFERRED: u8 = 1u8;
/// indicates this is NOT the client's home node
/// Indicates this IS NOT the client's home node
const NOT_PREFERRED: u8 = 0u8;

/// The one byte frame type at the beginning of the frame
Expand Down
6 changes: 3 additions & 3 deletions iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ http-body-util = "0.1.0"
hyper = { version = "1", features = ["server", "client", "http1"] }
hyper-util = "0.1.1"
igd-next = { version = "0.15.1", features = ["aio_tokio"] }
iroh-base = { version = "0.28.0", features = ["key"] }
iroh-base = { version = "0.28.0", features = ["key"], path = "../iroh-base" }
iroh-relay = { version = "0.28", path = "../iroh-relay" }
libc = "0.2.139"
netdev = "0.31.0"
Expand Down Expand Up @@ -110,7 +110,7 @@ z32 = "1.0.3"
net-report = { package = "iroh-net-report", path = "../iroh-net-report", version = "0.28" }

# metrics
iroh-metrics = { version = "0.28.0", default-features = false }
iroh-metrics = { version = "0.28.0", path = "../iroh-metrics", default-features = false }
strum = { version = "0.26", features = ["derive"] }

# local-swarm-discovery
Expand Down Expand Up @@ -166,7 +166,7 @@ tokio = { version = "1", features = [
"test-util",
] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
iroh-test = "0.28.0"
iroh-test = { version = "0.28.0", path = "../iroh-test" }
serde_json = "1"
testresult = "0.4.0"
iroh-relay = { version = "0.28", path = "../iroh-relay", features = ["test-utils", "server"] }
Expand Down
2 changes: 1 addition & 1 deletion iroh/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ pub struct Accept<'a> {
ep: Endpoint,
}

impl<'a> Future for Accept<'a> {
impl Future for Accept<'_> {
type Output = Option<Incoming>;

fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> {
Expand Down
2 changes: 1 addition & 1 deletion net-tools/portmapper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ derive_more = { version = "1.0.0", features = ["debug", "display", "from", "try_
futures-lite = "2.5"
futures-util = "0.3.25"
igd-next = { version = "0.15.1", features = ["aio_tokio"] }
iroh-metrics = { version = "0.28.0", default-features = false }
iroh-metrics = { version = "0.28.0", path = "../../iroh-metrics", default-features = false }
libc = "0.2.139"
netwatch = { version = "0.1.0", path = "../netwatch" }
num_enum = "0.7"
Expand Down

0 comments on commit fb20176

Please sign in to comment.