-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add WithTrustedCar() reader option #381
Conversation
Attempt to make CAR traversal a little bit faster by not forcing users to hash every single in a CAR.
I think this would probably be better as an option that can be passed to I think that this might be the only section read path that currently checks block hash matches CID; which either seems like an oversight or an unfortunate waste of resources--whichever view you want to take! Having the ability to turn on validation for each of the interfaces might be the best way to deal with the inconsistency, we'd just have to change the contract on one side of this (i.e. default to untrusted and then make blockstore and storage start validating unless told otherwise? or default to trusted and make this method skip validating unless it's told otherwise). @willscott what's your take? |
agree in that i suspect you won't be mixing these two within a read so you can probably do it as you create the iterator rather than a separate method on the iterator |
Like this? Agree it is better as an Option. |
👌 very nice Would you mind adding a test for this in block_reader_test.go? If you look in |
@rvagg there you go... |
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.
👌
@rvagg was this ever released? We may need to add a v0.x.x tag. |
oh you're right! I was somehow convinced this was a v0 feature. Sorry for the hassle |
Attempt to make CAR traversal a little bit faster by not forcing users to hash every single block in a CAR.