Skip to content

(ignore) testing pkarr v3 without async compat #3191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
- uses: taiki-e/install-action@cross

- name: test
run: cross test --all --target ${{ matrix.target }} -- --test-threads=12
run: RUST_BACKTRACE=1 cross test --all --target ${{ matrix.target }} -- --test-threads=12
env:
RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG' }}

Expand Down Expand Up @@ -183,7 +183,6 @@ jobs:
- name: Ensure no 'import "env"' in iroh-net-report Wasm
run: |
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh_net_report.wasm | grep 'import "env"'


check_semver:
runs-on: ubuntu-latest
Expand Down
131 changes: 77 additions & 54 deletions Cargo.lock

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

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

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

[patch.crates-io]
pkarr = { git = "https://github.com/Nuhvi/pkarr.git", branch = "fix/update_async_compat" }
4 changes: 2 additions & 2 deletions iroh-dns-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ humantime-serde = "1.1.1"
iroh-metrics = { version = "0.31.0" }
lru = "0.12.3"
n0-future = "0.1.2"
pkarr = { version = "2.3.1", features = [ "async", "relay", "dht"], default-features = false }
pkarr = { version = "3", features = ["relays", "dht"], default-features = false }
rcgen = "0.13"
redb = "2.0.0"
regex = "1.10.3"
Expand Down Expand Up @@ -61,7 +61,7 @@ z32 = "1.1.1"
criterion = "0.5.1"
hickory-resolver = "=0.25.0-alpha.5"
iroh = { path = "../iroh" }
pkarr = { version = "2.3.1", features = ["rand"] }
mainline = "5"
rand = "0.8"
rand_chacha = "0.3.1"
testresult = "0.4.1"
Expand Down
29 changes: 12 additions & 17 deletions iroh-dns-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod tests {
dns::{node_info::NodeInfo, DnsResolver},
RelayUrl, SecretKey,
};
use pkarr::{PkarrClient, SignedPacket};
use pkarr::{SignedPacket, Timestamp};
use testresult::TestResult;
use tracing_test::traced_test;

Expand Down Expand Up @@ -102,13 +102,13 @@ mod tests {
30,
dns::rdata::RData::AAAA(Ipv6Addr::LOCALHOST.into()),
));
SignedPacket::from_packet(&keypair, &packet)?
SignedPacket::new(&keypair, &packet.answers, Timestamp::now())?
};
let pkarr_client = pkarr::PkarrRelayClient::new(pkarr::RelaySettings {
relays: vec![pkarr_relay_url.to_string()],
..Default::default()
})?;
pkarr_client.as_async().publish(&signed_packet).await?;
let pkarr_client = pkarr::Client::builder()
.no_default_network()
.relays(&[pkarr_relay_url])?
.build()?;
pkarr_client.publish(&signed_packet, None).await?;

use hickory_server::proto::rr::Name;
let pubkey = signed_packet.public_key().to_z32();
Expand Down Expand Up @@ -220,7 +220,7 @@ mod tests {
#[traced_test]
async fn integration_mainline() -> Result<()> {
// run a mainline testnet
let testnet = pkarr::mainline::dht::Testnet::new(5);
let testnet = mainline::Testnet::new(5)?;
let bootstrap = testnet.bootstrap.clone();

// spawn our server with mainline support
Expand All @@ -238,13 +238,11 @@ mod tests {
let signed_packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?;

// publish the signed packet to our DHT
let pkarr = PkarrClient::builder()
.dht_settings(pkarr::mainline::dht::DhtSettings {
bootstrap: Some(testnet.bootstrap),
..Default::default()
})
let pkarr = pkarr::Client::builder()
.no_default_network()
.dht(|builder| builder.bootstrap(&testnet.bootstrap))
.build()?;
pkarr.publish(&signed_packet)?;
pkarr.publish(&signed_packet, None).await?;

// resolve via DNS from our server, which will lookup from our DHT
let resolver = test_resolver(nameserver);
Expand All @@ -254,9 +252,6 @@ mod tests {
assert_eq!(res.relay_url(), Some(&relay_url));

server.shutdown().await?;
for mut node in testnet.nodes {
node.shutdown()?;
}
Ok(())
}

Expand Down
Loading
Loading