Generate a new PeerId for each connection #1255
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cc #44
This PR removes the
noise_key
fromservice.rs
, and instead gives the responsibility to the network services to maintain the Noise key.The full node keeps the same behavior as right now, but the light client generates a new libp2p key and Noise key for every single connection.
As explained in the CHANGELOG, this increases privacy by removing the possibility for full nodes to track light clients even when they change IP address.
This is especially relevant for long-running light client. For example if you go to PolkadotJS, do things, then travel somewhere, then go back to the PolkadotJS tab, right now you will keep the same networking key, making it possible for the full nodes to track your location in real time. This PR fixes this.
Note that it still assumes that new connections are reopened whenever you change IP address. This is not necessarily the case right now, as for example I believe that mobile phones are able to transparently reopen TCP connections even you switch between Wifi and mobile Internet. However, it is still generally the case, in particular when you put your device to sleep.