Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ libp2p-quic = { version = "0.12.1", path = "transports/quic" }
libp2p-relay = { version = "0.20.0", path = "protocols/relay" }
libp2p-rendezvous = { version = "0.16.1", path = "protocols/rendezvous" }
libp2p-request-response = { version = "0.28.1", path = "protocols/request-response" }
libp2p-server = { version = "0.12.7", path = "misc/server" }
libp2p-server = { version = "0.12.8", path = "misc/server" }
libp2p-stream = { version = "0.3.0-alpha.1", path = "protocols/stream" }
libp2p-swarm = { version = "0.47.0", path = "swarm" }
libp2p-swarm-derive = { version = "=0.35.1", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required.
Expand Down
7 changes: 7 additions & 0 deletions misc/server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.12.8

### Changed

- Replace the zero-second TTL hack with proper record filtering in Kademlia.
See [PR 5987](https://github.com/libp2p/rust-libp2p/pull/5987)

## 0.12.7

### Changed
Expand Down
2 changes: 1 addition & 1 deletion misc/server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libp2p-server"
version = "0.12.7"
version = "0.12.8"
authors = ["Max Inden <[email protected]>"]
edition.workspace = true
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
9 changes: 3 additions & 6 deletions misc/server/src/behaviour.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{str::FromStr, time::Duration};
use std::str::FromStr;

use libp2p::{
autonat, identify, identity, kad, ping, relay,
Expand Down Expand Up @@ -32,11 +32,8 @@ impl Behaviour {
) -> Self {
let kademlia = if enable_kademlia {
let mut kademlia_config = kad::Config::new(IPFS_PROTO_NAME);
// Instantly remove records and provider records.
//
// TODO: Replace hack with option to disable both.
kademlia_config.set_record_ttl(Some(Duration::from_secs(0)));
kademlia_config.set_provider_record_ttl(Some(Duration::from_secs(0)));
// Disable storing records and provider records
kademlia_config.set_record_filtering(kad::StoreInserts::FilterBoth);
let mut kademlia = kad::Behaviour::with_config(
pub_key.to_peer_id(),
kad::store::MemoryStore::new(pub_key.to_peer_id()),
Expand Down
Loading