diff --git a/core/lib/protobuf_config/src/consensus.rs b/core/lib/protobuf_config/src/consensus.rs index ceec0a8d3ea..967537d13d0 100644 --- a/core/lib/protobuf_config/src/consensus.rs +++ b/core/lib/protobuf_config/src/consensus.rs @@ -4,7 +4,7 @@ use zksync_config::configs::consensus::{ AttesterPublicKey, ConsensusConfig, GenesisSpec, Host, NodePublicKey, ProtocolVersion, RpcConfig, ValidatorPublicKey, WeightedAttester, WeightedValidator, }; -use zksync_protobuf::{kB, read_optional, repr::ProtoRepr, required, ProtoFmt}; +use zksync_protobuf::{kB, read_optional, read_required, repr::ProtoRepr, required, ProtoFmt}; use crate::{parse_h160, proto::consensus as proto, read_optional_repr}; @@ -154,7 +154,7 @@ impl ProtoRepr for proto::Config { .context("server_addr")?, public_addr: Host(required(&self.public_addr).context("public_addr")?.clone()), max_payload_size, - view_timeout: required(&self.view_timeout).context("view_timeout")?, + view_timeout: read_required(&self.view_timeout).context("view_timeout")?, max_batch_size, gossip_dynamic_inbound_limit: required(&self.gossip_dynamic_inbound_limit) .and_then(|x| Ok((*x).try_into()?)) diff --git a/core/node/consensus/src/config.rs b/core/node/consensus/src/config.rs index 80763c82247..0d25a375930 100644 --- a/core/node/consensus/src/config.rs +++ b/core/node/consensus/src/config.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap}; use anyhow::Context as _; use secrecy::{ExposeSecret as _, Secret}; -use zksync_concurrency::{limiter, net, time}; +use zksync_concurrency::net; use zksync_config::{ configs, configs::consensus::{ConsensusConfig, ConsensusSecrets, Host, NodePublicKey}, diff --git a/core/node/consensus/src/testonly.rs b/core/node/consensus/src/testonly.rs index 4799bb26df8..b9bc420344c 100644 --- a/core/node/consensus/src/testonly.rs +++ b/core/node/consensus/src/testonly.rs @@ -149,7 +149,7 @@ fn make_config( public_addr: config::Host(cfg.public_addr.0.clone()), max_payload_size: usize::MAX, max_batch_size: usize::MAX, - view_timeout: usize::MAX, + view_timeout: time::Duration::milliseconds(10000), gossip_dynamic_inbound_limit: cfg.gossip.dynamic_inbound_limit, gossip_static_inbound: cfg .gossip