Commit 9228dc2
authored
fix(identify): Remove peer from cache on
This PR handles the `DialError::WrongPeerID` event in `identify` protocol.
Scenario:
Consider a network with two nodes, N1 and N2, where N2 periodically initiates a connection/substream to N1. Now, if N1 is shut down and a new node, N3, starts up on the same transport address but with a different keypair, the identify protocol in N2 will continue to associate the old (PeerId, Multiaddr) pair in its cache. However, since N1 no longer exists and N3 has a different identity, this cached entry is now invalid.
This PR ensures that the protocol properly detects and handles such situations, preventing stale peer information from causing connectivity issues.
Pull-Request: #5890.DialError::WrongPeerId event1 parent 09fa853 commit 9228dc2
2 files changed
+21
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
601 | 612 | | |
602 | 613 | | |
603 | 614 | | |
| |||
0 commit comments