-
Notifications
You must be signed in to change notification settings - Fork 50
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
Patch to new recent bindnode PR seems to cause panic in go-graphsync #377
Comments
uhh, yeah, cause some of them need to be pointers still, like the basicnode plain types .. I had a bit of a play seeing if I could short-circuit this if the type implements |
Thanks for raising this! I'm not sure how the existing tests didn't catch this already. |
This was referenced Mar 7, 2022
mvdan
added a commit
that referenced
this issue
Mar 8, 2022
The implementation expected map value types in Go to be a pointer when the IPLD schema has the value as nullable. Unfortunately, we forgot to enforce that in verifyCompatibility, so the user could run into weird panics: panic: interface conversion: basicnode.plainList is not datamodel.Node: missing method Length The added test case in TestPrototypePointerCombinations reproduces the panic, but is commented out, because we're fixing the check logic to instead have bindnode panic upfront with a helpful message. Note that I understand why the user tried to avoid the pointer to Node. Since Node is an interface, it is already nilable, so bindnode can store a nil value in it directly without the need for a pointer. We do not support that right now, but soon will; #378 now tracks that. Fixes #377.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After updating go-graphsync to go-ipld-prime master, I experience the following panic:
it appears the latest code for the line immediately about the panic (https://github.com/ipld/go-ipld-prime/blob/master/node/bindnode/node.go#L1124) was introduced by #371 .
The text was updated successfully, but these errors were encountered: