Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a new PeerId for each connection #1255

Merged
merged 4 commits into from
Oct 29, 2023
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Oct 28, 2023

cc #44

This PR removes the noise_key from service.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.

@tomaka tomaka added this pull request to the merge queue Oct 29, 2023
@tomaka tomaka removed this pull request from the merge queue due to a manual request Oct 29, 2023
@tomaka tomaka enabled auto-merge October 29, 2023 09:12
@tomaka tomaka added this pull request to the merge queue Oct 29, 2023
Merged via the queue into smol-dot:main with commit 66aac10 Oct 29, 2023
21 checks passed
@tomaka tomaka deleted the rotate-peerid branch October 29, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant