-
Notifications
You must be signed in to change notification settings - Fork 88
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
Improve connection speed/reliability and add more logging around connections #2542
base: 2.2.0
Are you sure you want to change the base?
Conversation
…te queue, don't dial if the peer is in the peerstore
dialTimeout: 120_000, | ||
maxParallelDials: 10, | ||
dialTimeout: 120000, | ||
maxParallelDials, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this set maxParallelDials to? We observed a while back that too many dials or too many connections could create a performance problem, perhaps only on mobile. I think the performance problem was with Tor if I remember correctly. Maybe that's been fixed in Tor and it's not a problem anymore but we should check to make sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR lowers the max parallel dials from 10 to 2 because it seems to cause issues with connections.
@@ -2,7 +2,7 @@ import { EventEmitter } from 'events' | |||
import fastq, { queueAsPromised } from 'fastq' | |||
|
|||
import Logger from '../common/logger' | |||
import { randomUUID } from 'crypto' | |||
import CryptoJS from 'crypto-js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says it's deprecated and not maintained. I think that's a barrier to us using it unless there's something I'm missing? https://www.npmjs.com/package/crypto-js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already in the project and I'm only using it to generate a consistent shared ID via hashing, no security threat or anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in the other place it's not used for anything security related either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That I don't know, I haven't checked the usages
This should make connecting to new peers, especially when opening the app or resuming the app (iOS), noticeably faster with fewer errors when connecting to peers that are online.
doPX
on libp2p connection manager (PX allows peers to share peer information with each other)Pull Request Checklist
(Optional) Mobile checklist
Please ensure you completed the following checks if you did any changes to the mobile package: