Merge branch 'unstable' of https://github.com/sigp/lighthouse into single_attestation

This commit is contained in:
Eitan Seri-Levi
2024-12-23 13:45:20 +07:00
223 changed files with 3748 additions and 3102 deletions

View File

@@ -141,10 +141,6 @@ impl<E: EthSpec> NetworkBehaviour for PeerManager<E> {
debug!(self.log, "Failed to dial peer"; "peer_id"=> ?peer_id, "error" => %ClearDialError(error));
self.on_dial_failure(peer_id);
}
FromSwarm::ExternalAddrConfirmed(_) => {
// We have an external address confirmed, means we are able to do NAT traversal.
metrics::set_gauge_vec(&metrics::NAT_OPEN, &["libp2p"], 1);
}
_ => {
// NOTE: FromSwarm is a non exhaustive enum so updates should be based on release
// notes more than compiler feedback

View File

@@ -964,6 +964,9 @@ where
request_info: (Id, RequestType<E>),
error: StreamUpgradeError<RPCError>,
) {
// This dialing is now considered failed
self.dial_negotiated -= 1;
let (id, req) = request_info;
// map the error
@@ -989,9 +992,6 @@ where
StreamUpgradeError::Apply(other) => other,
};
// This dialing is now considered failed
self.dial_negotiated -= 1;
self.outbound_io_error_retries = 0;
self.events_out
.push(HandlerEvent::Err(HandlerErr::Outbound {

View File

@@ -67,7 +67,6 @@ pub struct SamplingRequestId(pub usize);
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
pub struct CustodyId {
pub requester: CustodyRequester,
pub req_id: Id,
}
/// Downstream components that perform custody by root requests.

View File

@@ -250,18 +250,17 @@ impl futures::stream::Stream for GossipCache {
Poll::Ready(Some(expired)) => {
let expected_key = expired.key();
let (topic, data) = expired.into_inner();
match self.topic_msgs.get_mut(&topic) {
Some(msgs) => {
let key = msgs.remove(&data);
debug_assert_eq!(key, Some(expected_key));
if msgs.is_empty() {
// no more messages for this topic.
self.topic_msgs.remove(&topic);
}
}
None => {
#[cfg(debug_assertions)]
panic!("Topic for registered message is not present.")
let topic_msg = self.topic_msgs.get_mut(&topic);
debug_assert!(
topic_msg.is_some(),
"Topic for registered message is not present."
);
if let Some(msgs) = topic_msg {
let key = msgs.remove(&data);
debug_assert_eq!(key, Some(expected_key));
if msgs.is_empty() {
// no more messages for this topic.
self.topic_msgs.remove(&topic);
}
}
Poll::Ready(Some(Ok(topic)))