Open TomAFrench opened 2 months ago
It's also worth discussing if we want the hashers like crate::hash::poseidon2::Poseidon2Hasher
to be in the same module as their actual hash function which is usually placed directly in crate::hash
. Perhaps they should originate in the more specific modules and just be reexported into crate::hash
, or maybe crate::hash
should just be an empty module containing other more specific hash modules.
Yeah, I was thinking along the same lines when writing this issue. I'm very much in favour of splitting a lot of these files out and using reexports liberally. I'd generally say that any trait in the stdlib should be in its own file due to the amount of boilerplate trait implementations for the primitive types it'll include, e.g. Eq
and Ord
Worth considering implementing #4860 around the same time.
It seems like a fair number of function have been placed a bit haphazardly, e.g.
grumpkin_scalar_mul.nr
vsscalar_mul.nr
, why do we have this duplication? It's aztec code leaking into stdlib by the look of the serialization logic.We should do a pass of placing things where they should be to address these and similar issues. We can make this change non-breaking by adding reexports such as