mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-10 05:50:19 +00:00
wip
This commit is contained in:
@@ -44,5 +44,6 @@ sections.
|
||||
- [RFC-004: E2E Test Framework Enhancements](./rfc-004-e2e-framework.md)
|
||||
- [RFC-005: Event System](./rfc-005-event-system.rst)
|
||||
- [RFC-006: Event Subscription](./rfc-006-event-subscription.md)
|
||||
- [RFC-007: Deterministic Proto Byte Serialization](./rfc-007-deterministic-proto-bytes.md)
|
||||
|
||||
<!-- - [RFC-NNN: Title](./rfc-NNN-title.md) -->
|
||||
|
||||
@@ -69,15 +69,15 @@ serializers written in other languages that produce the same output as gogoproto
|
||||
|
||||
The serialized form of a proto message can be transformed into a canonical representation
|
||||
by applying simple rules to the serialized bytes. Re-ordering the serialized bytes
|
||||
would allow Tendermint to produce a canonical byte representation without having to
|
||||
simultaneously maintain a custom proto marshaller.
|
||||
would allow Tendermint to produce a canonical byte representation without having to
|
||||
simultaneously maintain a custom proto marshaller.
|
||||
|
||||
This could be implemented as a function in many languages that performed the following steps:
|
||||
|
||||
1. Reordered all fields to be in tag-sorted order.
|
||||
2. Reordered all `repeated` sub-fields to be in lexicographically sorted order.
|
||||
3. Deleted all default values from the representation.
|
||||
4. Set our proto decoder package to remove unknown fields on deserialization.
|
||||
1. Set our proto decoder package to remove unknown fields on deserialization.
|
||||
2. Reordered all fields to be in tag-sorted order.
|
||||
3. Reordered all `repeated` sub-fields to be in lexicographically sorted order.
|
||||
4. Deleted all default values from the byte representation.
|
||||
|
||||
This would still require that messages never unmarshal data structures with unknown fields.
|
||||
This can be accomplished by defining adding fields to a structure that needs canonicalization
|
||||
|
||||
Reference in New Issue
Block a user