We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems a completely empty tree is handled differently in Rust (all zeroes output) than in go (returns nil):
nil
func HashFromByteSlices(items [][]byte) []byte { switch len(items) { case 0: return nil
https://github.com/tendermint/tendermint/blob/b5f030892d1f33dfffb7a3d108f63583316befe2/crypto/merkle/tree.go#L9-L21 vs.
tendermint-rs/tendermint/src/merkle.rs
Line 24 in 667fc8d
Also notice that this edge-case is treated differently in google's rfc6962 implementation (result of hashing an empty byte slice as the root hash of an empty tree): https://github.com/google/trillian/blob/7166f485ebc965d24116db667c9e058a8ed9275c/merkle/rfc6962/rfc6962.go#L51
(This is true for both, the go and the rust implementation)
It's probably a good idea to follow the rfc6962 spec (other than we are compatible to that spec):
The hash of an empty list is the hash of an empty string: MTH({}) = SHA-256().
The hash of an empty list is the hash of an empty string:
MTH({}) = SHA-256().
https://tools.ietf.org/html/rfc6962#section-2.1
ref: tendermint/tendermint#4241 (comment) ref: #73 ref: tendermint/tendermint#5192
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
It seems a completely empty tree is handled differently in Rust (all zeroes output) than in go (returns
nil
):https://github.com/tendermint/tendermint/blob/b5f030892d1f33dfffb7a3d108f63583316befe2/crypto/merkle/tree.go#L9-L21
vs.
tendermint-rs/tendermint/src/merkle.rs
Line 24 in 667fc8d
Also notice that this edge-case is treated differently in google's rfc6962 implementation (result of hashing an empty byte slice as the root hash of an empty tree):
https://github.com/google/trillian/blob/7166f485ebc965d24116db667c9e058a8ed9275c/merkle/rfc6962/rfc6962.go#L51
(This is true for both, the go and the rust implementation)
It's probably a good idea to follow the rfc6962 spec (other than we are compatible to that spec):
https://tools.ietf.org/html/rfc6962#section-2.1
ref: tendermint/tendermint#4241 (comment)
ref: #73
ref: tendermint/tendermint#5192
The text was updated successfully, but these errors were encountered: