-
Notifications
You must be signed in to change notification settings - Fork 21
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 flatfs robust #64
Conversation
b9df39e
to
9ba2c75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM 👍
I don't have the context to know if this is a good idea, but it seems like a good idea :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpicks.
Any relevant context/request that makes this a necessary change or is it just general maintenance?
While this datastore is still quite limited, we might as well support everything we easily can.
That way, we're finally implementing everything.
Only allow keys of the form `/[0-9A-Z+-_=]`. That is, upper-case alphanumeric keys in the root namespace (plus some special characters). Why? We don't encode keys before writing them to the filesystem. This change ensures that: 1. Case sensitivity doesn't matter because we only allow upper-case keys. 2. Path separators and special characters doesn't matter. For context, go-ipfs only uses flatfs for storing blocks. Every block CID is encoded as uppercase alphanumeric text (specifically, uppercase base32). We could be less restrictive, but this is safer and easier to understand. Unfortunately, we _can't_ allow mixed case (Windows) and can't allow lowercase because we're already using uppercase keys. fixes #23
9ba2c75
to
4ca877d
Compare
General maintenance. I needed to pull through a fix for prefix handling in the query logic. |
Errors in tests, seems circle is building with old Go ? |
35b5c51
to
9e32f65
Compare
Updated go-log. |
Oh, and probably old go. |
Importantly, this change only allows keys of the form
/[0-9A-Z+-_=]
. That is, upper-case alphanumeric keys in the root namespace (plus some special characters).Why? We don't encode keys before writing them to the filesystem. This change ensures that:
For context, go-ipfs only uses flatfs for storing blocks. Every block CID is encoded as uppercase alphanumeric text (specifically, uppercase base32).
We could be less restrictive, but this is safer and easier to understand. Unfortunately, we can't allow mixed case (Windows) and can't allow lowercase because we're already using uppercase keys.
fixes #32, #61, #40, #22
tests with the query test suite