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

feat(identify): immediately run identify protocol on new connections #3545

Merged
merged 22 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
45c9f1f
feat(identify): Remove initial delay before running the identify prot…
PopBogdan97 Mar 3, 2023
a0e982e
docs(identify): Update changelog and docs for the initial delay
PopBogdan97 Mar 3, 2023
d28466b
docs(identify): Update changelog with PR
PopBogdan97 Mar 3, 2023
ce983c5
feat(identify): Update Changelog and Cargo.toml files
PopBogdan97 Mar 3, 2023
a0c07bb
fix(identify): Update formatted file
PopBogdan97 Mar 3, 2023
1fce7ca
Update protocols/identify/src/behaviour.rs typo
PopBogdan97 Mar 8, 2023
885b719
Update protocols/identify/src/behaviour.rs typo
PopBogdan97 Mar 8, 2023
196a2b8
Update Cargo.toml - don't bump version
PopBogdan97 Mar 8, 2023
070e3f9
Update protocols/identify/CHANGELOG.md
PopBogdan97 Mar 8, 2023
bc0e86a
Update deprecation note with package version
PopBogdan97 Mar 8, 2023
476ffe9
Update deprecation note with package version
PopBogdan97 Mar 8, 2023
b78218e
Revert changelog with the bumped version
PopBogdan97 Mar 8, 2023
fc40b1d
Merge branch 'master' into remove_init_delay-3485
PopBogdan97 Mar 8, 2023
358b05d
Merge branch 'master' into remove_init_delay-3485
thomaseizinger Mar 11, 2023
4196643
Merge branch 'master' into remove_init_delay-3485
PopBogdan97 Mar 19, 2023
46aec77
Merge branch 'master' into remove_init_delay-3485
PopBogdan97 May 2, 2023
defa5a1
fix(version): Update version on PR
PopBogdan97 May 2, 2023
361c672
feat(pass CI): Insert allow(deprecated) attributes to make CI pass
PopBogdan97 May 2, 2023
dc0838a
feat(pass CI): Inserta allow(deprecated) attribute and format
PopBogdan97 May 2, 2023
db09721
Merge branch 'master' into remove_init_delay-3485
mergify[bot] May 2, 2023
1500b76
Merge branch 'master' into remove_init_delay-3485
thomaseizinger May 2, 2023
8eb630a
Merge branch 'master' into remove_init_delay-3485
mergify[bot] May 2, 2023
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
4 changes: 4 additions & 0 deletions protocols/identify/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

- Migrate from `prost` to `quick-protobuf`. This removes `protoc` dependency. See [PR 3312].

- Reduce the initial delay before running the identify protocol to 0 and make the option deprecated.
See [PR 3545].

[PR 3312]: https://github.com/libp2p/rust-libp2p/pull/3312
[PR 3545]: https://github.com/libp2p/rust-libp2p/pull/3545

# 0.42.0

Expand Down
16 changes: 14 additions & 2 deletions protocols/identify/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ pub struct Config {
/// The initial delay before the first identification request
/// is sent to a remote on a newly established connection.
///
/// Defaults to 500ms.
/// Defaults to 0ms.
#[deprecated(
since = "0.42.1",
note = "The `initial_delay` is no longer necessary and will be
completely removed since a remote should be able to instantly
answer to an identify request"
)]
pub initial_delay: Duration,
/// The interval at which identification requests are sent to
/// the remote on established connections after the first request,
Expand Down Expand Up @@ -123,7 +129,7 @@ impl Config {
protocol_version,
agent_version: format!("rust-libp2p/{}", env!("CARGO_PKG_VERSION")),
local_public_key,
initial_delay: Duration::from_millis(500),
initial_delay: Duration::from_millis(0),
interval: Duration::from_secs(5 * 60),
push_listen_addr_updates: false,
cache_size: 100,
Expand All @@ -138,6 +144,12 @@ impl Config {

/// Configures the initial delay before the first identification
/// request is sent on a newly established connection to a peer.
#[deprecated(
since = "0.42.1",
note = "The `initial_delay` is no longer necessary and will be
completely removed since a remote should be able to instantly
answer to an identify request thus also this setter will be removed"
)]
pub fn with_initial_delay(mut self, d: Duration) -> Self {
self.initial_delay = d;
self
Expand Down