Made Hash store a byte array, so Node can store a Hash, rather than a byte slice#67
Conversation
src/crypto/hash.rs
Outdated
|
|
||
| impl fmt::Display for Hash { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| write!(f, "{:x?}", self.hash) |
There was a problem hiding this comment.
for compat with the JS version we should probably use pretty-fmt here.
There was a problem hiding this comment.
Right, I thought there was somewhere I'd missed that!
Related question: are we aiming for full storage API compatibility with the js version, as well as network API compatibility? If so are the JS maintainers aware that any braking change they make will also break the rust version?
|
Thanks heaps for this PR! Unfortunately in its current state we can't accept it, because it opens us up to timing attacks. Keeping I do really like some of the ergonomics improvements introduced here; typing Thanks again so much; overall I really like this direction! |
|
Ahh, I should have asked before I picked a It looks like like |
053a054 to
19dbe3d
Compare
Opening an issue is a good way to go about this! Otherwise I'm also around on Freenode and Discord for synchronous chat.
Possibly! But looking at this patch I'm thinking that adding more conversion traits on the existing codebase could probably get us the closest to our intended goal with the fewest amount of changes required. |
I've switched
Do you mean implementing |
|
@yoshuawuyts sorry to bother, but I'm wondering how do you feel in regards of the new constant hash verification in this current PR. |
🙋 feature
Key Changes:
crypto::hash::Hashto contain a[u8; 32], rather thanBlake2bResultstorage::node::Node.hashto be aHash, rather than aVec<u8>