pub struct ClusterConfig {
pub node_id: NodeId,
pub node_name: String,
pub platform: NodePlatform,
pub heartbeat_interval_secs: u64,
pub suspect_threshold: u32,
pub unreachable_threshold: u32,
pub max_nodes: u32,
pub bind_address: Option<String>,
pub seed_peers: Vec<String>,
pub identity_key_path: Option<PathBuf>,
pub peer_add_max_per_source: u32,
pub peer_add_window_ms: u64,
}Expand description
Cluster configuration.
Fields§
§node_id: NodeIdThis node’s identifier.
node_name: StringThis node’s display name.
platform: NodePlatformThis node’s platform type.
heartbeat_interval_secs: u64Heartbeat interval in seconds.
suspect_threshold: u32How many missed heartbeats before marking a node suspect.
unreachable_threshold: u32How many missed heartbeats before marking a node unreachable.
max_nodes: u32Maximum cluster size (0 = unlimited).
bind_address: Option<String>Address to bind the mesh listener (e.g., “0.0.0.0:9489”).
seed_peers: Vec<String>Seed peers for bootstrap discovery.
identity_key_path: Option<PathBuf>Path to Ed25519 identity key file.
peer_add_max_per_source: u32Max add_peer calls allowed per source within
Self::peer_add_window_ms (WEFT-148).
0 disables peer-add rate limiting. Default: 1.
peer_add_window_ms: u64Sliding window for peer-add rate limiting, in milliseconds. Default: 100.
Implementations§
Source§impl ClusterConfig
impl ClusterConfig
Sourcepub fn peer_add_rate_config(&self) -> RateLimitConfig
pub fn peer_add_rate_config(&self) -> RateLimitConfig
Build a crate::rate_limit::RateLimitConfig from the peer-add
rate-limit fields (WEFT-148).
Sourcepub fn recommended_heartbeat_secs(
&self,
model: Option<&GossipTimingModel>,
peer_count: usize,
network_latency_ms: f64,
update_frequency_hz: f64,
) -> u64
pub fn recommended_heartbeat_secs( &self, model: Option<&GossipTimingModel>, peer_count: usize, network_latency_ms: f64, update_frequency_hz: f64, ) -> u64
Recommend the heartbeat / gossip interval (seconds), consulting
an optional learned
GossipTimingModel.
When model is None or untrained, returns
self.heartbeat_interval_secs unchanged (current behaviour).
When trained, the model’s per-context recommendation is used,
rounded to whole seconds and clamped to the model’s [1, 60]
range.
peer_count and network_latency_ms and update_frequency_hz
feed the model when trained; pass (0, 0.0, 0.0) if not
available.
Without the ecc feature this always returns
self.heartbeat_interval_secs (WEFT-114).
NOTE(eml-swap): wired — Finding #5 (GossipTimingModel).
Trait Implementations§
Source§impl Clone for ClusterConfig
impl Clone for ClusterConfig
Source§impl Debug for ClusterConfig
impl Debug for ClusterConfig
Source§impl Default for ClusterConfig
impl Default for ClusterConfig
Source§impl<'de> Deserialize<'de> for ClusterConfig
impl<'de> Deserialize<'de> for ClusterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ClusterConfig
impl RefUnwindSafe for ClusterConfig
impl Send for ClusterConfig
impl Sync for ClusterConfig
impl Unpin for ClusterConfig
impl UnsafeUnpin for ClusterConfig
impl UnwindSafe for ClusterConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more