diff --git a/src/eth/consensus/mod.rs b/src/eth/consensus/mod.rs index d2e2c28d9..f9577832d 100644 --- a/src/eth/consensus/mod.rs +++ b/src/eth/consensus/mod.rs @@ -60,6 +60,7 @@ const RETRY_DELAY: Duration = Duration::from_millis(10); #[derive(Clone, Debug, PartialEq)] enum Role { _Leader, //TODO implement leader election + #[cfg(feature = "kubernetes")] Follower, _Candidate, } @@ -281,6 +282,7 @@ impl Consensus { #[tracing::instrument(skip_all)] pub async fn discover_peers(consensus: Arc) -> Result<(), anyhow::Error> { + #[cfg_attr(not(feature = "kubernetes"), allow(unused_mut))] let mut peers: Vec<(String, Peer)> = Vec::new(); #[cfg(feature = "kubernetes")] diff --git a/src/eth/storage/rocks/rocks_state.rs b/src/eth/storage/rocks/rocks_state.rs index 9dde72784..1c01407c1 100644 --- a/src/eth/storage/rocks/rocks_state.rs +++ b/src/eth/storage/rocks/rocks_state.rs @@ -1,4 +1,5 @@ use core::fmt; +use std::collections::HashMap; use std::path::Path; use std::path::PathBuf; use std::sync::atomic::AtomicU64; @@ -53,7 +54,6 @@ use crate::utils::GIGABYTE; cfg_if::cfg_if! { if #[cfg(feature = "metrics")] { - use std::collections::HashMap; use std::sync::Mutex; use rocksdb::statistics::Histogram; @@ -113,6 +113,7 @@ impl RocksStorageState { let db_path = path.as_ref().to_path_buf(); let (backup_trigger_tx, backup_trigger_rx) = mpsc::channel::<()>(1); + #[cfg_attr(not(feature = "metrics"), allow(unused_variables))] let (db, db_options) = create_or_open_db(&db_path, &CF_OPTIONS_MAP).unwrap(); //XXX TODO while repair/restore from backup, make sure to sync online and only when its in sync with other nodes, receive requests