Skip to content

Commit 0e613d8

Browse files
ramfox“ramfox”Frando
authored
chore: upgrade to iroh at 0.90.0 and irpc at 0.5.0 (#80)
* chore: upgrade to `iroh` at `0.90.0` and `irpc` at `0.5.0` * chore: fmt * update deny * tests: fix die_and_reconnect test --------- Co-authored-by: “ramfox” <“kasey@n0.computer”> Co-authored-by: Frando <frando@unbiskant.org>
1 parent 07b7b77 commit 0e613d8

5 files changed

Lines changed: 75 additions & 84 deletions

File tree

Cargo.lock

Lines changed: 58 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ derive_more = { version = "1.0.0", features = [
4747
ed25519-dalek = { version = "2.0.0", features = ["serde", "rand_core"] }
4848
hex = "0.4.3"
4949
indexmap = "2.0"
50-
iroh-metrics = { version = "0.34", default-features = false }
51-
iroh-base = { git = "https://github.com/n0-computer/iroh", branch = "main", default-features = false, features = [
50+
iroh-metrics = { version = "0.35", default-features = false }
51+
iroh-base = { version = "0.90", default-features = false, features = [
5252
"key",
5353
] }
5454
n0-future = "0.1.2"
@@ -65,12 +65,12 @@ serde = { version = "1.0.164", features = ["derive"] }
6565
futures-lite = { version = "2.3", optional = true }
6666
futures-concurrency = { version = "7.6.1", optional = true }
6767
futures-util = { version = "0.3.30", optional = true }
68-
iroh = { git = "https://github.com/n0-computer/iroh", branch = "main", default-features = false, optional = true }
68+
iroh = { version = "0.90", default-features = false, optional = true }
6969
tokio = { version = "1", optional = true, features = ["io-util", "sync"] }
7070
tokio-util = { version = "0.7.12", optional = true, features = ["codec"] }
7171
tracing = "0.1"
7272
thiserror = { version = "2.0", optional = true }
73-
irpc = { version = "0.4.0", optional = true, default-features = false, features = [
73+
irpc = { version = "0.5.0", optional = true, default-features = false, features = [
7474
"derive",
7575
"stream",
7676
"message_spans",
@@ -81,7 +81,7 @@ nested_enum_utils = { version = "0.2.2", optional = true }
8181
snafu = { version = "0.8.5", features = ["rust_1_81"], optional = true }
8282

8383
# rpc dependencies (optional)
84-
quinn = { package = "iroh-quinn", version = "0.13.0", optional = true }
84+
quinn = { package = "iroh-quinn", version = "0.14.0", optional = true }
8585

8686
# test-utils dependencies (optional)
8787
rand_chacha = { version = "0.3.1", optional = true }
@@ -109,7 +109,7 @@ tokio = { version = "1", features = [
109109
] }
110110
clap = { version = "4", features = ["derive"] }
111111
humantime-serde = { version = "1.1.1" }
112-
iroh = { git = "https://github.com/n0-computer/iroh", branch = "main", default-features = false, features = [
112+
iroh = { version = "0.90", default-features = false, features = [
113113
"metrics",
114114
"test-utils",
115115
] }

deny.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ignore = [
33
"RUSTSEC-2024-0384",
44
"RUSTSEC-2024-0436",
5+
"RUSTSEC-2023-0089",
56
]
67

78
[bans]
@@ -37,6 +38,3 @@ name = "ring"
3738
[[licenses.clarify.license-files]]
3839
hash = 3171872035
3940
path = "LICENSE"
40-
41-
[sources]
42-
allow-git = ["https://github.com/n0-computer/iroh.git"]

examples/chat.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ async fn main() -> Result<()> {
9393
None => SecretKey::generate(rand::rngs::OsRng),
9494
Some(key) => key.parse()?,
9595
};
96-
println!("> our secret key: {secret_key}");
96+
println!(
97+
"> our secret key: {}",
98+
data_encoding::HEXLOWER.encode(&secret_key.to_bytes())
99+
);
97100

98101
// configure our relay map
99102
let relay_mode = match (args.no_relay, args.relay) {

src/net.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ pub(crate) mod test {
15951595
.bind()
15961596
.await?;
15971597
let gossip = Gossip::builder().spawn(ep.clone());
1598-
let router = Router::builder(ep.clone())
1598+
let router = Router::builder(ep)
15991599
.accept(GOSSIP_ALPN, gossip.clone())
16001600
.spawn();
16011601
Ok((router, gossip))
@@ -1632,6 +1632,11 @@ pub(crate) mod test {
16321632
let secret_key = SecretKey::generate(&mut rng);
16331633
async move {
16341634
let (router, gossip) = spawn_gossip(secret_key, relay_map).await?;
1635+
// wait for the relay to be set. iroh currently has issues when trying
1636+
// to immediately reconnect with changed direct addresses, but when the
1637+
// relay path is available it works.
1638+
// See https://github.com/n0-computer/iroh/pull/3372
1639+
router.endpoint().home_relay().initialized().await?;
16351640
let addr = router.endpoint().node_addr().initialized().await?;
16361641
info!(node_id = %addr.node_id.fmt_short(), "recv node spawned");
16371642
addr_tx.send(addr).unwrap();

0 commit comments

Comments
 (0)