-
Notifications
You must be signed in to change notification settings - Fork 352
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
simple_op_store: hash view/operation data directly #734
simple_op_store: hash view/operation data directly #734
Conversation
2404c2a
to
c7ed2e8
Compare
On second thought I've about run out of patience updating callsites. WIll probably reprise this with a custom impl tomorrow. |
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.
Thanks! I see now what you mean about how derive macros would have looked better. Oh well, we can clean that up later.
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.
Oh, it would be nice with a longer description for "simple_op_store: hash view/operation data directly". It would be good to answer at least these questions:
Why are you doing this?
Because depending on the serialized format means that hashes change if we change the format, and also that it's possible that an upgrade to the protobuf library results in a different serialized form and thus a different hash.
What happens to existing repos?
Since the hashes are only used for identity (not for integrity checking), it should not break existing repo.
Just a random comment. I thought Hasher could be implemented as a serde Serializer, but that turned out to be not good idea. impl Serializer requires lengthy boilerplate code, and maybe it would be a bit trickier to ensure HashMap has stable order. |
5b72287
to
6ed6953
Compare
6ed6953
to
5b5d7f1
Compare
Dropped the churn, added support for newtype structs to the macro, added a helper function, and expanded usage to local_backend. I also documented a protocol for enums so hopefully we can keep implementations consistent with eachother and with future improvements to the macro.
Yeah, see also RustCrypto/utils#2 for prior discussion in the ecosystem. |
Aw, need rustc 1.63 for the convenient |
5b5d7f1
to
23bdddf
Compare
23bdddf
to
71dd10e
Compare
71dd10e
to
f3ac695
Compare
f3ac695
to
e8f2db3
Compare
Decouples view/operation IDs from serialized forms, which are not necessarily stable. Not breaking as these IDs are persistent, never recomputed or used for integrity checking.
Insulates identifiers from the unstable serialized form.
e8f2db3
to
134c946
Compare
Product of discussion in #700. First commit could be replaced with a manual impl for the enum, saving a fair bit of churn at the cost of being slightly more error prone. No strong opinion about which would be preferable.