From d72d9a7581c8e018b10f898793d4f17c7280bd4d Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Mon, 22 May 2023 19:33:30 +0300 Subject: [PATCH 1/8] provide wasm compatibility for gossipsub protocol Signed-off-by: ozkanonur --- Cargo.lock | 1 + libp2p/Cargo.toml | 2 +- protocols/gossipsub/Cargo.toml | 4 ++++ protocols/gossipsub/src/peer_score.rs | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70164c2e517..c4d5bab2bd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2594,6 +2594,7 @@ dependencies = [ "env_logger 0.10.0", "fnv", "futures", + "getrandom 0.2.9", "hex", "hex_fmt", "instant", diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index 95cd9c08681..eef2c2ac241 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -80,7 +80,7 @@ tcp = ["dep:libp2p-tcp"] tls = ["dep:libp2p-tls"] tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio", "libp2p-quic?/tokio", "libp2p-webrtc?/tokio"] uds = ["dep:libp2p-uds"] -wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen"] +wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen", "libp2p-gossipsub?/wasm-bindgen"] wasm-ext = ["dep:libp2p-wasm-ext"] wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"] webrtc = ["dep:libp2p-webrtc", "libp2p-webrtc?/pem"] diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index 80645f509ba..fdd1bdeca1f 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -10,6 +10,9 @@ repository = "https://github.com/libp2p/rust-libp2p" keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] +[features] +wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"] + [dependencies] either = "1.5" libp2p-swarm = { workspace = true } @@ -36,6 +39,7 @@ instant = "0.1.11" void = "1.0.2" # Metrics dependencies prometheus-client = "0.21.0" +getrandom = "0.2.9" [dev-dependencies] async-std = { version = "1.6.3", features = ["unstable"] } diff --git a/protocols/gossipsub/src/peer_score.rs b/protocols/gossipsub/src/peer_score.rs index 5d3f387a478..10f56994a20 100644 --- a/protocols/gossipsub/src/peer_score.rs +++ b/protocols/gossipsub/src/peer_score.rs @@ -24,12 +24,12 @@ use crate::metrics::{Metrics, Penalty}; use crate::time_cache::TimeCache; use crate::{MessageId, TopicHash}; +use instant::Instant; use libp2p_identity::PeerId; use log::{debug, trace, warn}; use std::collections::{hash_map, HashMap, HashSet}; use std::net::IpAddr; use std::time::Duration; -use wasm_timer::Instant; mod params; use crate::ValidationError; From e976eaa2f1ffb802145f28b4d523810f85683baf Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 22 May 2023 19:51:35 +0200 Subject: [PATCH 2/8] Include gossipsub in wasm build --- libp2p/Cargo.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index eef2c2ac241..fb062bd50ba 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -114,6 +114,7 @@ libp2p-request-response = { workspace = true, optional = true } libp2p-swarm = { workspace = true } libp2p-wasm-ext = { workspace = true, optional = true } libp2p-yamux = { workspace = true, optional = true } +libp2p-gossipsub = { workspace = true, optional = true } multiaddr = { version = "0.17.0" } pin-project = "1.0.0" @@ -130,9 +131,6 @@ libp2p-uds = { workspace = true, optional = true } libp2p-webrtc = { workspace = true, optional = true } libp2p-websocket = { workspace = true, optional = true } -[target.'cfg(not(target_os = "unknown"))'.dependencies] -libp2p-gossipsub = { workspace = true, optional = true } - [dev-dependencies] async-std = { version = "1.6.2", features = ["attributes"] } async-trait = "0.1" From 281b88ade0303e3db8387c130ffe39805cc096ac Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 22 May 2023 19:52:47 +0200 Subject: [PATCH 3/8] Sort dependency list --- libp2p/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index fb062bd50ba..11d64656d4d 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -100,6 +100,7 @@ libp2p-connection-limits = { workspace = true } libp2p-core = { workspace = true } libp2p-dcutr = { workspace = true, optional = true } libp2p-floodsub = { workspace = true, optional = true } +libp2p-gossipsub = { workspace = true, optional = true } libp2p-identify = { workspace = true, optional = true } libp2p-identity = { workspace = true } libp2p-kad = { workspace = true, optional = true } @@ -114,7 +115,6 @@ libp2p-request-response = { workspace = true, optional = true } libp2p-swarm = { workspace = true } libp2p-wasm-ext = { workspace = true, optional = true } libp2p-yamux = { workspace = true, optional = true } -libp2p-gossipsub = { workspace = true, optional = true } multiaddr = { version = "0.17.0" } pin-project = "1.0.0" From f11f9e471a418588d465fae7dd8193e13c71683e Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 22 May 2023 19:56:05 +0200 Subject: [PATCH 4/8] Sort dependency list in gossipsub --- protocols/gossipsub/Cargo.toml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index fdd1bdeca1f..1b0a89eb190 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -14,32 +14,33 @@ categories = ["network-programming", "asynchronous"] wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"] [dependencies] -either = "1.5" -libp2p-swarm = { workspace = true } -libp2p-core = { workspace = true } -libp2p-identity = { workspace = true } -bytes = "1.4" +asynchronous-codec = "0.6" +base64 = "0.21.0" byteorder = "1.3.4" +bytes = "1.4" +either = "1.5" fnv = "1.0.7" futures = "0.3.28" -rand = "0.8" -asynchronous-codec = "0.6" -unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] } +getrandom = "0.2.9" +hex_fmt = "0.3.0" +instant = "0.1.11" +libp2p-core = { workspace = true } +libp2p-identity = { workspace = true } +libp2p-swarm = { workspace = true } log = "0.4.11" -sha2 = "0.10.0" -base64 = "0.21.0" -smallvec = "1.6.1" quick-protobuf = "0.8" quick-protobuf-codec = { workspace = true } -hex_fmt = "0.3.0" +rand = "0.8" regex = "1.8.1" serde = { version = "1", optional = true, features = ["derive"] } -wasm-timer = "0.2.5" -instant = "0.1.11" +sha2 = "0.10.0" +smallvec = "1.6.1" +unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] } void = "1.0.2" +wasm-timer = "0.2.5" + # Metrics dependencies prometheus-client = "0.21.0" -getrandom = "0.2.9" [dev-dependencies] async-std = { version = "1.6.3", features = ["unstable"] } From 25a05ccd98092288b6e31d0d9707c9838a2922a6 Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Tue, 23 May 2023 12:16:19 +0300 Subject: [PATCH 5/8] get rid of `wasm_timer` --- Cargo.lock | 73 +++++++--------------- protocols/gossipsub/Cargo.toml | 4 +- protocols/gossipsub/src/backoff.rs | 2 +- protocols/gossipsub/src/behaviour.rs | 23 +++---- protocols/gossipsub/src/gossip_promises.rs | 2 +- protocols/gossipsub/src/time_cache.rs | 2 +- 6 files changed, 39 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4d5bab2bd6..78ffea64fb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1739,6 +1739,17 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +[[package]] +name = "futures-ticker" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009df77691585f6fb46aab60c00039a4d718ae90db73ae9e36fb290358c86658" +dependencies = [ + "futures", + "futures-timer", + "instant", +] + [[package]] name = "futures-timer" version = "3.0.2" @@ -2486,7 +2497,7 @@ dependencies = [ "multihash", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "pin-project", "quick-protobuf", "quickcheck-ext", @@ -2556,7 +2567,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "parking_lot 0.12.1", + "parking_lot", "smallvec", "tokio", "trust-dns-resolver", @@ -2594,6 +2605,7 @@ dependencies = [ "env_logger 0.10.0", "fnv", "futures", + "futures-ticker", "getrandom 0.2.9", "hex", "hex_fmt", @@ -2616,7 +2628,6 @@ dependencies = [ "smallvec", "unsigned-varint", "void", - "wasm-timer", ] [[package]] @@ -2763,7 +2774,7 @@ dependencies = [ "libp2p-tcp", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot", "quickcheck-ext", "rand 0.8.5", "smallvec", @@ -2907,7 +2918,7 @@ dependencies = [ "libp2p-tls", "libp2p-yamux", "log", - "parking_lot 0.12.1", + "parking_lot", "quickcheck", "quinn-proto", "rand 0.8.5", @@ -3171,7 +3182,7 @@ dependencies = [ "libp2p-identity", "libp2p-tcp", "log", - "parking_lot 0.12.1", + "parking_lot", "quicksink", "rcgen 0.9.3", "rw-stream-sink", @@ -3703,17 +3714,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -3721,21 +3721,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.6", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -4018,7 +4004,7 @@ checksum = "78c2f43e8969d51935d2a7284878ae053ba30034cd563f673cde37ba5205685e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.1", + "parking_lot", "prometheus-client-derive-encode", ] @@ -5090,7 +5076,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite 0.2.9", "signal-hook-registry", "socket2 0.4.9", @@ -5227,7 +5213,7 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.1", + "parking_lot", "resolv-conf", "rustls 0.20.8", "smallvec", @@ -5512,21 +5498,6 @@ version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" -[[package]] -name = "wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" -dependencies = [ - "futures", - "js-sys", - "parking_lot 0.11.2", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "web-sys" version = "0.3.60" @@ -6101,7 +6072,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot", "rand 0.8.5", "static_assertions", ] diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index 1b0a89eb190..2a299dbc0dc 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -14,6 +14,7 @@ categories = ["network-programming", "asynchronous"] wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"] [dependencies] +futures-ticker = "0.0.2" asynchronous-codec = "0.6" base64 = "0.21.0" byteorder = "1.3.4" @@ -23,7 +24,7 @@ fnv = "1.0.7" futures = "0.3.28" getrandom = "0.2.9" hex_fmt = "0.3.0" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } libp2p-swarm = { workspace = true } @@ -37,7 +38,6 @@ sha2 = "0.10.0" smallvec = "1.6.1" unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] } void = "1.0.2" -wasm-timer = "0.2.5" # Metrics dependencies prometheus-client = "0.21.0" diff --git a/protocols/gossipsub/src/backoff.rs b/protocols/gossipsub/src/backoff.rs index e6f05047a3e..3021e841eae 100644 --- a/protocols/gossipsub/src/backoff.rs +++ b/protocols/gossipsub/src/backoff.rs @@ -20,13 +20,13 @@ //! Data structure for efficiently storing known back-off's when pruning peers. use crate::topic::TopicHash; +use instant::Instant; use libp2p_identity::PeerId; use std::collections::{ hash_map::{Entry, HashMap}, HashSet, }; use std::time::Duration; -use wasm_timer::Instant; #[derive(Copy, Clone)] struct HeartbeatIndex(usize); diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index ba0594a9801..484f3d2ab7d 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -30,10 +30,12 @@ use std::{ }; use futures::StreamExt; +use futures_ticker::Ticker; use log::{debug, error, trace, warn}; use prometheus_client::registry::Registry; use rand::{seq::SliceRandom, thread_rng}; +use instant::Instant; use libp2p_core::{multiaddr::Protocol::Ip4, multiaddr::Protocol::Ip6, Endpoint, Multiaddr}; use libp2p_identity::Keypair; use libp2p_identity::PeerId; @@ -43,7 +45,6 @@ use libp2p_swarm::{ ConnectionDenied, ConnectionId, NetworkBehaviour, NotifyHandler, PollParameters, THandler, THandlerInEvent, THandlerOutEvent, ToSwarm, }; -use wasm_timer::Instant; use crate::backoff::BackoffStorage; use crate::config::{Config, ValidationMode}; @@ -67,7 +68,6 @@ use crate::{PublishError, SubscriptionError, ValidationError}; use instant::SystemTime; use quick_protobuf::{MessageWrite, Writer}; use std::{cmp::Ordering::Equal, fmt::Debug}; -use wasm_timer::Interval; #[cfg(test)] mod tests; @@ -289,7 +289,7 @@ pub struct Behaviour { mcache: MessageCache, /// Heartbeat interval stream. - heartbeat: Interval, + heartbeat: Ticker, /// Number of heartbeats since the beginning of time; this allows us to amortize some resource /// clean up -- eg backoff clean up. @@ -307,7 +307,7 @@ pub struct Behaviour { /// Stores optional peer score data together with thresholds, decay interval and gossip /// promises. - peer_score: Option<(PeerScore, PeerScoreThresholds, Interval, GossipPromises)>, + peer_score: Option<(PeerScore, PeerScoreThresholds, Ticker, GossipPromises)>, /// Counts the number of `IHAVE` received from each peer since the last heartbeat. count_received_ihave: HashMap, @@ -460,9 +460,9 @@ where config.backoff_slack(), ), mcache: MessageCache::new(config.history_gossip(), config.history_length()), - heartbeat: Interval::new_at( - Instant::now() + config.heartbeat_initial_delay(), + heartbeat: Ticker::new_with_next( config.heartbeat_interval(), + config.heartbeat_initial_delay(), ), heartbeat_ticks: 0, px_peers: HashSet::new(), @@ -908,7 +908,7 @@ where return Err("Peer score set twice".into()); } - let interval = Interval::new(params.decay_interval); + let interval = Ticker::new(params.decay_interval); let peer_score = PeerScore::new_with_message_delivery_time_callback(params, callback); self.peer_score = Some((peer_score, threshold, interval, GossipPromises::default())); Ok(()) @@ -1175,7 +1175,7 @@ where } fn score_below_threshold_from_scores( - peer_score: &Option<(PeerScore, PeerScoreThresholds, Interval, GossipPromises)>, + peer_score: &Option<(PeerScore, PeerScoreThresholds, Ticker, GossipPromises)>, peer_id: &PeerId, threshold: impl Fn(&PeerScoreThresholds) -> f64, ) -> (bool, f64) { @@ -3472,12 +3472,12 @@ where // update scores if let Some((peer_score, _, interval, _)) = &mut self.peer_score { - while let Poll::Ready(Some(())) = interval.poll_next_unpin(cx) { + while let Poll::Ready(Some(_)) = interval.poll_next_unpin(cx) { peer_score.refresh_scores(); } } - while let Poll::Ready(Some(())) = self.heartbeat.poll_next_unpin(cx) { + while let Poll::Ready(Some(_)) = self.heartbeat.poll_next_unpin(cx) { self.heartbeat(); } @@ -3684,7 +3684,8 @@ impl fmt::Debug for Behaviour { /// The element that expires From c0d250dc17208847e2aa9027183c58c39e1267ad Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Tue, 23 May 2023 12:16:37 +0300 Subject: [PATCH 6/8] bump `instant` to `0.1.12` --- core/Cargo.toml | 2 +- libp2p/Cargo.toml | 2 +- misc/metrics/Cargo.toml | 2 +- protocols/dcutr/Cargo.toml | 2 +- protocols/kad/Cargo.toml | 2 +- protocols/perf/Cargo.toml | 2 +- protocols/ping/Cargo.toml | 2 +- protocols/relay/Cargo.toml | 2 +- protocols/rendezvous/Cargo.toml | 2 +- protocols/request-response/Cargo.toml | 2 +- swarm/Cargo.toml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index 03e92dc6e6b..6593e44755d 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -15,7 +15,7 @@ either = "1.5" fnv = "1.0" futures = { version = "0.3.28", features = ["executor", "thread-pool"] } futures-timer = "3" -instant = "0.1.11" +instant = "0.1.12" libp2p-identity = { workspace = true, features = ["peerid", "ed25519"] } log = "0.4" multiaddr = { version = "0.17.1" } diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index 11d64656d4d..218dd8b763b 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -92,7 +92,7 @@ bytes = "1" futures = "0.3.26" futures-timer = "3.0.2" # Explicit dependency to be used in `wasm-bindgen` feature getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature -instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature +instant = "0.1.12" # Explicit dependency to be used in `wasm-bindgen` feature libp2p-allow-block-list = { workspace = true } libp2p-autonat = { workspace = true, optional = true } diff --git a/misc/metrics/Cargo.toml b/misc/metrics/Cargo.toml index 9126d5485e0..35883fbea0f 100644 --- a/misc/metrics/Cargo.toml +++ b/misc/metrics/Cargo.toml @@ -19,7 +19,7 @@ relay = ["libp2p-relay"] dcutr = ["libp2p-dcutr"] [dependencies] -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-dcutr = { workspace = true, optional = true } libp2p-identify = { workspace = true, optional = true } diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index 05cf2a62ec6..9e54a807733 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -15,7 +15,7 @@ asynchronous-codec = "0.6" either = "1.6.0" futures = "0.3.28" futures-timer = "3.0" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 561d6e4c424..5fdfbd9bc77 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -29,7 +29,7 @@ uint = "0.9" unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } void = "1.0" futures-timer = "3.0.2" -instant = "0.1.11" +instant = "0.1.12" serde = { version = "1.0", optional = true, features = ["derive"] } thiserror = "1" diff --git a/protocols/perf/Cargo.toml b/protocols/perf/Cargo.toml index cff9179817e..7df42017d1b 100644 --- a/protocols/perf/Cargo.toml +++ b/protocols/perf/Cargo.toml @@ -16,7 +16,7 @@ async-std = { version = "1.9.0", features = ["attributes"] } clap = { version = "4.2.7", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.28" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-dns = { workspace = true, features = ["async-std"] } libp2p-identity = { workspace = true } diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 573a1170e86..5cd51c0af31 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"] either = "1.8.0" futures = "0.3.28" futures-timer = "3.0.2" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index f352358561b..daba876d021 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -16,7 +16,7 @@ bytes = "1" either = "1.6.0" futures = "0.3.28" futures-timer = "3" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true, features = ["async-std"] } libp2p-identity = { workspace = true } diff --git a/protocols/rendezvous/Cargo.toml b/protocols/rendezvous/Cargo.toml index ce5e9dfbeaf..7e421a5b17a 100644 --- a/protocols/rendezvous/Cargo.toml +++ b/protocols/rendezvous/Cargo.toml @@ -15,7 +15,7 @@ asynchronous-codec = "0.6" bimap = "0.6.3" futures = { version = "0.3", default-features = false, features = ["std"] } futures-timer = "3.0.2" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index 55108a2411f..35de8245797 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] async-trait = "0.1" futures = "0.3.28" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index b707de8ce34..81d8883a041 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -15,7 +15,7 @@ either = "1.6.0" fnv = "1.0" futures = "0.3.28" futures-timer = "3.0.2" -instant = "0.1.11" +instant = "0.1.12" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } libp2p-swarm-derive = { workspace = true, optional = true } From 1e3fe8b6a24cf62ea22c20cdc24fbcefd196e305 Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Tue, 23 May 2023 12:47:43 +0300 Subject: [PATCH 7/8] re-order gossipsub dependencies --- protocols/gossipsub/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index 2a299dbc0dc..bff4896b807 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -14,7 +14,6 @@ categories = ["network-programming", "asynchronous"] wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"] [dependencies] -futures-ticker = "0.0.2" asynchronous-codec = "0.6" base64 = "0.21.0" byteorder = "1.3.4" @@ -22,6 +21,7 @@ bytes = "1.4" either = "1.5" fnv = "1.0.7" futures = "0.3.28" +futures-ticker = "0.0.2" getrandom = "0.2.9" hex_fmt = "0.3.0" instant = "0.1.12" From 9a00bab0b712679d2ca0b0a96df28949b2f117c7 Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Wed, 24 May 2023 22:47:26 +0300 Subject: [PATCH 8/8] bump `futures-ticker` to `0.0.3` Signed-off-by: ozkanonur --- Cargo.lock | 4 ++-- protocols/gossipsub/Cargo.toml | 2 +- protocols/gossipsub/src/behaviour.rs | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78ffea64fb4..39cde86ed5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1741,9 +1741,9 @@ checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-ticker" -version = "0.0.2" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009df77691585f6fb46aab60c00039a4d718ae90db73ae9e36fb290358c86658" +checksum = "9763058047f713632a52e916cc7f6a4b3fc6e9fc1ff8c5b1dc49e5a89041682e" dependencies = [ "futures", "futures-timer", diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index bff4896b807..eef4d954a8e 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -21,7 +21,7 @@ bytes = "1.4" either = "1.5" fnv = "1.0.7" futures = "0.3.28" -futures-ticker = "0.0.2" +futures-ticker = "0.0.3" getrandom = "0.2.9" hex_fmt = "0.3.0" instant = "0.1.12" diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index 484f3d2ab7d..1000a18e7c0 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -3684,8 +3684,7 @@ impl fmt::Debug for Behaviour