Skip to content

Commit c49615d

Browse files
jimmygchenjtraglia
authored andcommitted
Maintain peers across all data column subnets (sigp#7915)
Closes: - sigp#7865 - sigp#7855 Changes extracted from earlier PR sigp#7876 This PR fixes two main things with a few other improvements mentioned below: - Prevent Lighthouse from repeatedly sending `DataColumnByRoot` requests to an unsynced peer, causing lookup sync to get stuck - Allows Lighthouse to send discovery requests if there isn't enough **synced** peers in the required sampling subnets - this fixes the stuck sync scenario where there isn't enough usable peers in sampling subnet but no discovery is attempted. - Make peer discovery queries if custody subnet peer count drops below the minimum threshold - Update peer pruning logic to prioritise uniform distribution across all data column subnets and avoid pruning sampling peers if the count is below the target threshold (2) - Check sync status when making discovery requests, to make sure we don't ignore requests if there isn't enough synced peers in the required sampling subnets - Optimise some of the `PeerDB` functions checking custody peers - Only send lookup requests to peers that are synced or advanced
1 parent b8c6e49 commit c49615d

File tree

6 files changed

+970
-332
lines changed

6 files changed

+970
-332
lines changed

beacon_node/lighthouse_network/src/discovery/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ impl<E: EthSpec> Discovery<E> {
12231223
#[cfg(test)]
12241224
mod tests {
12251225
use super::*;
1226-
use crate::rpc::methods::{MetaData, MetaDataV2};
1226+
use crate::rpc::methods::{MetaData, MetaDataV3};
12271227
use libp2p::identity::secp256k1;
12281228
use types::{BitVector, MinimalEthSpec, SubnetId};
12291229

@@ -1248,10 +1248,11 @@ mod tests {
12481248
.unwrap();
12491249
let globals = NetworkGlobals::new(
12501250
enr,
1251-
MetaData::V2(MetaDataV2 {
1251+
MetaData::V3(MetaDataV3 {
12521252
seq_number: 0,
12531253
attnets: Default::default(),
12541254
syncnets: Default::default(),
1255+
custody_group_count: spec.custody_requirement,
12551256
}),
12561257
vec![],
12571258
false,

0 commit comments

Comments
 (0)