-
Notifications
You must be signed in to change notification settings - Fork 931
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
refactor(share): GetShare -> GetSamples #3891
Conversation
464baee
to
335de50
Compare
e60079e
to
e2cb3ae
Compare
Well, we don't have any 1D indexes in our code base internal API, not in external json-rpc API we have. Introduction of 1D index brings lots of conversion from 1D to 2D and back here and there as we can see in this PR. Which suggests that we don't need it anywhere. We don't really need to introduce the second way to express same thing.
Do you know why they use it instead of 2D? Might be aswell be historical or random decision. Perhaps we should not introduce additional 1D index unless there is reason to have it |
We should keep 1D convenience methods, while we default coordinates tuple. |
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.
Approving
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.
There is a problem in cascade getter. If any of requested samples fail, it will retry with full sampleCoordinates set with next fallback getter, throwing away all found samples. There is no proper support added in this PR right now. It would technically work with current setup because bitswap getter is the last, but it will misbehaive in any other case.
If left as is it may become a huge footgun and nightmare to debug later.
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.
There is a problem in cascade getter. If any of requested samples fail, it will retry with full sampleCoordinates set with next fallback getter, throwing away all found samples. There is no proper support added in this PR right now. It would technically work with current setup because bitswap getter is the last, but it will misbehaive in any other case.
If left as is it may become a huge footgun and nightmare to debug later.
Samples were requested individually rather than grouped. This was causing issues for Bitswap in the mode where each request is a distinct session, so the solution is to start grouping those as we originally planned.
Mainly removes
GetShare
and introduces:And introduces
SampleIndex
with helper funcs.The current state of the PR unblocks me and allows me to iterate further on Bitswap issues, while the remaining TODOs still need to be finished.
TODOs:
eds.Accessor
should take the newshwap.SampleIndex
as param inSample
methodGetSamples
to the ShareModule.SampleIndex
should be an index or a tuple.🎱 mb blonks certified