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 ValidPath (nar) hash optional if ca field is present #3640

Open
Ericson2314 opened this issue May 29, 2020 · 3 comments · May be fixed by #4059
Open

Make ValidPath (nar) hash optional if ca field is present #3640

Ericson2314 opened this issue May 29, 2020 · 3 comments · May be fixed by #4059

Comments

@Ericson2314
Copy link
Member

Ericson2314 commented May 29, 2020

Currently, the NAR hash is mandatory. This would mean requiring just one of ca and hash. Having both is still fine.

I figure as long as we have one way to verify a path's contents, we should be fine. Conferred with @LnL7, who thought not doing this was just a holdover from before the ca field existed.

This would be good to give other NAR alternatives slightly more equal footing, which generally sounds nice, but which I'd specifically be interested in because of the git object work for IPFS. It's by no means a blocker though, as we can always just continue to compute the nar has in addition to anything else.

@matthewbauer
Copy link
Member

matthewbauer commented May 30, 2020

note that one is base16, while the other is base32:

1|/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh|sha256:51858393c5698aba2e7c4e2832054a6985ab3eeda5db7373db5627d0acceefa8|1547485019||152|||fixed:r:sha256:1a7grsnd09snvdrp7nx5xlzap1b9982k4a2fghpbm2k9qn9q71ai

but they are equivalent hashes:

$ nix-hash --to-base32 --type sha256 51858393c5698aba2e7c4e2832054a6985ab3eeda5db7373db5627d0acceefa8
1a7grsnd09snvdrp7nx5xlzap1b9982k4a2fghpbm2k9qn9q71ai
$ nix-hash --to-base16 --type sha256 1a7grsnd09snvdrp7nx5xlzap1b9982k4a2fghpbm2k9qn9q71ai
51858393c5698aba2e7c4e2832054a6985ab3eeda5db7373db5627d0acceefa8

@Ericson2314
Copy link
Member Author

Ericson2314 commented Jun 1, 2020

CC @zimbatm as you were interested in multiple different hashing schemes.

Ericson2314 added a commit to obsidiansystems/nix that referenced this issue Aug 19, 2020
@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@stale stale bot removed the stale label Dec 5, 2022
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.

3 participants