mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
Reduce load on validator subscription channels (#5311)
* Fix tests * Merge branch 'unstable' into unclog-channels * Avoid reallocations * Reduce subscription load on beacon node
This commit is contained in:
@@ -27,6 +27,7 @@ use lighthouse_network::{
|
||||
MessageId, NetworkEvent, NetworkGlobals, PeerId,
|
||||
};
|
||||
use slog::{crit, debug, error, info, o, trace, warn};
|
||||
use std::collections::BTreeSet;
|
||||
use std::{collections::HashSet, pin::Pin, sync::Arc, time::Duration};
|
||||
use store::HotColdDB;
|
||||
use strum::IntoStaticStr;
|
||||
@@ -119,7 +120,7 @@ pub enum NetworkMessage<T: EthSpec> {
|
||||
pub enum ValidatorSubscriptionMessage {
|
||||
/// Subscribes a list of validators to specific slots for attestation duties.
|
||||
AttestationSubscribe {
|
||||
subscriptions: Vec<ValidatorSubscription>,
|
||||
subscriptions: BTreeSet<ValidatorSubscription>,
|
||||
},
|
||||
SyncCommitteeSubscribe {
|
||||
subscriptions: Vec<SyncCommitteeSubscription>,
|
||||
@@ -783,7 +784,7 @@ impl<T: BeaconChainTypes> NetworkService<T> {
|
||||
ValidatorSubscriptionMessage::AttestationSubscribe { subscriptions } => {
|
||||
if let Err(e) = self
|
||||
.attestation_service
|
||||
.validator_subscriptions(subscriptions)
|
||||
.validator_subscriptions(subscriptions.into_iter())
|
||||
{
|
||||
warn!(self.log, "Attestation validator subscription failed"; "error" => e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user