Skip to content

Commit d6bc83f

Browse files
ramfox“ramfox”
and
“ramfox”
authored
feat(iroh): move iroh-net-report back into iroh (#3251)
## Description Move `iroh-net-report` back into `iroh` Only the follow are made public from the old `iroh-net-report` (now `iroh::net_report`): - `iroh::net_report::Metrics` - `iroh::net_report::Options` - `iroh::net_report::Addr` - `iroh::net_report::Client` - `iroh::net_report::Report` - `iroh::net_report::bind_local_stun_addr` - `iroh::net_report::RelayLatencies` - `iroh::net_report::QuicConfig` ## Breaking Changes Technically not a breaking change to `iroh` since we are "adding" to the API, but we will no longer be publishing `iroh-net-report` to crates.io, and to use the content from `iroh-net-report` you would need to depend on `iroh` and import it using `iroh::net_report`. This should only effect `iroh-doctor` ## Notes & open questions Would be nice to make this private, if we can adjust `iroh-doctor` accordingly. For the next release, I'll make a branch that has the old `iroh-net-report`, adds the deprecation status to the readme/cargo.toml & publishes. ## Change checklist <!-- Remove any that are not relevant. --> - [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. - [x] Tests if relevant. - [x] All breaking changes documented. --------- Co-authored-by: “ramfox” <“[email protected]”>
1 parent 42b605e commit d6bc83f

22 files changed

+44
-260
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ jobs:
180180
- name: wasm32 build (iroh-relay)
181181
run: cargo build --target wasm32-unknown-unknown -p iroh-relay --no-default-features
182182

183-
- name: wasm32 build (iroh-net-report)
184-
run: cargo build --target wasm32-unknown-unknown -p iroh-net-report --no-default-features
185-
186183
- name: wasm32 build (iroh)
187184
run: cargo build --target wasm32-unknown-unknown -p iroh --no-default-features
188185

@@ -192,10 +189,6 @@ jobs:
192189
run: |
193190
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh_relay.wasm | grep 'import "env"'
194191
195-
- name: Ensure no 'import "env"' in iroh-net-report Wasm
196-
run: |
197-
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh_net_report.wasm | grep 'import "env"'
198-
199192
- name: Ensure no 'import "env"' in iroh Wasm
200193
run: |
201194
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh.wasm | grep 'import "env"'

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
RUSTFLAGS: -Dwarnings
2424
RUSTDOCFLAGS: -Dwarnings
2525
SCCACHE_CACHE_SIZE: "10G"
26-
CRATES_LIST: "iroh,iroh-bench,iroh-dns-server,iroh-relay,iroh-net-report"
26+
CRATES_LIST: "iroh,iroh-bench,iroh-dns-server,iroh-relay"
2727
IROH_FORCE_STAGING_RELAYS: "1"
2828

2929
jobs:

Cargo.lock

Lines changed: 1 addition & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ members = [
55
"iroh",
66
"iroh/bench",
77
"iroh-relay",
8-
"iroh-net-report",
98
]
109
resolver = "2"
1110

iroh-net-report/Cargo.toml

Lines changed: 0 additions & 67 deletions
This file was deleted.

iroh-net-report/LICENSE-BSD3

Lines changed: 0 additions & 30 deletions
This file was deleted.

iroh-net-report/README.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

iroh-net-report/build.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

iroh/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ rand = "0.8"
5656
rcgen = "0.13"
5757
reqwest = { version = "0.12", default-features = false, features = [
5858
"rustls-tls",
59+
"stream",
5960
] }
6061
ring = "0.17"
6162
rustls = { version = "0.23", default-features = false, features = ["ring"] }
@@ -78,7 +79,6 @@ webpki = { package = "rustls-webpki", version = "0.102" }
7879
webpki-roots = "0.26"
7980
x509-parser = "0.16"
8081
z32 = "1.0.3"
81-
net-report = { package = "iroh-net-report", path = "../iroh-net-report", version = "0.34", default-features = false }
8282

8383
# metrics
8484
iroh-metrics = { version = "0.32", default-features = false }
@@ -116,6 +116,7 @@ tokio = { version = "1", features = [
116116
"signal",
117117
"process",
118118
] }
119+
surge-ping = "0.8.0"
119120

120121
# wasm-in-browser dependencies
121122
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
@@ -160,7 +161,7 @@ cfg_aliases = { version = "0.2" }
160161

161162
[features]
162163
default = ["metrics"]
163-
metrics = ["iroh-metrics/metrics", "iroh-relay/metrics", "net-report/metrics", "portmapper/metrics"]
164+
metrics = ["iroh-metrics/metrics", "iroh-relay/metrics", "portmapper/metrics"]
164165
test-utils = ["iroh-relay/test-utils", "iroh-relay/server", "dep:axum"]
165166
discovery-local-network = ["dep:swarm-discovery"]
166167
discovery-pkarr-dht = ["pkarr/dht"]

iroh/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ pub mod discovery;
249249
pub mod dns;
250250
pub mod endpoint;
251251
pub mod metrics;
252+
pub mod net_report;
252253
pub mod protocol;
253254
pub mod watchable;
254255

iroh/src/magicsock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ use n0_future::{
4242
time::{self, Duration, Instant},
4343
FutureExt, StreamExt,
4444
};
45-
use net_report::IpMappedAddresses;
46-
#[cfg(not(wasm_browser))]
47-
use net_report::{IpMappedAddr, QuicConfig};
4845
use netwatch::{interfaces, netmon};
4946
#[cfg(not(wasm_browser))]
5047
use netwatch::{ip::LocalAddresses, UdpSocket};
@@ -71,11 +68,14 @@ use self::{
7168
use crate::dns::DnsResolver;
7269
#[cfg(any(test, feature = "test-utils"))]
7370
use crate::endpoint::PathSelection;
71+
#[cfg(not(wasm_browser))]
72+
use crate::net_report::{IpMappedAddr, QuicConfig};
7473
use crate::{
7574
defaults::timeouts::NET_REPORT_TIMEOUT,
7675
disco::{self, CallMeMaybe, SendAddr},
7776
discovery::{Discovery, DiscoveryItem, DiscoverySubscribers, NodeData, UserData},
7877
key::{public_ed_box, secret_ed_box, DecryptionError, SharedSecret},
78+
net_report::{self, IpMappedAddresses},
7979
watchable::{Watchable, Watcher},
8080
};
8181

iroh/src/metrics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//! Co-locating all of the iroh metrics structs
22
#[cfg(feature = "test-utils")]
33
pub use iroh_relay::server::Metrics as RelayMetrics;
4-
pub use net_report::Metrics as NetReportMetrics;
54
#[cfg(not(wasm_browser))]
65
pub use portmapper::Metrics as PortmapMetrics;
76

8-
pub use crate::magicsock::Metrics as MagicsockMetrics;
7+
pub use crate::{magicsock::Metrics as MagicsockMetrics, net_report::Metrics as NetReportMetrics};

0 commit comments

Comments
 (0)