-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: use the lowest latency peer for light protocols #1520
Conversation
…u into feat/px-default
…at/select-fastest-peer
@@ -4,25 +4,59 @@ import type { KeepAliveOptions } from "@waku/interfaces"; | |||
import debug from "debug"; | |||
import type { PingService } from "libp2p/ping"; | |||
|
|||
import { createEncoder } from "../index.js"; | |||
import { createEncoder } from "./message/version_0.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.
while unrelated to this PR, this was causing a cyclic dependency error that surfaced during this PR
|
||
export const RelayPingContentTopic = "/relay-ping/1/ping/null"; | ||
const log = debug("waku:keep-alive"); | ||
|
||
export class KeepAliveManager { | ||
private static instance: KeepAliveManager; |
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.
converted this into a singleton for easier access (also consistent with ConnectionManager
)
b0aa42f
to
d28647a
Compare
…at/select-fastest-peer
…at/select-fastest-peer
superseded by #1540 |
!!#1469 should be merged first!!
Problem
During selection of peers to be used for light protocols, the selection currently happens randomly. This is not ideal, as we might potentially be communicating with a higher latency node, while an option to use a faster node might exist.
Ref: #1465 #1497
Solution