Skip to content

Conversation

@GheisMohammadi
Copy link
Collaborator

This pull request introduces a configurable timeout for the DHT bootstrap process, enhancing the flexibility and observability of peer discovery in the network. A new DiscBootstrapTimeout field has been added to both the host and configuration structures, with a default value set to 30 seconds. This allows operators to better tune the duration of the DHT bootstrap according to their environment or performance needs.

To support this configurability, a new CLI flag --p2p.disc.bootstrap-timeout has been registered. This flag is now part of the default configuration and can be set via the command line, giving users a straightforward way to adjust the timeout without modifying the codebase. Additionally, the bootstrap duration is now logged, providing useful diagnostics for monitoring and debugging DHT discovery behavior.

The PR also includes a cleanup in the stream manager’s peer discovery logic. Specifically, an unnecessary goroutine was removed to simplify the control flow. This change reduces complexity and improves the maintainability of the peer discovery process without altering its functionality.

…ng of the bootstrap duration

* Introduced DiscBootstrapTimeout into host and configuration structures and set a default value of 30 seconds

* Registered a new CLI flag p2p.disc.bootstrap-timeout and included it in the default configuration

* Simplified the stream manager’s peer discovery by removing an unnecessary goroutine
@GheisMohammadi GheisMohammadi self-assigned this Jun 2, 2025
@GheisMohammadi GheisMohammadi force-pushed the add/bootstrap_timeout branch from ff0477b to 2d6143f Compare June 9, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants