-
Notifications
You must be signed in to change notification settings - Fork 2
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 blake2 as built in hash function and make HashingAlgorithm
non-exhaustive
#881
Conversation
HashingAlgorithm
non-exaustiveHashingAlgorithm
non-exhaustive
@@ -16,6 +16,7 @@ At the moment this project **does not** adhere to | |||
- Add a way to change program modification account ([#843](https://github.com/entropyxyz/entropy-core/pull/843)) | |||
- Add support for `--mnemonic-file` and `THRESHOLD_SERVER_MNEMONIC` ([#864](https://github.com/entropyxyz/entropy-core/pull/864)) | |||
- Add validator helpers to cli ([#870](https://github.com/entropyxyz/entropy-core/pull/870)) | |||
- Add blake2 as built in hash function and make HashingAlgorithm non-exhaustive ([#881](https://github.com/entropyxyz/entropy-core/pull/881) |
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.
Im not sure if this counts as a breaking change. I think old JSON encoded signature requests will still work. But the shared type HashingAlgorithm
has changed so strictly speaking this probably is breaking.
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.
Yeah this would be breaking for the entropy-shared
crate since: a) we added a new field to a public enum and b) with the addition of non_exhaustive
existing callers now need to handle the wildcard case.
We should also add this PR to the Added
section.
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.
@@ -16,6 +16,7 @@ At the moment this project **does not** adhere to | |||
- Add a way to change program modification account ([#843](https://github.com/entropyxyz/entropy-core/pull/843)) | |||
- Add support for `--mnemonic-file` and `THRESHOLD_SERVER_MNEMONIC` ([#864](https://github.com/entropyxyz/entropy-core/pull/864)) | |||
- Add validator helpers to cli ([#870](https://github.com/entropyxyz/entropy-core/pull/870)) | |||
- Add blake2 as built in hash function and make HashingAlgorithm non-exhaustive ([#881](https://github.com/entropyxyz/entropy-core/pull/881) |
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.
Yeah this would be breaking for the entropy-shared
crate since: a) we added a new field to a public enum and b) with the addition of non_exhaustive
existing callers now need to handle the wildcard case.
We should also add this PR to the Added
section.
No. It looks like the |
Blake2 is used to hash ECDSA signer payloads on substrate / polkadot. So i think it makes sense to have it as one of our built in hash functions. This PR does that.
Ive also marked the
HashingAlgorithm
enum asnon_exhaustive
. This means we handle the case that it was some unknown variant and return a user error if it was. The idea is to future proof - meaning we can add extra variants without breaking validators who didn't yet update their software. There are probably arguments against doing this, so im willing to take it out if people think its a bad idea.