-
Notifications
You must be signed in to change notification settings - Fork 42
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: lightpush & filter send requests to multiple peers #1779
Conversation
): Subscription | undefined { | ||
return this.activeSubscriptions.get(`${pubsubTopic}_${peerIdStr}`); | ||
return this.activeSubscriptions.get(pubsubTopic); |
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.
peerIdStr
isn't required to be maintained as each Subscription object already corresponds to only one pubsub topic
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.
information about the peers used for that protocol exist within the Subscription
object, which, if necessary, can be accessed as a readonly
property.
size-limit report 📦
|
931ef57
to
00e6703
Compare
…aku into feat/redundant-sdk
…e node and message collector with redundancy accounted for
60d676b
to
f2e66a6
Compare
dbb551c
to
c0b89ac
Compare
@@ -24,6 +24,7 @@ import { StreamManager } from "./stream_manager.js"; | |||
export class BaseProtocol implements IBaseProtocol { | |||
public readonly addLibp2pEventListener: Libp2p["addEventListener"]; | |||
public readonly removeLibp2pEventListener: Libp2p["removeEventListener"]; | |||
readonly NUM_PEERS_TO_USE = 3; |
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.
Why is it not configurable?
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.
good point. made it configurable!
@@ -27,3 +27,12 @@ export function messageHash( | |||
} | |||
return sha256(bytes); | |||
} | |||
|
|||
export function messageHashStr( |
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.
I don't remember why this package was created but as I see it contains only one function.
Considering how it is used it can be safely moved to core
and re-exported from sdk
.
@waku-org/js-waku-developers wdyt?
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.
Maybe because it depends on @noble/hashes
. But @waku/core
already relies on the same as well. So perhaps a good idea to move it into @waku/core
.
PR here to move this: #1810 where we can also continue this discussion if required.
Problem
Currently for LightPush & Filter, we send requests only to 1 peer. This is not ideal as we want to increase decentralisation & reliability for our SDK. Reference issue: #1463
Solution
This PR, addressing #1463 partly, sends LightPush & Filter requests to multiple peers, defined as a constant in
BaseProtocol
.Notes
ServiceNodes
wrapper class forServiceNode
andMessageCollector
and provides helpers to account for redundancy in the latter