-
Notifications
You must be signed in to change notification settings - Fork 993
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
Add hex serialization functions #2436
Add hex serialization functions #2436
Conversation
Note that this will break sending/receiving transactions between upgraded and non-upgraded wallets |
hmmm overlooked this, will hopefully add checks tomorrow |
Yes, this looks like the right approach, but we're going to have to carefully think about when and how we deploy this. I don't think it's trivial (or at least, it's messy) to be able to support both serialisation formats at once. |
Maybe we can have some separate utility for converting old to new serialization format and vice versa? The best way I can think of to support both formats is to add a flag for send/receive txs to serialize the output in the old format. |
Just looking through this in some more detail, as I think I'd like this in place before merging #2441 since I'd like to use the same serialization features there as well. Can I suggest moving all of the serialization methods into their own separate module rather than spreading them around, perhaps in core/src/libtx for now (until we decide the best place to put it). I think it will be useful to have all these methods to sanely serialise libsecp primitives somewhere common. We may even want to split this PR into 2, with one to add the serialisation module and another to turn them on in a backwards compatible way. That would also help me move on with #2441 |
Ok, so:
|
Yes, sounds like a good plan, thanks! |
Move serialization functions into a seperate module
@yeastplume Just in case you missed it, pinging for a review |
I'm not too enthusiastic about merging in commented out code like this. We should either agree to keep this PR open and track it against master (not a huge fan of this either) or push forward on getting this done in a way that preserves backward compatibility. |
What are your thoughts about a separate utility for converting between the different serializations (a lot cleaner than having to pass a flag from the command line)? |
You already have custom serializers now, why not make them revert to the old representation on hex errors? |
The problem is not with deserializing binary/hex but rather with serializing it so that old clients can accept them. |
@svechinsky Right, we're going to have to take a decision at some point as to what to do about older wallets, obviously they won't be able to handle the new format and will choke rather gracelessly. Also, we should probably take the opportunity here to add a version ID to the slate to help us mitigate future problems, and ensure the wallet takes it into consideration (and keep a minimum version it can handle). Unfortunately this has gone a little bit worm-canny. Can I suggest the following:
|
Ok, will sort out today/tomorrow, will def do 1 today so it won't block #2441 |
Okay, great thank you. Lib functions looks good as they are, so I'll merge. |
* Change slate seralization to hex * rustfmt * Comment out serde directives Move serialization functions into a seperate module * Remove commented code
Addressing #2134
Comments about everything are welcome.