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

[WIP] Initial attempt to validate >256kb ipfs files #165

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

njgheorghita
Copy link
Contributor

What was wrong?

Validating ipfs contents retrieved against their hash is broken for files > 256kb.

useful links:

Cute Animal Picture

@njgheorghita njgheorghita force-pushed the ipfs-dev branch 7 times, most recently from d6bd74b to 3518370 Compare June 28, 2019 17:48
@njgheorghita
Copy link
Contributor Author

@pipermerriam I've been running down some rabbitholes to get >256kb ipfs file content-hash validation working. If you can take a quick 👀 and see if anything jumps out to you? As far as I can tell, everything's in the right place, but the output hashes just won't match the expected value. I've manually decoded the individual root and leaf ipfs objects, and everything in my code corresponds to the output. i.e.

  • the ipfs object for txt.txt
ipfs object get QmegXsU7EopJ9EVj9ELwgHGE75Xke6FYBP84PaygiAsqB5
{"Links":[{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmbYfXF7A7hgXUzEZSifji3D6Nf856kdK8Edu8n7knQSHr","Size":262158},{"Name":"","Hash":"QmZw2JEKQu8n5zisuU7JDAeWSUm2XvqjqV72bizCdDQUDM","Size":19278}],"Data":"\u0008\u0002\u0018���\u0002 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0010 ��\u0001"}
  • the "data" field for the txt.txt ipfs object decoded
ipfs object data QmegXsU7EopJ9EVj9ELwgHGE75Xke6FYBP84PaygiAsqB5 | unixfs
{"type":"file","blockSizes":[262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,262144,19264]}

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 this pull request may close these issues.

1 participant