diff --git a/beacon_node/beacon_chain/src/attester_cache.rs b/beacon_node/beacon_chain/src/attester_cache.rs index ae715afcd0c..34a528f212f 100644 --- a/beacon_node/beacon_chain/src/attester_cache.rs +++ b/beacon_node/beacon_chain/src/attester_cache.rs @@ -365,11 +365,7 @@ impl AttesterCache { value: AttesterCacheValue, ) { while cache.len() >= MAX_CACHE_LEN { - if let Some(oldest) = cache - .iter() - .map(|(key, _)| *key) - .min_by_key(|key| key.epoch) - { + if let Some(oldest) = cache.keys().copied().min_by_key(|key| key.epoch) { cache.remove(&oldest); } else { break; diff --git a/beacon_node/beacon_chain/src/validator_monitor.rs b/beacon_node/beacon_chain/src/validator_monitor.rs index e2befe340f1..8d3d748e8cd 100644 --- a/beacon_node/beacon_chain/src/validator_monitor.rs +++ b/beacon_node/beacon_chain/src/validator_monitor.rs @@ -342,7 +342,7 @@ impl MonitoredValidator { // Prune while summaries.len() > HISTORIC_EPOCHS { - if let Some(key) = summaries.iter().map(|(epoch, _)| *epoch).min() { + if let Some(key) = summaries.keys().copied().min() { summaries.remove(&key); } } diff --git a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs index 1ad55ce5c4a..a45b941e58d 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs @@ -106,14 +106,14 @@ impl NetworkBehaviour for PeerManager { if let Some(enr) = self.peers_to_dial.pop() { self.inject_peer_connection(&enr.peer_id(), ConnectingType::Dialing, Some(enr.clone())); + let multiaddr_quic = if self.quic_enabled { + enr.multiaddr_quic() + } else { + vec![] + }; + // Prioritize Quic connections over Tcp ones. - let multiaddrs = [ - self.quic_enabled - .then_some(enr.multiaddr_quic()) - .unwrap_or_default(), - enr.multiaddr_tcp(), - ] - .concat(); + let multiaddrs = [multiaddr_quic, enr.multiaddr_tcp()].concat(); debug!(peer_id = %enr.peer_id(), ?multiaddrs, "Dialing peer"); return Poll::Ready(ToSwarm::Dial { diff --git a/beacon_node/operation_pool/src/lib.rs b/beacon_node/operation_pool/src/lib.rs index 7481aa896a1..642fc51f69d 100644 --- a/beacon_node/operation_pool/src/lib.rs +++ b/beacon_node/operation_pool/src/lib.rs @@ -700,8 +700,8 @@ impl OperationPool { pub fn get_all_proposer_slashings(&self) -> Vec { self.proposer_slashings .read() - .iter() - .map(|(_, slashing)| slashing.as_inner().clone()) + .values() + .map(|slashing| slashing.as_inner().clone()) .collect() } @@ -711,8 +711,8 @@ impl OperationPool { pub fn get_all_voluntary_exits(&self) -> Vec { self.voluntary_exits .read() - .iter() - .map(|(_, exit)| exit.as_inner().clone()) + .values() + .map(|exit| exit.as_inner().clone()) .collect() } diff --git a/beacon_node/operation_pool/src/persistence.rs b/beacon_node/operation_pool/src/persistence.rs index 79509e5f6cc..88c8dbbf3c3 100644 --- a/beacon_node/operation_pool/src/persistence.rs +++ b/beacon_node/operation_pool/src/persistence.rs @@ -86,15 +86,15 @@ impl PersistedOperationPool { let proposer_slashings = operation_pool .proposer_slashings .read() - .iter() - .map(|(_, slashing)| slashing.clone()) + .values() + .cloned() .collect(); let voluntary_exits = operation_pool .voluntary_exits .read() - .iter() - .map(|(_, exit)| exit.clone()) + .values() + .cloned() .collect(); let bls_to_execution_changes = operation_pool diff --git a/testing/execution_engine_integration/src/geth.rs b/testing/execution_engine_integration/src/geth.rs index 8c39fda4e36..91d6c7fd57c 100644 --- a/testing/execution_engine_integration/src/geth.rs +++ b/testing/execution_engine_integration/src/geth.rs @@ -14,6 +14,10 @@ pub fn build_result(repo_dir: &Path) -> Output { Command::new("make") .arg("geth") .current_dir(repo_dir) + // Geth now uses the commit hash from a GitHub runner environment variable if it detects a CI environment. + // We need to override this to successfully build Geth in Lighthouse workflows. + // See: https://github.com/ethereum/go-ethereum/blob/668c3a7278af399c0e776e92f1c721b5158388f2/internal/build/env.go#L95-L121 + .env("CI", "false") .output() .expect("failed to make geth") }