-
Notifications
You must be signed in to change notification settings - Fork 103
feat(client): Add oppportunistic upload in parallel to registration #2748
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
Conversation
8dabf10 to
fb059ae
Compare
|
Warning: This PR modifies the Walrus CLI. Please consider the following:
|
mlegner
left a comment
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 a lot for implementing this, @sadhansood! 🙏
The upload code is now getting more and more complex and it's getting pretty difficult to understand it completely. Some refactoring and additional docstrings/comments could help with that.
Two general questions:
- Have you already checked the performance of this?
- Have you investigated how this interacts with existing retry loops?
d27ebce to
97bba42
Compare
8601043 to
41cbc62
Compare
41cbc62 to
115c8a0
Compare
halfprice
left a comment
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 @sadhansood for this epic PR! The complexity is impressive.
Here is my current understanding of the upload flow:
- in parallel
- send registration
- upload data to storage nodes
- if registration returns first, pending uploads will be cancelled
- the client will do all the uploads again
Is this the case?
halfprice
left a comment
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.
To finish my thoughts after first pass. First of all, great effort implementing this optimization!!! The major comment from me is that, in the current form, the code is a bit too complex to understand. In my mind, the upload flow should be quite simple:
Registration (one call to the SuiClient)
Sending data to nodes (set of tasks sending to storage nodes)
Form certificate and certify on chain (parse results, and one call to the SuiClient)
On top of these, it has committee management, and everything should operate based on one committee view. What your PR does should essentially make first two steps concurrent.
One thing I think made things too complicated, is that reserve_and_store_encoded_blobs tries to do a lot more than just upload blobs. For example, for the first two storage optimization (check status, reuse resource), can very well be a standalone step than run before this function. The additional state need to be handled inside this function due to these optimizations amplify the complexity in multiple degree IMO.
Let's sync offline to discuss the best way moving forward.
Agreed @halfprice as discussed offline, let's take some time after this PR and do a proper refactor of the client to simplify it a lot more. |
halfprice
left a comment
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 @sadhansood for the revision! The new revision makes sense to me. Let's aim to clean up the client upload logic as the next work item here before adding any new functionalities.
a3adba8 to
c80f2b9
Compare
Thank you reviewing this PR @halfprice, I will address your comments before landing. |
Description
This PR adds opportunistic uploads for small blobs. The new workflow is as follows:
Test plan
All existing tests are enabled to use this feature. Disabled in prod by default.