-
Notifications
You must be signed in to change notification settings - Fork 60
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: update various protocols to autoshard #1857
Conversation
|
|
3e654f9
to
a5d1cf4
Compare
Added a proc for optional autosharding, changed the cluster index and count for gen0 and added back |
@jakubgs When we merge this to master the config will be back to normal. |
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.
Made a comment below re filter
, but it applies to all the protocols: I think we don't want the underlying protocols to change, just provide applications with some "middleware" logic when they interact with the node that populates shards in API calls to the underlying protocols. IMO protocols should remain completely unaware of autosharding, which occurs at a higher layer.
I totally miss this part As for where we decide to compute the shard, my idea was that light node should have the least amount of computing to do. I'll make the changes. |
It's still a bit weird how you have to send multiple request in the case of the content topic not using the same shards. |
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.
left some comments, all of them related to pubsub vs content topic. let me know what you think or if im missing something :)
If we remove the pubsub topic from the request then you dont need to send multiple requests? The full node will "infer" it. |
True. If we don't change the underlying light protocols themselves, the "middleware" on the light client that populates the pubsub topic in requests might have to create multiple requests instead of one. To me this still seems safer as an initial step, rather than removing the pubsub topic from the protocol itself and having implicit assumption that the service node the client is contacting is on the same version/generation of autosharding as the client (in other words, on protocol level we remain explicit about shards/pubsub topics). Happy to have people disagree with me here, as I do think we eventually want to simplify how the protocols are used too. This just seems to me the simplest/safest increment to get there. |
The generation to use is in the content topic there's not assumptions. unsupported generation = bad request. As for the version, any autosharding algo. change is breaking change. unsupported version = bad request. |
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.
Thanks for moving sharding logic to the clients to keep the wire protocol the same. However, I'm still confused why the autosharding logic needs to be in the protocol clients. This effectively changes the protocol behaviour too (e.g. a filter subscribe now spinning off multiple subscribes). I would say the only thing that needs to be changed is where the application interacts with the public API, in other words: either in the JSON-RPC/REST APIs (e.g. here) or, if we want to be a bit more universal, in the Nim API for the node, e.g. here. If we follow the latter route, we'll still have a problem with store query
, but the way to fix it IMO, would be to provide an API query*
call where HistoryQuery
creation is moved into the API call, while query criteria (content topics, optional pubsub, etc.) are provided separately as arguments.
I got confused by I am not a fan of adding the "sharding middleware" to the APIs handlers and I also don't like node. I guess I'll put it in node for now... |
Is there a difference between omitting pubsub topic for a STORE request or one request per shards? I see three different intent when making a request.
1 and 2 are functionally the same but maybe we want to differentiate? Also, like a said there's no easy way to merge results when sending multiple requests. How would you page? Maybe we could error when requesting multiple shards at the same time? WDYT? @jm-clius @alrevuelta |
I understand, though I think both options are better than adding it into the protocols themselves. Another option may be just to create a new API for applications using autosharding? Up to you, especially since we can increment here.
Mmm. Yes, I think Store behaviour here is different than Filter, in that it's possible to query with an open (i.e. unpopulated) pubsub topic which would mean "don't care". But in the case of autosharding you assume your content topics are unique (i.e. doesn't span shards), so there's no reason to change anything for autosharding (the pubsub topic can just remain empty in the |
You can find the image built from this PR at
|
5 similar comments
You can find the image built from this PR at
|
You can find the image built from this PR at
|
You can find the image built from this PR at
|
You can find the image built from this PR at
|
You can find the image built from this PR at
|
You can find the image built from this PR at
|
2 similar comments
You can find the image built from this PR at
|
You can find the image built from this PR at
|
You can find the image built from this PR at
|
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.
Thanks for your patience. I have added some comments below but have also approved, since I think that when addressed this can be merged.
Description
Updating LIGHTPUSH & FILTER protocols to handle autosharding.
Changes
Tracking #1846