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: Change default cache_size of Config to 100 #2995

Merged
merged 11 commits into from
Nov 4, 2022
3 changes: 3 additions & 0 deletions protocols/identify/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

- Update to `libp2p-swarm` `v0.40.0`.

- Change default `cache_size` of `Config` to 100. See [PR 2995].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With v0.49.0 released, this would need to bump the libp2p-identify version, add a v0.41.0 changelog section, add an entry and adjust the root level Cargo.toml and CHANGELOG.md accordingly.

See https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md

I am sorry for the trouble @efarg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmao no problem. I'll update.


thomaseizinger marked this conversation as resolved.
Show resolved Hide resolved
[PR 2995]: https://github.com/libp2p/rust-libp2p/pull/2995
# 0.39.0

- Update to `libp2p-swarm` `v0.39.0`.
Expand Down
6 changes: 2 additions & 4 deletions protocols/identify/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl Config {
initial_delay: Duration::from_millis(500),
interval: Duration::from_secs(5 * 60),
push_listen_addr_updates: false,
cache_size: 0,
cache_size: 100,
}
}

Expand Down Expand Up @@ -748,9 +748,7 @@ mod tests {
let mut swarm2 = {
let (pubkey, transport) = transport();
let protocol = Behaviour::new(
Config::new("a".to_string(), pubkey.clone())
.with_cache_size(100)
.with_agent_version("b".to_string()),
Config::new("a".to_string(), pubkey.clone()).with_agent_version("b".to_string()),
);

Swarm::new(transport, protocol, pubkey.to_peer_id())
Expand Down