-
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
Static Sharding #1310
Comments
some learnings: cc @fryorcraken keen to know your perspective on the above |
note: is currently blocked on |
Child issue: #1430 |
that and we also need to implement the API to enable static and naming sharding on filter, light push, store and relay. Which is the discussion I saw on Discord. |
Note this is needed for the "community preview" web portal of Status. Cc @danisharora099 @chair28980 @John-44 @prichodko @felicio |
and Community Channel Preview web pages |
some notes for design:
|
@weboko and I discussed how the user flow might look like for subscription & unsubscription from the user's end where we assume Alice will pass the shard during the initialisation of the node: sequenceDiagram
participant Alice
participant js-waku
participant connection manager
Alice->>js-waku: start (pass [`shard1`, `shard2`])
js-waku->>connection manager: discovers & attempts connections to relevant peers
connection manager->>connection manager: cache peers for irrelevant static shards
Alice->>js-waku: subscribe to a new pubsubtopic (`shard3`) based on IDecoder (that includes pubsubTopic)
js-waku->>js-waku: if the new IDecoder is for static sharding (following topic name convention)
js-waku->>connection manager: attempt dial
connection manager->>connection manager: check if we already have a connected peer for this shard & use this peer
connection manager->>connection manager: else, loop over discovered peers and attempt a dial to new peer
js-waku->>Alice: if no peers are found for that shard -- throw error
js-waku->>Alice: else, return the subscription object
Alice->>js-waku: unsubscribe (shard1)
js-waku->>connection manager: drop connection with peers that exclusively support that shard
|
My view here is that there are the following sub-tasks:
|
Taking into account #1430 (comment), where we assume that shards will not change mid-run; we can update the sequence diagram as: sequenceDiagram
participant Alice
participant js-waku
participant connection manager
Alice->>js-waku: start (pass [`shard1`, `shard2`])
js-waku->>connection manager: discovers & attempts connections to relevant peers
Alice->>js-waku: send a subscription request that includes a pubsubtopic based on IDecoder
js-waku->>js-waku: if the new pubsubtopic is different from initialisation, throw error
js-waku->>js-waku: if the new pubsubtopic is one of the ones from initialisation, proceed
js-waku->>connection manager: open a stream with one of the connected peers from the relevant shard
js-waku->>Alice: return the subscription object
this definitely narrows our scope of work (v1) but we can design our system as above discussed where we think of it being potentially scaled up to being used for run-time changes as well (v2?) Tasks (v1)Create
Discovery
ConnectionManager
Protocols
let me know what you think @weboko @fryorcraken |
Looks good. Would be good to have a review from @waku-org/go-waku-developers and @waku-org/nwaku-developers if they see any issue from their experience/implementaiton. Agreed that for static sharding, we can assume that the static shard does not change after a start to support the Community Preview portal and Community Channel web pages for Status. Cc @felicio @prichodko Do note that with auto-sharding, shards can change mid run (but out of scope for this issue). |
Weekly Update
|
Weekly Update
|
Weekly Update
|
reopening this in reference to #1684 to be done |
Closing considering #1684 is done |
Planned start date:
Due date: 15 Oct 2023
Summary
Implement Static Sharding as specified in https://rfc.vac.dev/spec/51/#static-sharding
Acceptance Criteria
As an app dev, I can...
Tasks
Taking into account #1430 (comment), where we assume that shards will not change mid-run; we can update the sequence diagram as:
this definitely narrows our scope of work (v1) but we can design our system as above discussed where we think of it being potentially scaled up to being used for run-time changes as well (v2?)
Tasks (v1)
Create
pubsubTopics
during the creation of node: feat(static-sharding)!: allow multiple pubSubTopics #1586const node = createRelayNode({ cluster: M, shards: [N, O] });
Discovery
rs
/rsv
and add that information inPeerStore
for easier access feat(static-sharding): filter peer connections per shards #1626ConnectionManager
rs
/rsv
value & then dial them accordingly feat(static-sharding): filter peer connections per shards #1626Protocols
pubsubTopic
for that request is for a shard that the js-waku node was setup with during initialisation: feat(static-sharding)!: allow multiple pubSubTopics #1586RAID (Risks, Assumptions, Issues and Dependencies)
The text was updated successfully, but these errors were encountered: