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

swarm: delay /webrtc-direct dials by 1 second #3078

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Dec 3, 2024

Previously these addresses weren't delayed at all. When I initially did the ranker implementation, I was too conservative regarding what to delay. So, non QUIC, WebTransport, TCP, WS addresses were ignored in ranking. We only ever need to dial /webrtc-direct when there's no other address available for the peer, in which case we will dial the addresses immediately.

This would have helped with libp2p/js-libp2p#2805 as there would have been fewer peers dialing webrtc and then cancelling because they connected on a better transport.

This also introduces an additional 1 second delay for any fancy non IP transports

Previously these addresses weren't delayed at all. When I initially did the
ranker implementation, I was too conservative regarding what to delay. So,
non QUIC, WebTransport, TCP, WS addresses were ignored in ranking. We only
ever need to dial /webrtc-direct when there's no other address available
for the peer, in which case we will dial the addresses immediately.

This would have helped with libp2p/js-libp2p#2805
as there would have been fewer peers dialing webrtc and then cancelling
because they connected on a better transport.

This also introduces an additional 1 second delay for any fancy non IP
transports
@sukunrt sukunrt self-assigned this Dec 3, 2024
@p-shahi p-shahi mentioned this pull request Dec 3, 2024
22 tasks
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