-
Notifications
You must be signed in to change notification settings - Fork 44
Protocol key for Multi and Genesis signature #1124
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
Protocol key for Multi and Genesis signature #1124
Conversation
e6fe01c
to
724ab94
Compare
724ab94
to
463f798
Compare
I have a question regarding the Certificate hash computation that changed: |
No, as I said in the PR we are backward compatible, I made the changes to the hashes before migrating to ProtocolKeys (changes because of the updated Certificate structure). By the way the golden test for the certificate record was not impacted :). |
- In order to split them between "classic" and genesis certificate since the upcoming design won't allow to represent certificates that are both. - Add 'fake keys' for multi signatures & genesis signatures & use them were needed.
…nesis & multi-signature
A blanket implementation is available using the json hex format.
463f798
to
fe7d24b
Compare
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.
LGTM 👍
Content
This PR replace most use of hex encoded keys for multi & genesis signatures with a
ProtocolKey
on the concrete crypto type.In order to do so the
Certificate
entity had to be adapted since it had two mutually excluding string fields (the exclusion was done manually without compiler help), one for the genesis the other for multi-signatures.This was done by adding a new type,
CertificateSignature
an enum with a variant for both cases.Since the genesis signature doesn't use the "json hex" encoding for serialization, contrary to all the previous types converted to a
ProtocolKey
, theProtocolKey
add to be modified to allow to change the inner encoding that it use.This was done with a new trait,
ProtocolKeyCodec
, that define how aProtocolKey
is encoded or decoded to strings or to using serde.Pre-submit checklist
Comments
The hash changes were done before making the genesis & multi signatures into a protocol key (meaning that they did not changes afterward, ensuring backward compatibility), the changes were necessary because of the change to the Certificate structure.
Issue(s)
Relates to #668