Skip to content

Commit

Permalink
Merge pull request #1500 from eqlabs/chris/libp2p053
Browse files Browse the repository at this point in the history
update libp2p to 0.53.0
  • Loading branch information
CHr15F0x committed Nov 6, 2023
2 parents 6bc2cff + bdbf041 commit 1c8ebef
Show file tree
Hide file tree
Showing 13 changed files with 370 additions and 426 deletions.
488 changes: 230 additions & 258 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lto = true
[workspace.package]
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.72"
rust-version = "1.73"

[workspace.dependencies]
anyhow = "1.0.75"
Expand Down
2 changes: 1 addition & 1 deletion crates/load-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = "Load test for pathfinder JSON-RPC endpoints"
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.72"
rust-version = "1.73"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
4 changes: 3 additions & 1 deletion crates/p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ anyhow = { workspace = true }
async-trait = { workspace = true }
base64 = { workspace = true }
futures = { workspace = true }
libp2p = { version = "0.52.4", default-features = false, features = [
libp2p = { version = "0.53.0", default-features = false, features = [
"autonat",
"dcutr",
"dns",
Expand All @@ -24,6 +24,7 @@ libp2p = { version = "0.52.4", default-features = false, features = [
"ping",
"relay",
"request-response",
"serde",
"tcp",
"tokio",
"yamux",
Expand All @@ -38,6 +39,7 @@ sha2 = "0.10.7"
stark_hash = { path = "../stark_hash" }
tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread", "sync"] }
tracing = "0.1.37"
unsigned-varint = { version = "0.8.0", features = ["futures"] }
void = "1.0.2"
zeroize = "1.6.0"

Expand Down
6 changes: 3 additions & 3 deletions crates/p2p/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use libp2p::dcutr;
use libp2p::gossipsub::{self, IdentTopic, MessageAuthenticity, MessageId};
use libp2p::identify;
use libp2p::identity;
use libp2p::kad::{self, record::store::MemoryStore};
use libp2p::kad::{self, store::MemoryStore};
use libp2p::ping;
use libp2p::relay;
use libp2p::request_response::{self, ProtocolSupport};
Expand Down Expand Up @@ -223,10 +223,10 @@ impl From<request_response::Event<EventsRequest, EventsResponseList>> for Event
}
}

fn string_to_key(input: &str) -> kad::record::Key {
fn string_to_key(input: &str) -> kad::RecordKey {
use sha2::{Digest, Sha256};
let mut hasher = Sha256::new();
hasher.update(input.as_bytes());
let result = hasher.finalize();
kad::record::Key::new(&result.as_slice())
kad::RecordKey::new(&result.as_slice())
}
4 changes: 2 additions & 2 deletions crates/p2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::Duration;

use libp2p::gossipsub::IdentTopic;
use libp2p::identity::Keypair;
use libp2p::kad::record::Key;
use libp2p::kad::RecordKey;
use libp2p::request_response::ResponseChannel;
use libp2p::swarm::Config;
use libp2p::{Multiaddr, PeerId, Swarm};
Expand Down Expand Up @@ -224,7 +224,7 @@ pub enum Event {
pub enum TestEvent {
NewListenAddress(Multiaddr),
PeriodicBootstrapCompleted(Result<PeerId, PeerId>),
StartProvidingCompleted(Result<Key, Key>),
StartProvidingCompleted(Result<RecordKey, RecordKey>),
ConnectionEstablished { outbound: bool, remote: PeerId },
Subscribed { remote: PeerId, topic: String },
PeerAddedToDHT { remote: PeerId },
Expand Down
Loading

0 comments on commit 1c8ebef

Please sign in to comment.