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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

why is Validate::No hardcoded in some impls? #816

Open
the-busy-beaver opened this issue Apr 3, 2024 · 3 comments
Open

why is Validate::No hardcoded in some impls? #816

the-busy-beaver opened this issue Apr 3, 2024 · 3 comments

Comments

@the-busy-beaver
Copy link

hello there 馃憢

i was looking through the code of ark-serialize and found a few places where, even though a validate: Validate is passed as argument to a serialization function, it is hardcoded to Validate::No regardless of the value passed by the caller and passed down the line.

this looks like a bug to me, especially given the fact that compress: Compress is passed as-is to sub calls, but maybe there is a reason where the validation should be disabled in some places? 馃槷

hope this helps in some way 馃槆
cheers 馃槉

locations i found in the code

T::deserialize_with_mode(&mut reader, compress, Validate::No).unwrap()

Validate::No,

Validate::No,

Validate::No,

@the-busy-beaver
Copy link
Author

and if it's confirmed to be unintentional, i'd be happy to help you fix this issue in a PR 馃槈

@slumber
Copy link
Contributor

slumber commented Apr 3, 2024

Your links refer to implementations for collections, after deserializing without validation, impls do

if let Validate::Yes = validate {
    T::batch_check(values.iter())?
}

Which is correct.

@the-busy-beaver
Copy link
Author

ooooh, i see!

so each value is not validated individually, but if the user provides Validate::Yes, then all the values are validated at the end in a batch, is that correct?

thanks for the answer 馃檹

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

No branches or pull requests

2 participants