Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Use CanonicalSerialization of RawTransaction between client and validator #606
RawTransactions are signed by clients and transmitted to all validators. Validators verify their authenticity by comparing the bundled signature to the RawTransaction. RawTransaction uses protobuf requiring that the validator and client keep both a copy of the original client serialized bytes and the deserialized object, due to RawTransaction's use of protobuf.
This diff eliminates the reliance on protobuf but at the same time introduce breaking changes for current clients and validators.
cargo test in libra/
I think the goal is to get #622 completed first as when we were working on this effort we noticed that there were many deficiencies in place that need to be resolved before we take on rolling out any breaking changes.
With respect to #622 or LCS in general, the plan is:
The only feature currently missing is the version field prior to structs. I'm pondering a low cost fashion to do so to support our current structs as they are all effectively version 0.
All those changes should only break the protocol between validators, so I'm happy to do whatever to make reviewers live's easy to expedite reviews (i.e., multiple PRs). Suggestions / feedback is appreciated.
Once those changes are in place, this diff can be rebased and landed sometime Tuesday or later, so we give time for partners to fix their transaction generation logic in their clients.
I wish the UI gave me the ability to specify that this PR is not ready for review.
RawTransactions must be serialized in a deterministic fashion across platforms so that signatures can be verified given given only an object representation. Without deterministic serialization, two different platforms may serialize the same RawTransaction into two different byte representations invalidating a signature. Validators have thus far passed around the RawTransaction object and the client protobuf byte representation thus far. This diff swaps the protobuf implementation for CanonicalSerialization which guarantees deterministic ordering regardless of platform or programming language. genesis.blob needed to be regenerated as a result of the change.That was done by running cargo run in the language/vm/vm_genesis directory. The test in admission_control that was deleted tests for UnknownFields in protobufs, a feature not present in CanonicalSerialization, hence the test has no equivalent after this change and was removed. Testing verified by running cargo test in root.