mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 19:51:05 +00:00
[network] Extend Notifications logs with SetId where missing (#14406)
* Extend `Notifications` logs with `SetId` where missing * Downgrade "Ignoring request to disconnect reserved peer" * minor: log formatting
This commit is contained in:
@@ -1589,8 +1589,8 @@ impl NetworkBehaviour for Notifications {
|
|||||||
let incoming_id = self.next_incoming_index;
|
let incoming_id = self.next_incoming_index;
|
||||||
self.next_incoming_index.0 += 1;
|
self.next_incoming_index.0 += 1;
|
||||||
|
|
||||||
trace!(target: "sub-libp2p", "PSM <= Incoming({}, {:?}).",
|
trace!(target: "sub-libp2p", "PSM <= Incoming({}, {:?}, {:?}).",
|
||||||
peer_id, incoming_id);
|
peer_id, set_id, incoming_id);
|
||||||
self.peerset.incoming(set_id, peer_id, incoming_id);
|
self.peerset.incoming(set_id, peer_id, incoming_id);
|
||||||
self.incoming.push(IncomingPeer {
|
self.incoming.push(IncomingPeer {
|
||||||
peer_id,
|
peer_id,
|
||||||
@@ -1730,7 +1730,7 @@ impl NetworkBehaviour for Notifications {
|
|||||||
_ => None,
|
_ => None,
|
||||||
}) {
|
}) {
|
||||||
if pos <= replacement_pos {
|
if pos <= replacement_pos {
|
||||||
trace!(target: "sub-libp2p", "External API <= Sink replaced({:?})", peer_id);
|
trace!(target: "sub-libp2p", "External API <= Sink replaced({:?}, {:?})", peer_id, set_id);
|
||||||
let event = NotificationsOut::CustomProtocolReplaced {
|
let event = NotificationsOut::CustomProtocolReplaced {
|
||||||
peer_id,
|
peer_id,
|
||||||
set_id,
|
set_id,
|
||||||
@@ -1920,7 +1920,7 @@ impl NetworkBehaviour for Notifications {
|
|||||||
if !connections.iter().any(|(_, s)| {
|
if !connections.iter().any(|(_, s)| {
|
||||||
matches!(s, ConnectionState::Opening | ConnectionState::Open(_))
|
matches!(s, ConnectionState::Opening | ConnectionState::Open(_))
|
||||||
}) {
|
}) {
|
||||||
trace!(target: "sub-libp2p", "PSM <= Dropped({:?})", peer_id);
|
trace!(target: "sub-libp2p", "PSM <= Dropped({:?}, {:?})", peer_id, set_id);
|
||||||
self.peerset.dropped(set_id, peer_id, DropReason::Refused);
|
self.peerset.dropped(set_id, peer_id, DropReason::Refused);
|
||||||
|
|
||||||
let ban_dur = Uniform::new(5, 10).sample(&mut rand::thread_rng());
|
let ban_dur = Uniform::new(5, 10).sample(&mut rand::thread_rng());
|
||||||
@@ -2047,12 +2047,12 @@ impl NetworkBehaviour for Notifications {
|
|||||||
|
|
||||||
match peer_state {
|
match peer_state {
|
||||||
PeerState::Backoff { timer, .. } if *timer == delay_id => {
|
PeerState::Backoff { timer, .. } if *timer == delay_id => {
|
||||||
trace!(target: "sub-libp2p", "Libp2p <= Clean up ban of {:?} from the state", peer_id);
|
trace!(target: "sub-libp2p", "Libp2p <= Clean up ban of {:?} from the state ({:?})", peer_id, set_id);
|
||||||
self.peers.remove(&(peer_id, set_id));
|
self.peers.remove(&(peer_id, set_id));
|
||||||
},
|
},
|
||||||
|
|
||||||
PeerState::PendingRequest { timer, .. } if *timer == delay_id => {
|
PeerState::PendingRequest { timer, .. } if *timer == delay_id => {
|
||||||
trace!(target: "sub-libp2p", "Libp2p <= Dial {:?} now that ban has expired", peer_id);
|
trace!(target: "sub-libp2p", "Libp2p <= Dial {:?} now that ban has expired ({:?})", peer_id, set_id);
|
||||||
self.events.push_back(ToSwarm::Dial { opts: peer_id.into() });
|
self.events.push_back(ToSwarm::Dial { opts: peer_id.into() });
|
||||||
*peer_state = PeerState::Requested;
|
*peer_state = PeerState::Requested;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ impl ProtocolController {
|
|||||||
fn on_disconnect_peer(&mut self, peer_id: PeerId) {
|
fn on_disconnect_peer(&mut self, peer_id: PeerId) {
|
||||||
// Don't do anything if the node is reserved.
|
// Don't do anything if the node is reserved.
|
||||||
if self.reserved_nodes.contains_key(&peer_id) {
|
if self.reserved_nodes.contains_key(&peer_id) {
|
||||||
warn!(
|
debug!(
|
||||||
target: LOG_TARGET,
|
target: LOG_TARGET,
|
||||||
"Ignoring request to disconnect reserved peer {} from {:?}.", peer_id, self.set_id,
|
"Ignoring request to disconnect reserved peer {} from {:?}.", peer_id, self.set_id,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user