Skip to content

Commit

Permalink
Merge pull request #2484 from maqi/use_latest_libp2p
Browse files Browse the repository at this point in the history
chore: libp2p dependent updated to latest
  • Loading branch information
jacderida authored Dec 9, 2024
2 parents ca1bdff + 8124d59 commit f53c275
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 229 deletions.
454 changes: 241 additions & 213 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ant-evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ custom_debug = "~0.6.1"
evmlib = { path = "../evmlib", version = "0.1.4" }
hex = "~0.4.3"
lazy_static = "~1.4.0"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = ["identify", "kad"] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = ["identify", "kad"] }
rand = { version = "~0.8.5", features = ["small_rng"] }
ring = "0.17.8"
rmp-serde = "1.1.1"
Expand Down
4 changes: 2 additions & 2 deletions ant-networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ hyper = { version = "0.14", features = [
], optional = true }
itertools = "~0.12.1"
lazy_static = "~1.4.0"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = [
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = [
"tokio",
"dns",
"kad",
Expand Down Expand Up @@ -96,7 +96,7 @@ crate-type = ["cdylib", "rlib"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2.12", features = ["js"] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = [
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = [
"tokio",
"dns",
"kad",
Expand Down
15 changes: 10 additions & 5 deletions ant-networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ pub enum VerificationKind {
},
}

impl From<std::convert::Infallible> for NodeEvent {
fn from(_: std::convert::Infallible) -> Self {
panic!("NodeBehaviour is not Infallible!")
}
}

/// The behaviors are polled in the order they are defined.
/// The first struct member is polled until it returns Poll::Pending before moving on to later members.
/// Prioritize the behaviors related to connection handling.
Expand Down Expand Up @@ -638,11 +644,10 @@ impl NetworkBuilder {
let identify_protocol_str = IDENTIFY_PROTOCOL_STR.to_string();
info!("Building Identify with identify_protocol_str: {identify_protocol_str:?} and identify_version: {identify_version:?}");
let identify = {
let mut cfg =
libp2p::identify::Config::new(identify_protocol_str, self.keypair.public())
.with_agent_version(identify_version);
// Enlength the identify interval from default 5 mins to 1 hour.
cfg.interval = RESEND_IDENTIFY_INVERVAL;
let cfg = libp2p::identify::Config::new(identify_protocol_str, self.keypair.public())
.with_agent_version(identify_version)
// Enlength the identify interval from default 5 mins to 1 hour.
.with_interval(RESEND_IDENTIFY_INVERVAL);
libp2p::identify::Behaviour::new(cfg)
};

Expand Down
2 changes: 1 addition & 1 deletion ant-node-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ colored = "2.0.4"
color-eyre = "~0.6"
dirs-next = "2.0.0"
indicatif = { version = "0.17.5", features = ["tokio"] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = [] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = [] }
libp2p-identity = { version = "0.2.7", features = ["rand"] }
prost = { version = "0.9" }
rand = "0.8.5"
Expand Down
2 changes: 1 addition & 1 deletion ant-node-rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bls = { package = "blsttc", version = "8.0.1" }
clap = { version = "4.2.1", features = ["derive"] }
color-eyre = "0.6.2"
hex = "~0.4.3"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = ["kad"]}
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = ["kad"]}
libp2p-identity = { version="0.2.7", features = ["rand"] }
thiserror = "1.0.23"
# # watch out updating this, protoc compiler needs to be installed on all build systems
Expand Down
2 changes: 1 addition & 1 deletion ant-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ file-rotate = "0.7.3"
futures = "~0.3.13"
hex = "~0.4.3"
itertools = "~0.12.1"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = ["tokio", "dns", "kad", "macros"] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = ["tokio", "dns", "kad", "macros"] }
num-traits = "0.2"
prometheus-client = { version = "0.22", optional = true }
# watch out updating this, protoc compiler needs to be installed on all build systems
Expand Down
2 changes: 1 addition & 1 deletion ant-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dirs-next = "~2.0.0"
exponential-backoff = "2.0.0"
hex = "~0.4.3"
lazy_static = "1.4.0"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = ["identify", "kad"] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = ["identify", "kad"] }
# # watch out updating this, protoc compiler needs to be installed on all build systems
# # arm builds + musl are very problematic
# prost and tonic are needed for the RPC server messages, not the underlying protocol
Expand Down
2 changes: 1 addition & 1 deletion ant-service-management/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ant-logging = { path = "../ant-logging", version = "0.2.40" }
ant-protocol = { path = "../ant-protocol", version = "0.17.15", features = ["rpc"] }
async-trait = "0.1"
dirs-next = "2.0.0"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = ["kad"] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = ["kad"] }
libp2p-identity = { version = "0.2.7", features = ["rand"] }
prost = { version = "0.9" }
serde = { version = "1.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion autonomi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ curv = { version = "0.10.1", package = "sn_curv", default-features = false, feat
eip2333 = { version = "0.2.1", package = "sn_bls_ckd" }
futures = "0.3.30"
hex = "~0.4.3"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2" }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master" }
pyo3 = { version = "0.20", optional = true, features = ["extension-module", "abi3-py38"] }
rand = "0.8.5"
rmp-serde = "1.1.1"
Expand Down
2 changes: 1 addition & 1 deletion nat-detection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ clap = { version = "4.5.4", features = ["derive"] }
clap-verbosity-flag = "2.2.0"
color-eyre = { version = "0.6", default-features = false }
futures = "~0.3.13"
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = [
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = [
"tokio",
"tcp",
"noise",
Expand Down
2 changes: 1 addition & 1 deletion test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bytes = { version = "1.0.1", features = ["serde"] }
color-eyre = "~0.6.2"
dirs-next = "~2.0.0"
evmlib = { path = "../evmlib", version = "0.1.4" }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "kad_0.46.2", features = ["identify", "kad"] }
libp2p = { git = "https://github.com/maqi/rust-libp2p.git", branch = "master", features = ["identify", "kad"] }
rand = "0.8.5"
serde = { version = "1.0.133", features = ["derive"] }
serde_json = "1.0"

0 comments on commit f53c275

Please sign in to comment.