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

Make DAG-PB spec compliant #139

Closed
vmx opened this issue Feb 8, 2022 · 6 comments
Closed

Make DAG-PB spec compliant #139

vmx opened this issue Feb 8, 2022 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@vmx
Copy link
Member

vmx commented Feb 8, 2022

The DAG-PB codec isn't spec compliant yet. We have test fixtures at /~https://github.com/ipld/codec-fixtures which can be used to get there (a Rust runner is in the works at ipld/codec-fixtures#25) (there is already a Rust test runner there that skips the DAG-PB tests at the moment).

@vmx
Copy link
Member Author

vmx commented Nov 23, 2022

There is a JS implementation and a Go implementation that are both spec compliant which encode and decode the the Protocol Buffers manually. This would be the preferred way to fix this issue. Both can serve as a template for anyone wanting to tackle this issue.

@vmx vmx added the help wanted Extra attention is needed label Nov 23, 2022
@dignifiedquire
Copy link
Member

What's the actual failure? I suspect that protobuf field ordering is the problem, which is just bad design in the original spec and on the decoding side it shouldn't matter, and on encoding it only matters if you need exact hash matching

@vmx
Copy link
Member Author

vmx commented Nov 23, 2022

on encoding it only matters if you need exact hash matching

This is what a spec compliant codec should support. I haven't looked into the details, I only know that the test fixtures don't pass.

@dignifiedquire
Copy link
Member

dignifiedquire commented Nov 23, 2022

This is what a spec compliant codec should support.

Then heads up, iroh will not be spec compliant. For the reason above about the spec wanting non standard protobuf encoding.

@vmx
Copy link
Member Author

vmx commented Nov 23, 2022

For the reason above about the spec wanting non standard protobuf encoding.

No. The spec is just describing what the original Go implementation for DAG-PB was doing. It was using the usual Protocol Buffers implementation, so I'd call it standard protobuf encoding.

dignifiedquire added a commit that referenced this issue Dec 2, 2022
vmx pushed a commit that referenced this issue Jan 9, 2023
The DAG-PB codec is now spec compliant. The fixtures
at /~https://github.com/ipld/codec-fixtures pass.

Closes #168,#139
@vmx
Copy link
Member Author

vmx commented Sep 7, 2023

This has long been resolved by #170!

@vmx vmx closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants