-
Notifications
You must be signed in to change notification settings - Fork 924
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
fix(share/p2p)!: share.ErrNamespaceNotFound
and integration into shrex-nd
#2156
fix(share/p2p)!: share.ErrNamespaceNotFound
and integration into shrex-nd
#2156
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2156 +/- ##
==========================================
- Coverage 55.54% 55.44% -0.10%
==========================================
Files 212 212
Lines 13583 13601 +18
==========================================
- Hits 7544 7541 -3
- Misses 5275 5294 +19
- Partials 764 766 +2
|
Please add support in ipld.Getter too |
@walldiss There is support for IPLDGetter - its just through the collectSharesByNamespace util. You can see getter_test to verify it works correctly |
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.
Need support in shrex-getter to stop retries after client returns ErrNamespaceNotFound
Thank you @walldiss, somehow I forgot the most important part of the PR 😂 |
Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
b6d8e89
to
a909e51
Compare
@@ -8,7 +8,7 @@ import ( | |||
"github.com/celestiaorg/celestia-node/share/p2p" | |||
) | |||
|
|||
const protocolString = "/shrex/nd/0.0.1" | |||
const protocolString = "/shrex/nd/0.0.2" |
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.
I had a question about this while I was writing docs for peer manager and exploring getters, why is it that versions in other protocols we have are prefixed with v
and shrex/nd
is not. (e.g: /shrex/nd/v0.0.2
)
Maybe since this is a breaking PR we can fix this and make this protocol uniform with the rest.
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.
good catch. Will fix
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.
you still didnt fix
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.
it is fixed, just not showing in the diff
@@ -8,7 +8,7 @@ import ( | |||
"github.com/celestiaorg/celestia-node/share/p2p" | |||
) | |||
|
|||
const protocolString = "/shrex/nd/0.0.1" | |||
const protocolString = "/shrex/nd/0.0.2" |
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.
you still didnt fix
Conflicts |
shares, err = collectSharesByNamespace(ctx, blockGetter, root, nID) | ||
if errors.Is(err, ipld.ErrNodeNotFound) { | ||
// convert error to satisfy getter interface contract | ||
err = share.ErrNotFound | ||
err = share.ErrNamespaceNotFound |
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.
As part of this PR collectSharesByNamespace has been changed to return share.ErrNamespaceNotFound
. Could you please explain the case, when you get ipld.ErrNodeNotFound
and need to convert it?
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.
This is actually incorrect AFAIU. ErrNodeNotFound should in fact be converted to an ErrNotFound. So I will look into it one more time while writing tests and update
roots := filterRootsByNamespace(root, id) | ||
if len(roots) == 0 { | ||
return nil, share.ErrNamespaceNotFound | ||
} |
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.
Optional: Would be nice if you find time to add quick test for this case.
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.
done but not showing in diff, will reopen PR
Pull request was closed
…x-nd (celestiaorg#2230) This PR replaces celestiaorg#2156 , as gh was not showing the diff properly. It closes celestiaorg#2145 --------- Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
This PR resolves #2145 . A followup PR may come that changes the response layer between the RPC and the internal GetSharesByNamespace call.