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

single provider fetching of ad chain fails with multihash too short error #360

Closed
masih opened this issue May 17, 2023 · 0 comments · Fixed by #361
Closed

single provider fetching of ad chain fails with multihash too short error #360

masih opened this issue May 17, 2023 · 0 comments · Fixed by #361

Comments

@masih
Copy link
Member

masih commented May 17, 2023

The Index Provider link system generates the entry chunks on the fly if they are not cached. To do this, it looks up the mapping of a given cid to its context ID and provider via this function. Later it converts the returned provider byte slice to peer ID to then call the multihash lister for getting the list of entries.

The issue is that getCidKeyMap can return nil slice as provider ID which then fails to be converted into peer ID since it is empty which then results in multihash too short error.

To fix this getCidKeyMap must guarantee that it never returns nil Provider.

  • In the case of legacy it should return the engine's default provider.
  • In the case of non-legacy it should still sanity check that provider is not empty and fill it with the default provider if it is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant