Skip to content
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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

refactor(share): GetShare -> GetSamples #3891

wants to merge 5 commits into from

Conversation

Wondertan
Copy link
Member

@Wondertan Wondertan commented Oct 28, 2024

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:

GetSamples(ctx context.Context, header *header.ExtendedHeader, indices []SampleIndex) ([]Sample, error)

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 new shwap.SampleIndex as param in Sample method
  • !Add GetSamples to the ShareModule.
    • Need to decide which release we want to put this breaking change in
  • Godoc new things
  • Fix remaining tests
  • Rebase
  • Decide on whether SampleIndex should be an index or a tuple.

🎱 mb blonks certified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:shares Shares and samples kind:refactor Attached to refactoring PRs shwap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants