resolve merge conlfict

This commit is contained in:
Eitan Seri-Levi
2026-04-23 02:15:26 +09:00
148 changed files with 5482 additions and 1846 deletions

View File

@@ -19,8 +19,8 @@ use lighthouse_network::{
};
use logging::TimeLatch;
use logging::crit;
use slot_clock::SlotClock;
use std::sync::Arc;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use tokio::sync::mpsc;
use tokio_stream::wrappers::UnboundedReceiverStream;
use tracing::{debug, error, trace, warn};
@@ -357,6 +357,7 @@ impl<T: BeaconChainTypes> Router<T> {
gossip_message: PubsubMessage<T::EthSpec>,
should_process: bool,
) {
let seen_timestamp = self.chain.slot_clock.now_duration().unwrap_or_default();
match gossip_message {
PubsubMessage::AggregateAndProofAttestation(aggregate_and_proof) => self
.handle_beacon_processor_send_result(
@@ -364,7 +365,7 @@ impl<T: BeaconChainTypes> Router<T> {
message_id,
peer_id,
*aggregate_and_proof,
timestamp_now(),
seen_timestamp,
),
),
PubsubMessage::Attestation(subnet_attestation) => self
@@ -375,7 +376,7 @@ impl<T: BeaconChainTypes> Router<T> {
subnet_attestation.1,
subnet_attestation.0,
should_process,
timestamp_now(),
seen_timestamp,
),
),
PubsubMessage::BeaconBlock(block) => self.handle_beacon_processor_send_result(
@@ -384,7 +385,7 @@ impl<T: BeaconChainTypes> Router<T> {
peer_id,
self.network_globals.client(&peer_id),
block,
timestamp_now(),
seen_timestamp,
),
),
PubsubMessage::BlobSidecar(data) => {
@@ -396,7 +397,7 @@ impl<T: BeaconChainTypes> Router<T> {
self.network_globals.client(&peer_id),
blob_index,
blob_sidecar,
timestamp_now(),
seen_timestamp,
),
)
}
@@ -409,7 +410,7 @@ impl<T: BeaconChainTypes> Router<T> {
peer_id,
subnet_id,
column_sidecar,
timestamp_now(),
seen_timestamp,
),
)
}
@@ -456,7 +457,7 @@ impl<T: BeaconChainTypes> Router<T> {
message_id,
peer_id,
*contribution_and_proof,
timestamp_now(),
seen_timestamp,
),
)
}
@@ -471,7 +472,7 @@ impl<T: BeaconChainTypes> Router<T> {
peer_id,
sync_committtee_msg.1,
sync_committtee_msg.0,
timestamp_now(),
seen_timestamp,
),
)
}
@@ -486,7 +487,7 @@ impl<T: BeaconChainTypes> Router<T> {
message_id,
peer_id,
*light_client_finality_update,
timestamp_now(),
seen_timestamp,
),
)
}
@@ -502,7 +503,7 @@ impl<T: BeaconChainTypes> Router<T> {
message_id,
peer_id,
*light_client_optimistic_update,
timestamp_now(),
seen_timestamp,
),
)
}
@@ -522,7 +523,7 @@ impl<T: BeaconChainTypes> Router<T> {
message_id,
peer_id,
signed_execution_payload_envelope,
timestamp_now(),
seen_timestamp,
),
)
}
@@ -648,7 +649,7 @@ impl<T: BeaconChainTypes> Router<T> {
peer_id,
sync_request_id,
beacon_block,
seen_timestamp: timestamp_now(),
seen_timestamp: self.chain.slot_clock.now_duration().unwrap_or_default(),
});
}
@@ -668,7 +669,7 @@ impl<T: BeaconChainTypes> Router<T> {
peer_id,
sync_request_id,
blob_sidecar,
seen_timestamp: timestamp_now(),
seen_timestamp: self.chain.slot_clock.now_duration().unwrap_or_default(),
});
} else {
crit!("All blobs by range responses should belong to sync");
@@ -705,7 +706,7 @@ impl<T: BeaconChainTypes> Router<T> {
peer_id,
sync_request_id,
beacon_block,
seen_timestamp: timestamp_now(),
seen_timestamp: self.chain.slot_clock.now_duration().unwrap_or_default(),
});
}
@@ -773,7 +774,7 @@ impl<T: BeaconChainTypes> Router<T> {
sync_request_id,
peer_id,
blob_sidecar,
seen_timestamp: timestamp_now(),
seen_timestamp: self.chain.slot_clock.now_duration().unwrap_or_default(),
});
}
@@ -807,7 +808,7 @@ impl<T: BeaconChainTypes> Router<T> {
sync_request_id,
peer_id,
data_column,
seen_timestamp: timestamp_now(),
seen_timestamp: self.chain.slot_clock.now_duration().unwrap_or_default(),
});
}
@@ -827,7 +828,7 @@ impl<T: BeaconChainTypes> Router<T> {
peer_id,
sync_request_id,
data_column,
seen_timestamp: timestamp_now(),
seen_timestamp: self.chain.slot_clock.now_duration().unwrap_or_default(),
});
} else {
crit!("All data columns by range responses should belong to sync");
@@ -895,9 +896,3 @@ impl<E: EthSpec> HandlerNetworkContext<E> {
})
}
}
fn timestamp_now() -> Duration {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_else(|_| Duration::from_secs(0))
}