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 #4059

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Sep 24, 2020

We port the These data type from Haskell to C++ to maintain the invariant that we must have at least one of a CA or nar hash. This ensures that we can always validate the store entry.

Additionally, we also insure that the LocalStore and BinaryCacheStore always have NAR hashes, which makes this feature easier to undo without breaking data in the wild.

LocalStore and BinaryCacheStore sound like all the "base" stores we have today, so what's the prupose? The intended use-case for this feature would be novel stores that serve data by CA, such a HashedMirrorStore to replace the hashed mirrors mechanism, IPFS store, or software archive stores.

CC @nlewo

This PR is pretty noisy. Most of it is just replacing .field with various accessor methods.

Fix #3640

@edolstra
Copy link
Member

I'm not convinced this is a good idea. It seems that it makes everything way messier. I mean, it's basically a regression: NAR hashes used to be optional which meant that there lots of places where you could end up with a zero hash in your database.

@Ericson2314 Ericson2314 force-pushed the unified-contentAddresses-in-path-info branch from 702fd80 to 04ecf5c Compare September 24, 2020 15:01
@Ericson2314 Ericson2314 changed the title WIP: Make ValidPath (nar) hash optional if ca field is present Make ValidPath (nar) hash optional if ca field is present Sep 24, 2020
@Ericson2314
Copy link
Member Author

There might be other ways of accomplishing my goal, such as an alternative to queryPathInfo, or letting stores choose what sort of a ValidPathInfo subtype they want with an associated type ("nested type name" I gather C++ calls them?).

To reiterate, I want to keep the requirement the database are narinfo files have this info. I suppose even having remote store / legacy ssh store continue to require NAR hashes is workable too. It just means one would have to talk to these new CA-only store directly and not via a remote store protocol.

@stale
Copy link

stale bot commented Jun 2, 2021

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

@stale stale bot added the stale label Jun 2, 2021
@stale
Copy link

stale bot commented Jun 19, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this Jun 19, 2022
@Ericson2314 Ericson2314 reopened this Nov 21, 2022
@Ericson2314 Ericson2314 marked this pull request as draft February 22, 2023 17:11
@stale stale bot removed the stale label Feb 22, 2023
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.

Make ValidPath (nar) hash optional if ca field is present
4 participants