-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/basic-overlay'
- Loading branch information
Showing
18 changed files
with
1,913 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::time::Duration; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
use tycho_util::serde_helpers; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(default)] | ||
pub struct OverlayConfig { | ||
/// Maximum time to live for public overlay peer entries. | ||
/// | ||
/// Default: 1 hour. | ||
#[serde(with = "serde_helpers::humantime")] | ||
pub max_public_entry_tll: Duration, | ||
|
||
/// A period of exchanging public overlay peers. | ||
/// | ||
/// Default: 3 minutes. | ||
#[serde(with = "serde_helpers::humantime")] | ||
pub public_overlay_peer_exchange_period: Duration, | ||
|
||
/// A maximum value of a random jitter for the peer exchange period. | ||
/// | ||
/// Default: 30 seconds. | ||
pub public_overlay_peer_exchange_max_jitter: Duration, | ||
|
||
/// Number of peers to send during entries exchange request. | ||
/// | ||
/// Default: 20. | ||
pub exchange_public_entries_batch: usize, | ||
} | ||
|
||
impl Default for OverlayConfig { | ||
fn default() -> Self { | ||
Self { | ||
max_public_entry_tll: Duration::from_secs(3600), | ||
public_overlay_peer_exchange_period: Duration::from_secs(3 * 60), | ||
public_overlay_peer_exchange_max_jitter: Duration::from_secs(30), | ||
exchange_public_entries_batch: 20, | ||
} | ||
} | ||
} |
Oops, something went wrong.