use humantime_serde

This commit is contained in:
Youngjoon Lee 2024-12-06 13:21:56 +09:00
parent d385e9f855
commit 51d8029048
No known key found for this signature in database
GPG Key ID: 303963A54A81DD4D
2 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,7 @@ nomos-mix-message = { path = "../message" }
futures = "0.3"
x25519-dalek = { version = "2", features = ["getrandom", "static_secrets"] }
fixed = { version = "1", features = ["serde-str"] }
humantime-serde = "1"
[dev-dependencies]

View File

@ -233,6 +233,7 @@ pub struct ConnectionMonitor {
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub struct ConnectionMonitorSettings {
/// Time interval to measure/evaluate the number of messages sent by each peer.
#[serde(with = "humantime_serde")]
pub time_window: Duration,
/// The number of effective (data or cover) messages that a peer is expected to send in a given time window.
/// If the measured count is greater than (expected * (1 + tolerance)), the peer is considered malicious.