Skip to content

gossipsub config unsubscribe_backoff should expect a Duration #6120

@sirandreww-starkware

Description

@sirandreww-starkware

Description

Currently the function unsubscribe_backoff expects a number of seconds instead of a duration.
This seems off since other functions expect Duration (like prune_backoff)

Motivation

I want to be able to use sub second backoff durations

Current Implementation

In protocols/gossipsub/src/config.rs

/// Controls the backoff time when unsubscribing from a topic.
///
/// This is how long to wait before resubscribing to the topic. A short backoff period in case
/// of an unsubscribe event allows reaching a healthy mesh in a more timely manner. The default
/// is 10 seconds.
pub fn unsubscribe_backoff(&mut self, unsubscribe_backoff: u64) -> &mut Self {
    self.config.unsubscribe_backoff = Duration::from_secs(unsubscribe_backoff);
    self
}

Are you planning to do it yourself in a pull request?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions