-
Notifications
You must be signed in to change notification settings - Fork 171
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
Check if identity is already taken #511
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
borzunov
force-pushed
the
check-if-identity-taken
branch
2 times, most recently
from
October 8, 2022 01:14
8f75580
to
9ae7bef
Compare
borzunov
force-pushed
the
check-if-identity-taken
branch
from
October 8, 2022 01:20
9ae7bef
to
ff3a4cd
Compare
borzunov
force-pushed
the
check-if-identity-taken
branch
from
October 8, 2022 04:32
ff3a4cd
to
23719b1
Compare
Codecov Report
@@ Coverage Diff @@
## master #511 +/- ##
=======================================
Coverage 75.98% 75.99%
=======================================
Files 81 81
Lines 7919 7947 +28
=======================================
+ Hits 6017 6039 +22
- Misses 1902 1908 +6
|
justheuristic
approved these changes
Oct 8, 2022
borzunov
added a commit
that referenced
this pull request
Oct 11, 2022
mryab
pushed a commit
that referenced
this pull request
Oct 19, 2022
While using scripts built with hivemind, users often run two peers with the same identity by accident (e.g., if they forget to change the CLI command or copied the same identity file to another host via `scp`). Now, this leads to undefined behavior of libp2p. This PR makes `hivemind.P2P` check if the identity is already taken, thus solving this issue in all applications at once. (cherry picked from commit 64a6c30)
mryab
pushed a commit
that referenced
this pull request
Oct 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While using scripts built with hivemind, users often run two peers with the same identity by accident (e.g., if they forget to change the CLI command or copied the same identity file to another host via
scp
). Now, this leads to undefined behavior of libp2p.This PR makes
hivemind.P2P
check if the identity is already taken, thus solving this issue in all applications at once. See the example below:Future work:
initial_peers
are not defined anduse_ipfs = False
(i.e., we are the first peer), there is no need to check anything