Skip to content

Commit

Permalink
feat(dht)!: update republish interval and expiration time defaults
Browse files Browse the repository at this point in the history
This patch applies changes from libp2p/specs#451. In particular, the new defaults are:

- Record Expiration: 48h
- Record Republish Interval: 22h

Closes #3229.

Pull-Request: #3230.
  • Loading branch information
lidel authored Mar 29, 2024
1 parent 695404d commit 9805339
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions protocols/kad/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions protocols/kad/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit 9805339

Please sign in to comment.