diff --git a/Cargo.lock b/Cargo.lock index 2f852b2ca6..d31ae5a3a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1290,6 +1290,7 @@ dependencies = [ "criterion", "faster-hex", "futures", + "hickory-resolver", "idb", "ipnetwork", "num_cpus", @@ -1306,7 +1307,6 @@ dependencies = [ "tentacle", "tokio", "tokio-util", - "trust-dns-resolver", ] [[package]] @@ -3086,6 +3086,51 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "hickory-proto" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447afdcdb8afb9d0a852af6dc65d9b285ce720ed7a59e42a8bf2e931c67bc1b5" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.8.5", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2e2aba9c389ce5267d31cf1e4dace82390ae276b0b364ea55630b1fa1b44b4" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -3454,16 +3499,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -6576,52 +6611,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand 0.8.5", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot 0.12.3", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -6825,7 +6814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", + "idna", "percent-encoding", "serde", ] diff --git a/deny.toml b/deny.toml index 09466e1a7f..c03480c563 100644 --- a/deny.toml +++ b/deny.toml @@ -103,6 +103,7 @@ allow = [ "CC0-1.0", "Unicode-DFS-2016", "OpenSSL", + "Unicode-3.0", #"Apache-2.0 WITH LLVM-exception", ] # The confidence threshold for detecting a license from license text. diff --git a/network/Cargo.toml b/network/Cargo.toml index 8710a4c5a6..bb68ffc550 100644 --- a/network/Cargo.toml +++ b/network/Cargo.toml @@ -26,7 +26,7 @@ sentry = { version = "0.34.0", optional = true } faster-hex = { version = "0.6", optional = true } ckb-hash = { path = "../util/hash", version = "= 0.121.0-pre" } secp256k1 = { version = "0.30", features = ["recovery"], optional = true } -trust-dns-resolver = { version = "0.23", optional = true } +hickory-resolver = { version = "0.24.2", optional = true } snap = "1" ckb-types = { path = "../util/types", version = "= 0.121.0-pre" } ipnetwork = "0.20" @@ -57,7 +57,7 @@ serde-wasm-bindgen = "0.6.5" [features] with_sentry = ["sentry"] -with_dns_seeding = ["bs58", "faster-hex", "trust-dns-resolver", "secp256k1"] +with_dns_seeding = ["bs58", "faster-hex", "hickory-resolver", "secp256k1"] fuzz = [] [dev-dependencies] diff --git a/network/src/services/dns_seeding/mod.rs b/network/src/services/dns_seeding/mod.rs index b1adced7c3..5b53179b11 100644 --- a/network/src/services/dns_seeding/mod.rs +++ b/network/src/services/dns_seeding/mod.rs @@ -68,7 +68,7 @@ impl DnsSeedingService { let pubkey = PublicKey::from_slice(&pubkey_bytes) .map_err(|err| format!("create PublicKey failed: {err:?}"))?; - let resolver = trust_dns_resolver::AsyncResolver::tokio_from_system_conf() + let resolver = hickory_resolver::AsyncResolver::tokio_from_system_conf() .map_err(|err| format!("Failed to create DNS resolver: {err}"))?; let mut addrs = Vec::new();