|
1 | 1 | use anyhow::Context as _; |
2 | 2 | use zksync_basic_types::L2ChainId; |
| 3 | +use zksync_concurrency::time; |
3 | 4 | use zksync_config::configs::consensus::{ |
4 | 5 | AttesterPublicKey, ConsensusConfig, GenesisSpec, Host, NodePublicKey, ProtocolVersion, |
5 | 6 | RpcConfig, ValidatorPublicKey, WeightedAttester, WeightedValidator, |
@@ -154,6 +155,11 @@ impl ProtoRepr for proto::Config { |
154 | 155 | .context("server_addr")?, |
155 | 156 | public_addr: Host(required(&self.public_addr).context("public_addr")?.clone()), |
156 | 157 | max_payload_size, |
| 158 | + view_timeout: self |
| 159 | + .view_timeout |
| 160 | + .as_ref() |
| 161 | + .map(|x| time::Duration::read(x).context("view_timeout")) |
| 162 | + .transpose()?, |
157 | 163 | max_batch_size, |
158 | 164 | gossip_dynamic_inbound_limit: required(&self.gossip_dynamic_inbound_limit) |
159 | 165 | .and_then(|x| Ok((*x).try_into()?)) |
@@ -187,6 +193,7 @@ impl ProtoRepr for proto::Config { |
187 | 193 | server_addr: Some(this.server_addr.to_string()), |
188 | 194 | public_addr: Some(this.public_addr.0.clone()), |
189 | 195 | max_payload_size: Some(this.max_payload_size.try_into().unwrap()), |
| 196 | + view_timeout: this.view_timeout.as_ref().map(ProtoFmt::build), |
190 | 197 | max_batch_size: Some(this.max_batch_size.try_into().unwrap()), |
191 | 198 | gossip_dynamic_inbound_limit: Some( |
192 | 199 | this.gossip_dynamic_inbound_limit.try_into().unwrap(), |
|
0 commit comments