Skip to content

Commit f289bbd

Browse files
authored
update dependencies (#219)
1 parent faa5801 commit f289bbd

File tree

6 files changed

+49
-39
lines changed

6 files changed

+49
-39
lines changed

Cargo.toml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,41 @@ categories = ["network-programming", "asynchronous"]
1212
exclude = [".gitignore", ".github/*"]
1313

1414
[dependencies]
15-
enr = { version = "0.9.0", features = ["k256", "ed25519"] }
16-
tokio = { version = "1.15.0", features = ["net", "sync", "macros", "rt"] }
17-
libp2p-core = { version = "0.40.0", optional = true }
18-
libp2p-identity = { version = "0.2.1", features = ["ed25519", "secp256k1"], optional = true }
19-
zeroize = { version = "1.4.3", features = ["zeroize_derive"] }
20-
futures = "0.3.19"
21-
uint = { version = "0.9.1", default-features = false }
22-
rlp = "0.5.1"
15+
enr = { version = "0.9", features = ["k256", "ed25519"] }
16+
tokio = { version = "1", features = ["net", "sync", "macros", "rt"] }
17+
libp2p = { version = "0.52", features = ["ed25519", "secp256k1"], optional = true }
18+
zeroize = { version = "1", features = ["zeroize_derive"] }
19+
futures = "0.3"
20+
uint = { version = "0.9", default-features = false }
21+
rlp = "0.5"
2322
# This version must be kept up to date do it uses the same dependencies as ENR
24-
hkdf = "0.12.3"
25-
hex = "0.4.3"
26-
fnv = "1.0.7"
27-
arrayvec = "0.7.2"
28-
rand = { version = "0.8.4", package = "rand" }
29-
socket2 = "0.4.4"
30-
smallvec = "1.7.0"
31-
parking_lot = "0.11.2"
32-
lazy_static = "1.4.0"
33-
aes = { version = "0.7.5", features = ["ctr"] }
34-
aes-gcm = "0.9.4"
35-
tracing = { version = "0.1.29", features = ["log"] }
36-
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
37-
lru = "0.7.1"
38-
hashlink = "0.7.0"
39-
delay_map = "0.3.0"
40-
more-asserts = "0.2.2"
23+
hkdf = "0.12"
24+
hex = "0.4"
25+
fnv = "1"
26+
arrayvec = "0.7"
27+
rand = { version = "0.8", package = "rand" }
28+
socket2 = "0.4"
29+
smallvec = "1"
30+
parking_lot = "0.11"
31+
lazy_static = "1"
32+
aes = { version = "0.7", features = ["ctr"] }
33+
aes-gcm = "0.9"
34+
tracing = { version = "0.1", features = ["log"] }
35+
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
36+
lru = "0.12"
37+
hashlink = "0.8"
38+
delay_map = "0.3"
39+
more-asserts = "0.3"
4140

4241
[dev-dependencies]
4342
rand_07 = { package = "rand", version = "0.7" }
44-
quickcheck = "0.9.2"
45-
tokio = { version = "1.15.0", features = ["full"] }
46-
rand_xorshift = "0.3.0"
47-
rand_core = "0.6.3"
48-
clap = { version = "3.1", features = ["derive"] }
49-
if-addrs = "0.10.1"
43+
quickcheck = "0.9"
44+
tokio = { version = "1", features = ["full"] }
45+
rand_xorshift = "0.3"
46+
rand_core = "0.6"
47+
clap = { version = "4", features = ["derive"] }
48+
if-addrs = "0.10"
5049

5150
[features]
52-
libp2p = ["libp2p-core", "libp2p-identity"]
51+
libp2p = ["dep:libp2p"]
5352
serde = ["enr/serde"]

examples/find_nodes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ async fn main() {
204204
}
205205
}
206206

207+
#[derive(Clone)]
207208
pub enum SocketKind {
208209
Ip4,
209210
Ip6,

src/discv5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use tokio::sync::{mpsc, oneshot};
3636
use tracing::{debug, warn};
3737

3838
#[cfg(feature = "libp2p")]
39-
use libp2p_core::Multiaddr;
39+
use libp2p::Multiaddr;
4040

4141
// Create lazy static variable for the global permit/ban list
4242
use crate::{

src/handler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ impl Handler {
471471
trace!("Request queued for node: {}", node_address);
472472
self.pending_requests
473473
.entry(node_address)
474-
.or_insert_with(Vec::new)
474+
.or_default()
475475
.push(PendingRequest {
476476
contact,
477477
request_id,

src/node_info.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ use enr::{CombinedPublicKey, NodeId};
44
use std::net::SocketAddr;
55

66
#[cfg(feature = "libp2p")]
7-
use libp2p_core::{multiaddr::Protocol, Multiaddr};
8-
#[cfg(feature = "libp2p")]
9-
use libp2p_identity::{KeyType, PublicKey};
7+
use libp2p::{
8+
identity::{KeyType, PublicKey},
9+
multiaddr::Protocol,
10+
Multiaddr,
11+
};
1012

1113
/// This type relaxes the requirement of having an ENR to connect to a node, to allow for unsigned
1214
/// connection types, such as multiaddrs.

src/socket/filter/mod.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use lru::LruCache;
77
use std::{
88
collections::HashSet,
99
net::{IpAddr, SocketAddr},
10+
num::NonZeroUsize,
1011
sync::atomic::Ordering,
1112
time::{Duration, Instant},
1213
};
@@ -19,9 +20,16 @@ pub use config::FilterConfig;
1920
use rate_limiter::{LimitKind, RateLimiter};
2021

2122
/// The maximum number of IPs to retain when calculating the number of nodes per IP.
22-
const KNOWN_ADDRS_SIZE: usize = 500;
23+
const KNOWN_ADDRS_SIZE: NonZeroUsize = match NonZeroUsize::new(500) {
24+
Some(non_zero) => non_zero,
25+
None => unreachable!(),
26+
};
2327
/// The number of IPs to retain at any given time that have banned nodes.
24-
const BANNED_NODES_SIZE: usize = 50;
28+
const BANNED_NODES_SIZE: NonZeroUsize = match NonZeroUsize::new(50) {
29+
Some(non_zero) => non_zero,
30+
None => unreachable!(),
31+
};
32+
2533
/// The maximum number of packets to keep record of for metrics if the rate limiter is not
2634
/// specified.
2735
const DEFAULT_PACKETS_PER_SECOND: usize = 20;

0 commit comments

Comments
 (0)