From 78fc4c645e6f3c6fff89c3a7133528ddccbd723c Mon Sep 17 00:00:00 2001 From: Patrick Beza Date: Fri, 6 Sep 2024 11:53:47 +0200 Subject: [PATCH] fix(tee-prover): fix deserialization of duration in envy config Relevant logs from the `stage` environment showcasing the issue: https://grafana.matterlabs.dev/goto/IC-9k4eIR?orgId=1 Error message from the above logs: ``` Error: missing value for field initial_retry_backoff ``` --- core/bin/zksync_tee_prover/src/config.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/bin/zksync_tee_prover/src/config.rs b/core/bin/zksync_tee_prover/src/config.rs index 5b009e33f25e..e8193eceec77 100644 --- a/core/bin/zksync_tee_prover/src/config.rs +++ b/core/bin/zksync_tee_prover/src/config.rs @@ -2,6 +2,7 @@ use std::{path::PathBuf, time::Duration}; use secp256k1::SecretKey; use serde::Deserialize; +use serde_with::{serde_as, DurationSecondsWithFrac}; use url::Url; use zksync_env_config::FromEnv; use zksync_types::tee_types::TeeType; @@ -22,10 +23,12 @@ pub(crate) struct TeeProverConfig { pub max_retries: usize, /// Initial back-off interval when retrying recovery on a retriable error. Each subsequent retry interval /// will be multiplied by [`Self.retry_backoff_multiplier`]. + #[serde_as(as = "DurationSecondsWithFrac")] pub initial_retry_backoff: Duration, /// Multiplier for the back-off interval when retrying recovery on a retriable error. pub retry_backoff_multiplier: f32, /// Maximum back-off interval when retrying recovery on a retriable error. + #[serde_as(as = "DurationSecondsWithFrac")] pub max_backoff: Duration, }