Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protocols/identify: Disable address cache by default #2312

Merged
merged 2 commits into from Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions protocols/identify/CHANGELOG.md
Expand Up @@ -5,9 +5,9 @@

- Update dependencies.

- Assist in peer discovery by returning reported listen addresses
of other peers from `addresses_of_peer`.
[PR 2232](https://github.com/libp2p/rust-libp2p/pull/2232)
- Assist in peer discovery by optionally returning reported listen addresses
of other peers from `addresses_of_peer` (see [PR
2232](https://github.com/libp2p/rust-libp2p/pull/2232)), disabled by default.

# 0.30.0 [2021-07-12]

Expand Down
5 changes: 4 additions & 1 deletion protocols/identify/src/identify.rs
Expand Up @@ -116,6 +116,8 @@ pub struct IdentifyConfig {

/// How many entries of discovered peers to keep before we discard
/// the least-recently used one.
///
/// Disabled by default.
pub cache_size: usize,
}

Expand All @@ -130,7 +132,7 @@ impl IdentifyConfig {
initial_delay: Duration::from_millis(500),
interval: Duration::from_secs(5 * 60),
push_listen_addr_updates: false,
cache_size: 100,
cache_size: 0,
}
}

Expand Down Expand Up @@ -695,6 +697,7 @@ mod tests {
let (pubkey, transport) = transport();
let protocol = Identify::new(
IdentifyConfig::new("a".to_string(), pubkey.clone())
.with_cache_size(100)
.with_agent_version("b".to_string()),
);

Expand Down