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

Test Vectors for Filesystem #861

Open
OR13 opened this issue Sep 16, 2020 · 1 comment
Open

Test Vectors for Filesystem #861

OR13 opened this issue Sep 16, 2020 · 1 comment

Comments

@OR13
Copy link
Contributor

OR13 commented Sep 16, 2020

When SIP-1 is supported, test vectors for the entire filesystem should be created... especially so we can ensure that IPFS identifiers for compressed files are stable / portable across implementations.... Preliminary testing of zlib worries me, suggest picking an implementation that can run in browsers and that has stable test vectors.... like https://www.npmjs.com/package/pako

https://github.com/decentralized-identity/sidetree/blob/6dad5bf7f99851638d99cfa0aeb53afd0d550869/tests/core/util/Compressor.spec.ts

This test does not compare compressed buffer to static hash... this just tests that you can compress and decompress.

The test should look like this.

const testDataObject:any = require('./test-data.json');
const compressed = Compressor.cannonizeAndCompress(testDataObject);
const digest = sha256(compressed);
expect(digest).toBe(require('./test-data-expected-digest'))

This way GoLang, Rust and other TypeScript implementations can make sure they compress to the exact same binary.... other wise you will see lots of IPFS hashes which are only decompress-able with certain implementations.... which will cause the did method to be perceived as unreliable.

@OR13
Copy link
Contributor Author

OR13 commented May 19, 2021

This ticket is semi blocking for our ability to update our libraries to support SIP-1 / sidetree 1.0

Any chance this will get implemented soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants