mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-25 11:50:37 +00:00
Retry custody requests after peer metadata updates (#6975)
Closes https://github.com/sigp/lighthouse/issues/6895 We need sync to retry custody requests when a peer CGC updates. A higher CGC can result in a data column subnet peer count increasing from 0 to 1, allowing requests to happen. Add new sync event `SyncMessage::UpdatedPeerCgc`. It's sent by the router when a metadata response updates the known CGC
This commit is contained in:
@@ -73,6 +73,8 @@ pub enum RouterMessage<E: EthSpec> {
|
||||
PubsubMessage(MessageId, PeerId, PubsubMessage<E>, bool),
|
||||
/// The peer manager has requested we re-status a peer.
|
||||
StatusPeer(PeerId),
|
||||
/// The peer has an updated custody group count from METADATA.
|
||||
PeerUpdatedCustodyGroupCount(PeerId),
|
||||
}
|
||||
|
||||
impl<T: BeaconChainTypes> Router<T> {
|
||||
@@ -155,6 +157,10 @@ impl<T: BeaconChainTypes> Router<T> {
|
||||
RouterMessage::PeerDisconnected(peer_id) => {
|
||||
self.send_to_sync(SyncMessage::Disconnect(peer_id));
|
||||
}
|
||||
// A peer has updated CGC
|
||||
RouterMessage::PeerUpdatedCustodyGroupCount(peer_id) => {
|
||||
self.send_to_sync(SyncMessage::UpdatedPeerCgc(peer_id));
|
||||
}
|
||||
RouterMessage::RPCRequestReceived {
|
||||
peer_id,
|
||||
inbound_request_id,
|
||||
|
||||
Reference in New Issue
Block a user