From 9805339e384068537b8970031d5b13dff8586a1c Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 29 Mar 2024 12:34:30 +0100 Subject: [PATCH] feat(dht)!: update republish interval and expiration time defaults This patch applies changes from https://github.com/libp2p/specs/pull/451. In particular, the new defaults are: - Record Expiration: 48h - Record Republish Interval: 22h Closes #3229. Pull-Request: #3230. --- protocols/kad/CHANGELOG.md | 2 ++ protocols/kad/src/behaviour.rs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index a6578a5882b..c300b3127da 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -2,6 +2,8 @@ - Changed `FIND_NODE` response: now includes a list of closest peers when querying the recipient peer ID. Previously, this request yielded an empty response. See [PR 5270](https://github.com/libp2p/rust-libp2p/pull/5270) +- Update to DHT republish interval and expiration time defaults to 22h and 48h respectively, rationale in [libp2p/specs#451](https://github.com/libp2p/specs/pull/451) + See [PR 3230](https://github.com/libp2p/rust-libp2p/pull/3230) ## 0.45.4 diff --git a/protocols/kad/src/behaviour.rs b/protocols/kad/src/behaviour.rs index 742ae1e4bd1..77ce78da237 100644 --- a/protocols/kad/src/behaviour.rs +++ b/protocols/kad/src/behaviour.rs @@ -220,12 +220,12 @@ impl Config { kbucket_pending_timeout: Duration::from_secs(60), query_config: QueryConfig::default(), protocol_config: ProtocolConfig::new(protocol_name), - record_ttl: Some(Duration::from_secs(36 * 60 * 60)), + record_ttl: Some(Duration::from_secs(48 * 60 * 60)), record_replication_interval: Some(Duration::from_secs(60 * 60)), - record_publication_interval: Some(Duration::from_secs(24 * 60 * 60)), + record_publication_interval: Some(Duration::from_secs(22 * 60 * 60)), record_filtering: StoreInserts::Unfiltered, provider_publication_interval: Some(Duration::from_secs(12 * 60 * 60)), - provider_record_ttl: Some(Duration::from_secs(24 * 60 * 60)), + provider_record_ttl: Some(Duration::from_secs(48 * 60 * 60)), kbucket_inserts: BucketInserts::OnConnected, caching: Caching::Enabled { max_peers: 1 }, periodic_bootstrap_interval: Some(Duration::from_secs(5 * 60)),