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

service/share, ipld: adds ability to retrieve shares by namespace ID #170

Merged
merged 19 commits into from
Nov 12, 2021

Conversation

renaynay
Copy link
Member

@renaynay renaynay commented Nov 4, 2021

This PR implements the ability to retrieve shares by namespace ID via two helper methods in the ipld package as well as a broader RetrieveShares function in service/share package.

One thing to note:
PutData in ipld/write.go prepends the namespaceID twice, so in several tests, it's necessary to check the returnedShare[8:] against the expectedShare.

TODO:

  • full test for RetrieveShares
  • clean up code / address TODOs
  • lint / make sure good test coverage
  • check on mod to make sure no accidents occurred

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment: Pls base it on top of #167 and implement a method there.

Initial review will need a more in-depth in logic itself, but for now pls fix mentioned things

go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
service/share/share.go Outdated Show resolved Hide resolved
service/share/share.go Outdated Show resolved Hide resolved
@renaynay renaynay mentioned this pull request Nov 5, 2021
5 tasks
@renaynay renaynay added the area:shares Shares and samples label Nov 5, 2021
@renaynay renaynay force-pushed the shares-by-namespace branch 2 times, most recently from 884b578 to 9f95c2a Compare November 8, 2021 10:00
@renaynay renaynay requested a review from Wondertan November 8, 2021 10:00
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main stopper here is that we download the data we are not interested in to check if we stopped loading shares in a row. We shouldn't merge such behavior.

Also, some things were fixed during the sync review in between.

service/share/sample.go Outdated Show resolved Hide resolved
service/share/share_test.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
service/share/testing.go Outdated Show resolved Hide resolved
service/share/share.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
ipld/errors.go Outdated Show resolved Hide resolved
@renaynay renaynay requested a review from Wondertan November 9, 2021 10:41
Wondertan
Wondertan previously approved these changes Nov 9, 2021
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve!!!

One thing: pls create an issue about parallelization of GetSharesByNamespace. The speed-up must be significant if we parallelized GetSharesByNamespace for each Row independently.

@Wondertan
Copy link
Member

The tests if failing due to #173. To resolve this here we can either:

@renaynay, WDYT?

ipld/plugin/nmt.go Outdated Show resolved Hide resolved
@Wondertan
Copy link
Member

@renaynay, rebase on master and tests will go green

@Wondertan
Copy link
Member

1.16 tests running for too long, ***, seems like TestSubscriber still hangs

@Wondertan
Copy link
Member

@renaynay, add pls context.WithTimeout(time.Second * 10) to TestSubscriber. This way we ensure that tests won't run longer than 10*seconds if it hangs.

@Wondertan
Copy link
Member

Rerun helped and we can merge this, though in master, rarely hanging still might be the case.

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra dope 🚀
Left some minor comments and nits.

go.mod Outdated Show resolved Hide resolved
ipld/plugin/nmt.go Outdated Show resolved Hide resolved
ipld/read.go Outdated Show resolved Hide resolved
ipld/read_test.go Outdated Show resolved Hide resolved
service/share/share_test.go Show resolved Hide resolved
ipld/read_test.go Show resolved Hide resolved
Copy link
Member

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments, other than agreeing with @liamsi's review

@renaynay renaynay requested a review from liamsi November 11, 2021 13:45
@adlerjohn
Copy link
Member

Conflicting with default branch @renaynay

@renaynay renaynay force-pushed the shares-by-namespace branch from 62271b1 to cc42239 Compare November 11, 2021 15:56
@renaynay renaynay force-pushed the shares-by-namespace branch from cc42239 to bd47aab Compare November 11, 2021 15:59
Copy link
Member

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @renaynay 🚀

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

Successfully merging this pull request may close these issues.

6 participants