diff --git a/Cargo.lock b/Cargo.lock index 8246d7586..595a930d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4952,6 +4952,16 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[package]] +name = "humantime-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] + [[package]] name = "hyper" version = "0.14.28" @@ -6300,6 +6310,7 @@ dependencies = [ "futures", "fxhash", "hex", + "humantime-serde", "hyper 0.14.28", "lightning-blockstore", "lightning-interfaces", @@ -6541,6 +6552,7 @@ dependencies = [ "fleek-crypto", "fleek-ipld", "futures", + "humantime-serde", "hyper 0.14.28", "hyper-rustls", "libipld", @@ -6568,6 +6580,7 @@ version = "0.0.0" dependencies = [ "anyhow", "fleek-crypto", + "humantime-serde", "lightning-application", "lightning-interfaces", "lightning-metrics", @@ -6596,6 +6609,7 @@ dependencies = [ "fleek-crypto", "futures", "hp-fixed", + "humantime-serde", "lightning-application", "lightning-interfaces", "lightning-metrics", @@ -6807,6 +6821,7 @@ dependencies = [ "async-channel 2.2.0", "fleek-crypto", "futures", + "humantime-serde", "lightning-interfaces", "lightning-metrics", "lightning-utils", diff --git a/Cargo.toml b/Cargo.toml index e86893b2c..62030accc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,7 @@ reqwest = "0.11.18" serde = { version = "1.0", features = ["derive"] } serde-big-array = "0.5.1" serde_json = "1.0.96" +humantime-serde = "1.1.1" thiserror = "1.0" tempdir = "0.3" parking_lot = "0.12.1" diff --git a/core/handshake/Cargo.toml b/core/handshake/Cargo.toml index c49c02891..e1583c091 100644 --- a/core/handshake/Cargo.toml +++ b/core/handshake/Cargo.toml @@ -12,6 +12,7 @@ fn-sdk = { path = "../../lib/sdk" } tracing.workspace = true anyhow.workspace = true serde.workspace = true +humantime-serde.workspace = true fleek-crypto.workspace = true async-trait.workspace = true futures.workspace = true diff --git a/core/handshake/src/config.rs b/core/handshake/src/config.rs index a216de3b9..025e1045f 100644 --- a/core/handshake/src/config.rs +++ b/core/handshake/src/config.rs @@ -17,6 +17,7 @@ pub struct HandshakeConfig { /// Optional http configuration pub https: Option, /// Timeout for disconnected sessions + #[serde(with = "humantime_serde")] pub timeout: Duration, } diff --git a/core/origin-ipfs/Cargo.toml b/core/origin-ipfs/Cargo.toml index 198e4e1e1..53d59ae51 100644 --- a/core/origin-ipfs/Cargo.toml +++ b/core/origin-ipfs/Cargo.toml @@ -8,6 +8,7 @@ lightning-interfaces = { path = "../interfaces" } fleek-ipld.workspace = true anyhow.workspace = true serde.workspace = true +humantime-serde.workspace = true tokio-stream.workspace = true bytes.workspace = true cid.workspace = true diff --git a/core/origin-ipfs/src/config.rs b/core/origin-ipfs/src/config.rs index f43f4a0c7..c7c6afd77 100644 --- a/core/origin-ipfs/src/config.rs +++ b/core/origin-ipfs/src/config.rs @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] pub struct Config { pub gateways: Vec, + #[serde(with = "humantime_serde")] pub gateway_timeout: Duration, } diff --git a/core/pinger/Cargo.toml b/core/pinger/Cargo.toml index 36957eca4..bb6c3e04f 100644 --- a/core/pinger/Cargo.toml +++ b/core/pinger/Cargo.toml @@ -12,6 +12,7 @@ lightning-metrics = { path = "../metrics" } tokio.workspace = true anyhow.workspace = true serde.workspace = true +humantime-serde.workspace = true rand.workspace = true tracing.workspace = true fleek-crypto.workspace = true diff --git a/core/pinger/src/config.rs b/core/pinger/src/config.rs index cb9487da8..4762cc7b0 100644 --- a/core/pinger/src/config.rs +++ b/core/pinger/src/config.rs @@ -9,6 +9,7 @@ pub struct Config { // /// The number of times that we ping each peer per epoch. // pub num_pings_per_peer: u16, /// The interval for sending pings. + #[serde(with = "humantime_serde")] pub ping_interval: Duration, } diff --git a/core/pool/Cargo.toml b/core/pool/Cargo.toml index bc7a593e7..4334ccc20 100644 --- a/core/pool/Cargo.toml +++ b/core/pool/Cargo.toml @@ -18,6 +18,7 @@ lightning-metrics = { path = "../metrics" } lightning-utils = { path = "../utils" } tracing.workspace = true serde.workspace = true +humantime-serde.workspace = true tokio.workspace = true tokio-stream.workspace = true scc.workspace = true diff --git a/core/pool/src/config.rs b/core/pool/src/config.rs index 29129cf57..c17f29f8c 100644 --- a/core/pool/src/config.rs +++ b/core/pool/src/config.rs @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Serialize, Deserialize)] pub struct Config { + #[serde(with = "humantime_serde")] pub max_idle_timeout: Duration, pub address: SocketAddr, pub http: Option, diff --git a/core/syncronizer/Cargo.toml b/core/syncronizer/Cargo.toml index 6940c1946..9fbca9b4c 100644 --- a/core/syncronizer/Cargo.toml +++ b/core/syncronizer/Cargo.toml @@ -15,6 +15,7 @@ tracing.workspace = true reqwest.workspace = true serde_json.workspace = true serde.workspace = true +humantime-serde.workspace = true tokio.workspace = true rand.workspace = true fleek-crypto.workspace = true diff --git a/core/syncronizer/src/config.rs b/core/syncronizer/src/config.rs index ed45575a3..f75f51319 100644 --- a/core/syncronizer/src/config.rs +++ b/core/syncronizer/src/config.rs @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] pub struct Config { + #[serde(with = "humantime_serde")] pub epoch_change_delta: Duration, }