Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: n0-computer/iroh
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4a840514b6372ed83a0317662ade739480ddc38f
Choose a base ref
..
head repository: n0-computer/iroh
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5191a9ce33aa145aa6d3a0dbec3e8cc9b39074f6
Choose a head ref
19 changes: 0 additions & 19 deletions .github/workflows/project.yaml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/project_sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Add PRs and Issues to the Project Board

on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:

env:
REPOS_LIST: "iroh tools n0.computer ops iroh.computer quic-rpc chuck abao bao-tree iroh-examples iroh.network tokio-rustls-acme iroh-ffi iroh-car iroh-io iroh-blake3 dumbpipe.dev dumbpipe sendme swarmie iroh-c-ffi willow-store quinn iroh-experiments willow-rs iroh-gossip iroh-doctor iroh-blobs iroh-docs iroh-s3 iroh-doctor-server iroh-willow iroh-metrics net-tools iroh-node-util workflows ips"

jobs:
add-to-project:
name: Add to project board
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.N0_BOT_APP_ID }}
private-key: ${{ secrets.PROJECT_BOARD_PKEY }}
owner: n0-computer

- name: Update PRs
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
for REPO in $REPOS_LIST; do
echo "Processing repository: $REPO"
gh pr list --repo n0-computer/$REPO --state open --json number,projectItems | jq -r '.[] | select(.projectItems | length == 0) | .number' > pr_list.txt
while read -r PR_NUMBER; do
echo "Processing PR #$PR_NUMBER"
gh pr edit "$PR_NUMBER" --repo n0-computer/$REPO --add-project iroh
done < pr_list.txt
done
- name: Update ISSUEs
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
for REPO in $REPOS_LIST; do
gh issue list --repo n0-computer/$REPO --state open --json number,projectItems | jq -r '.[] | select(.projectItems | length == 0) | .number' > issue_list.txt
while read -r ISSUE_NUMBER; do
echo "Processing Issue #$ISSUE_NUMBER"
gh issue edit "$ISSUE_NUMBER" --repo n0-computer/$REPO --add-project iroh
done < issue_list.txt
done
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -40,12 +40,12 @@ To ensure these connections are as fast as possible, we [continuously measure ir
### Built on [QUIC]

Iroh uses [Quinn] to establish [QUIC] connections between nodes.
This way you get authenticated encryption, concurrent streams with stream prioirities, a datagram transport and avoid head-of-line-blocking out of the box.
This way you get authenticated encryption, concurrent streams with stream priorities, a datagram transport and avoid head-of-line-blocking out of the box.

## Compose Protocols

Use pre-existing protocols built on iroh instead of writing your own:
- [iroh-blobs] for [BLAKE3]-based content-addressed blob transfer scaling from kilobytes to terrabytes
- [iroh-blobs] for [BLAKE3]-based content-addressed blob transfer scaling from kilobytes to terabytes
- [iroh-gossip] for establishing publish-subscribe overlay networks that scale, requiring only resources that your average phone can handle
- [iroh-docs] for an eventually-consistent key-value store of [iroh-blobs] blobs
- [iroh-willow] for an (in-construction) implementation of the [willow protocol]
@@ -166,6 +166,6 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
[iroh-yt-video]: https://www.youtube.com/watch?v=RwAt36Xe3UI_
[Iroh Examples]: https://github.com/n0-computer/iroh-examples
[Iroh Experiments]: https://github.com/n0-computer/iroh-experiments
[echo-rs]: /iroh-router/examples/echo.rs
[echo-rs]: /iroh/examples/echo.rs
[iroh-perf]: https://perf.iroh.computer
[docs]: https://iroh.computer/docs
13 changes: 12 additions & 1 deletion iroh-base/src/key.rs
Original file line number Diff line number Diff line change
@@ -330,7 +330,12 @@ fn decode_base32_hex(s: &str) -> Result<[u8; 32], KeyParsingError> {
// hex
data_encoding::HEXLOWER.decode_mut(s.as_bytes(), &mut bytes)
} else {
data_encoding::BASE32_NOPAD.decode_mut(s.to_ascii_uppercase().as_bytes(), &mut bytes)
let input = s.to_ascii_uppercase();
let input = input.as_bytes();
if data_encoding::BASE32_NOPAD.decode_len(input.len())? != bytes.len() {
return Err(KeyParsingError::DecodeInvalidLength);
}
data_encoding::BASE32_NOPAD.decode_mut(input, &mut bytes)
};
match res {
Ok(len) => {
@@ -390,4 +395,10 @@ mod tests {
key.public()
);
}

#[test]
fn test_regression_parse_node_id_panic() {
let not_a_node_id = "foobarbaz";
assert!(PublicKey::from_str(not_a_node_id).is_err());
}
}
12 changes: 6 additions & 6 deletions iroh-net-report/src/reportgen/probes.rs
Original file line number Diff line number Diff line change
@@ -291,13 +291,13 @@ impl ProbePlan {
node: relay_node.clone(),
})
.expect("adding StunIpv6 probe to a StunIpv6 probe set");
quic_ipv6_probes
.push(Probe::QuicIpv6 {
delay,
node: relay_node.clone(),
})
.expect("adding QuicIpv6 probe to a QuicAddrIpv6 probe set");
}
quic_ipv6_probes
.push(Probe::QuicIpv6 {
delay,
node: relay_node.clone(),
})
.expect("adding QuicIpv6 probe to a QuicAddrIpv6 probe set");
}
plan.add_if_enabled(stun_ipv4_probes);
plan.add_if_enabled(stun_ipv6_probes);
4 changes: 1 addition & 3 deletions iroh-relay/src/server/client.rs
Original file line number Diff line number Diff line change
@@ -219,9 +219,7 @@ impl Actor {
}
}

self.clients
.unregister(self.connection_id, self.node_id)
.await;
self.clients.unregister(self.connection_id, self.node_id);
}

async fn run_inner(&mut self, done: CancellationToken) -> Result<()> {
3 changes: 1 addition & 2 deletions iroh-relay/src/server/clients.rs
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ impl Clients {
/// peer is gone from the network.
///
/// Must be passed a matching connection_id.
pub(super) async fn unregister(&self, connection_id: u64, node_id: NodeId) {
pub(super) fn unregister(&self, connection_id: u64, node_id: NodeId) {
trace!(
node_id = node_id.fmt_short(),
connection_id,
@@ -100,7 +100,6 @@ impl Clients {
}
}
}
client.shutdown().await;
}
}

6 changes: 5 additions & 1 deletion iroh-relay/src/server/http_server.rs
Original file line number Diff line number Diff line change
@@ -643,7 +643,11 @@ impl RelayService {
},
TlsAcceptor::Manual(a) => {
debug!("TLS[manual]: accept");
let tls_stream = a.accept(stream).await.context("TLS[manual] accept")?;
let tls_stream = tokio::time::timeout(Duration::from_secs(30), a.accept(stream))
.await
.context("TLS[manual] timeout")?
.context("TLS[manual] accept")?;

self.serve_connection(MaybeTlsStream::Tls(tls_stream))
.await
.context("TLS[manual] serve connection")?;
2 changes: 1 addition & 1 deletion iroh/Cargo.toml
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ testresult = "0.4.0"
iroh-relay = { path = "../iroh-relay", default-features = false, features = ["test-utils", "server"] }

[features]
default = ["metrics", "discovery-pkarr-dht"]
default = ["metrics"]
metrics = ["iroh-metrics/metrics", "iroh-relay/metrics", "net-report/metrics", "portmapper/metrics"]
test-utils = ["iroh-relay/test-utils", "iroh-relay/server", "dep:axum"]
discovery-local-network = ["dep:swarm-discovery"]
4 changes: 2 additions & 2 deletions iroh/examples/dht_discovery.rs
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
use std::str::FromStr;

use clap::Parser;
use iroh::{endpoint::get_remote_node_id, Endpoint, NodeId};
use iroh::{Endpoint, NodeId};
use tracing::warn;
use url::Url;

@@ -88,7 +88,7 @@ async fn chat_server(args: Args) -> anyhow::Result<()> {
};
tokio::spawn(async move {
let connection = connecting.await?;
let remote_node_id = get_remote_node_id(&connection)?;
let remote_node_id = connection.remote_node_id()?;
println!("got connection from {}", remote_node_id);
// just leave the tasks hanging. this is just an example.
let (mut writer, mut reader) = connection.accept_bi().await?;
2 changes: 1 addition & 1 deletion iroh/examples/echo.rs
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ impl ProtocolHandler for Echo {
// Wait for the connection to be fully established.
let connection = connecting.await?;
// We can get the remote's node id from the connection.
let node_id = iroh::endpoint::get_remote_node_id(&connection)?;
let node_id = connection.remote_node_id()?;
println!("accepted connection from {node_id}");

// Our protocol is a simple request-response protocol, so we expect the
5 changes: 2 additions & 3 deletions iroh/examples/listen-unreliable.rs
Original file line number Diff line number Diff line change
@@ -69,11 +69,10 @@ async fn main() -> anyhow::Result<()> {
};
let alpn = connecting.alpn().await?;
let conn = connecting.await?;
let node_id = iroh::endpoint::get_remote_node_id(&conn)?;
let node_id = conn.remote_node_id()?;
info!(
"new (unreliable) connection from {node_id} with ALPN {} (coming from {})",
"new (unreliable) connection from {node_id} with ALPN {}",
String::from_utf8_lossy(&alpn),
conn.remote_address()
);
// spawn a task to handle reading and writing off of the connection
tokio::spawn(async move {
5 changes: 2 additions & 3 deletions iroh/examples/listen.rs
Original file line number Diff line number Diff line change
@@ -70,11 +70,10 @@ async fn main() -> anyhow::Result<()> {
};
let alpn = connecting.alpn().await?;
let conn = connecting.await?;
let node_id = iroh::endpoint::get_remote_node_id(&conn)?;
let node_id = conn.remote_node_id()?;
info!(
"new connection from {node_id} with ALPN {} (coming from {})",
"new connection from {node_id} with ALPN {}",
String::from_utf8_lossy(&alpn),
conn.remote_address()
);

// spawn a task to handle reading and writing off of the connection
4 changes: 2 additions & 2 deletions iroh/examples/search.rs
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ use anyhow::Result;
use clap::Parser;
use futures_lite::future::Boxed as BoxedFuture;
use iroh::{
endpoint::{get_remote_node_id, Connecting},
endpoint::Connecting,
protocol::{ProtocolHandler, Router},
Endpoint, NodeId,
};
@@ -134,7 +134,7 @@ impl ProtocolHandler for BlobSearch {
// Wait for the connection to be fully established.
let connection = connecting.await?;
// We can get the remote's node id from the connection.
let node_id = get_remote_node_id(&connection)?;
let node_id = connection.remote_node_id()?;
println!("accepted connection from {node_id}");

// Our protocol is a simple request-response protocol, so we expect the
5 changes: 2 additions & 3 deletions iroh/examples/transfer.rs
Original file line number Diff line number Diff line change
@@ -179,11 +179,10 @@ async fn provide(
}
};
let conn = connecting.await?;
let node_id = iroh::endpoint::get_remote_node_id(&conn)?;
let node_id = conn.remote_node_id()?;
info!(
"new connection from {node_id} with ALPN {} (coming from {})",
"new connection from {node_id} with ALPN {}",
String::from_utf8_lossy(TRANSFER_ALPN),
conn.remote_address()
);

// spawn a task to handle reading and writing off of the connection
Loading