mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 20:02:43 +00:00
Merge branch 'single_attestation' of https://github.com/eserilev/lighthouse into electra-devnet-5
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use crate::sync::manager::BlockProcessType;
|
||||
use crate::sync::SamplingId;
|
||||
use crate::{service::NetworkMessage, sync::manager::SyncMessage};
|
||||
use attestation::SingleAttestation;
|
||||
use beacon_chain::blob_verification::{GossipBlobError, GossipVerifiedBlob};
|
||||
use beacon_chain::block_verification_types::RpcBlock;
|
||||
use beacon_chain::data_column_verification::{observe_gossip_data_column, GossipDataColumnError};
|
||||
|
||||
@@ -549,7 +549,23 @@ impl<T: BeaconChainTypes> NetworkService<T> {
|
||||
// the attestation, else we just just propagate the Attestation.
|
||||
let should_process = self.subnet_service.should_process_attestation(
|
||||
Subnet::Attestation(subnet_id),
|
||||
attestation,
|
||||
attestation.data(),
|
||||
);
|
||||
self.send_to_router(RouterMessage::PubsubMessage(
|
||||
id,
|
||||
source,
|
||||
message,
|
||||
should_process,
|
||||
));
|
||||
}
|
||||
PubsubMessage::SingleAttestation(ref subnet_and_attestation) => {
|
||||
let subnet_id = subnet_and_attestation.0;
|
||||
let single_attestation = &subnet_and_attestation.1;
|
||||
// checks if we have an aggregator for the slot. If so, we should process
|
||||
// the attestation, else we just just propagate the Attestation.
|
||||
let should_process = self.subnet_service.should_process_attestation(
|
||||
Subnet::Attestation(subnet_id),
|
||||
&single_attestation.data,
|
||||
);
|
||||
self.send_to_router(RouterMessage::PubsubMessage(
|
||||
id,
|
||||
|
||||
@@ -17,7 +17,7 @@ use lighthouse_network::{discv5::enr::NodeId, NetworkConfig, Subnet, SubnetDisco
|
||||
use slog::{debug, error, o, warn};
|
||||
use slot_clock::SlotClock;
|
||||
use types::{
|
||||
Attestation, EthSpec, Slot, SubnetId, SyncCommitteeSubscription, SyncSubnetId,
|
||||
AttestationData, EthSpec, Slot, SubnetId, SyncCommitteeSubscription, SyncSubnetId,
|
||||
ValidatorSubscription,
|
||||
};
|
||||
|
||||
@@ -363,7 +363,7 @@ impl<T: BeaconChainTypes> SubnetService<T> {
|
||||
pub fn should_process_attestation(
|
||||
&self,
|
||||
subnet: Subnet,
|
||||
attestation: &Attestation<T::EthSpec>,
|
||||
attestation_data: &AttestationData,
|
||||
) -> bool {
|
||||
// Proposer-only mode does not need to process attestations
|
||||
if self.proposer_only {
|
||||
@@ -374,7 +374,7 @@ impl<T: BeaconChainTypes> SubnetService<T> {
|
||||
.map(|tracked_vals| {
|
||||
tracked_vals.contains_key(&ExactSubnet {
|
||||
subnet,
|
||||
slot: attestation.data().slot,
|
||||
slot: attestation_data.slot,
|
||||
})
|
||||
})
|
||||
.unwrap_or(true)
|
||||
|
||||
Reference in New Issue
Block a user