Moving Toward RawTransactions Serialized in Canonical Format

Over the next week, we are migrating RawTransactions from protobuf to CanonicalSerialization.

This is a breaking change for all clients!

Learn more here.

6 Likes

I see there are changes with CanonicalSerialization itself, for example struct versioning. So breaking changes are everywhere, not only with RawTransactions. Am I understanding this correctly?

5 Likes

Ah, thanks for calling attention to this. We are planning to hold off on the update to testnet release for at least another week so that we can better share the updates.

As you noted, this will have 3 breaking changes:

  • LCS for byte representation of raw transaction for signature generation / verification
  • Removal of raw byte arrays and using length prefixed byte arrays only
  • Versioning in structs

Those three changes should be available for testing from my repository by the end of day tomorrow. The first two already are.

3 Likes

All diffs are now present in https://github.com/libra/libra/pull/622

It is important to note that this does not change the wire protocol, which will still be protobuf. It only affects how we generate the data for signature generation / verification.

3 Likes

This has now landed. SignedTransaction is now written to the wire in LCS format. Hopefully this makes verification of data being sent to and from validators easier as all signatures are on the LCS representation enabling easier verification of data before passing it into the serializer for deserialization.

2 Likes

I don’t get the consequence for clients, does the way transactions are handled have to be adjusted?
Clearer instructions on breaking changes for clients would be great. Libra has some clients already which is great, but brings with it responsibility. At least if the support for the clients is focus at this stage.

1 Like

@davidiw libra network has been updated and i have a question:
get_txn_by_range - returns empty Signed_Txn objects,
on libra repository i found:
let res = itertools::zip_eq(txn_list_with_proof.transaction_and_infos, event_lists) .map(|((signed_txn, _), events)| (signed_txn, events)) .collect(); it not send Signed_Txn

will get_txn_by_range send Signed_Txn to clients?

1 Like

Are you using testnet or master branch?

9/4 testnet is still using old signed txn format, instead of raw signed txn bytes, which is the case of the master branch.

2 Likes

For gophers, I have implemented an LCS golang library.

3 Likes

@the729 Oh, yes, thank you, I missed the branch! :roll_eyes:
I created LCS on C# and I thought that it’s already needed in this testnet update.

2 Likes

Dare to share you C# code? I would like to create a Java LCS implementation and it would be great to compare to and test against C#.

2 Likes

@ice09, Yes, sure (branch LCS)

3 Likes