-
-
Notifications
You must be signed in to change notification settings - Fork 674
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
Cardano shelley update 1/3 #1096
Cardano shelley update 1/3 #1096
Conversation
For the record: IOHK wants to do a hard-fork on the 29th of July. |
@MichalPetro we will look into this ASAP, tomorrow most likely. Regarding the PR schedule: we would like to "freeze" (branch of code into a separate branch and forward firmwares to QA) the upcoming release on July 24th. That gives us 10 working days to include the necessary changes. Although I believe this was mentioned somewhere please confirm that to support sending funds we need to include this PR and one more you are about to open. Please open this PR asap so we can review it and include it till July 24th. Apologies for the sudden rush, I haven't realized the hard-fork date is so close. As to the third PR (which will introduce staking support, correct?) we need to discuss this internally in the Product team whether we want such change in firmware. In another words, it depends on the number of needed changes. We usually support only a subset of functionalities because it is not sustainable to have advanced functionalities for each and every altcoin. I am basically trying to manage expectations here - while we definitely want to include PR 1 and 2 I can not guarantee the same for PR number 3. Feel free to file a draft PR again to decide this before you fine-tune it. |
@tsusanka we will add the 2nd PR today or tomorrow. Also, we probably need to do the small fix in the 1st (this) PR because some specs changed, we are currently assessing the impact. The 3rd PR will be smaller than the others. We will be not introducing staking for stake pools, just staking delegation to the stake pools. |
Great, thank you.
Ok ok. But it is something we might include in the next release if things go south, correct? It is not that essential as the other two. |
Yes definitely the first 2 PRs are critical. Lets make sure those are included. Lets see what we can do about the 3rd. |
I've updated the code with:
Hopefully nothing else will change. I've kept the fixup commits (which is failing the checks), so it's easy to see what changed. I can rebase them or squash them or whatever if you wish. |
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.
does your core code typecheck? if yes, please add src/apps/cardano
to core/Makefile
mypy
target
Thanks.
|
please regenerate UI test fixtures, by running the test suite with |
Or simply use |
I've updated the code with the suggestions. I've also updated the fixtures json here. |
I had to update transaction signing due to Byron witnesses spec update. My commit. I am however unable to test this at the moment since they also have to release their version of cardano-node. I suggest we get the code in order and I will test everything once more when it's ready. I expect this to be on monday. |
ah, I think I said this wrong
You can add new commits. The "only fixup" thing is intended as "no rebasing", so modifications to existing commits should be fixups. But if the changes don't cleanly match some existing commits, a new commit is a better variant. |
Yes, that makes sense. I wasn't sure how to go about that so I kept on "fixing-up". I'll know better next time. |
yeah, sorry about that 🙄 |
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.
LGTM now.
what is the status of the second PR?
it should be based on top of this one, obviously. We will do something like merge this into a separate branch, and you'll be able to send a PR against that branch.
The second PR needs to be rebased onto this one - I've partially done this already, but I'll probably have to do it again. Then I'll clean it up, test it (also against the testnet) and it should be ready for review - hopefully until tomorrow afternoon. And yes, we can probably do something like that. Should I squash and force push the fixups? |
not yet, please wait for approval from @tsusanka |
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.
LGTM, one nit-pick!
* @next Failure | ||
*/ | ||
message CardanoSignTx { | ||
repeated CardanoTxInputType inputs = 1; // inputs to be used in transaction | ||
repeated CardanoTxOutputType outputs = 2; // outputs to be used in transaction | ||
optional uint32 transactions_count = 3; // transactions count |
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.
Please leave this commented out, so we know we should not use 3
anymore.
Thanks, great job! Please squash the commits now and force push. Then change this PR to be against the |
Awesome! Should I squash all the comits into one, or just the fixups? |
up to you honestly. ISTM that via the fixup confusion the original commits don't make sense separately anyway, so feel free to squash everything together. |
Update protobuf - Previous transactions don't need to be sent anymore, because fee is included in the transaction now. Thus transactions_count can be removed from CardanoSignTx message and the CardanoTxAck and CardanoTxRequest messages can be removed altogether. - CardanoTxInputType.type is unused so remove it Add NULL (None type) serialisation to CBOR - Transaction metada must either have a valid structure or CBOR NULL must be used (if metadata is empty) - it can't be simply left out. Add protocol_magics file - Just to have a nicer way of representing protocol magics Update transaction signing - Previous transactions no longer need to be requested - Output building is simplified, since fee doesn't need to be calculated - Remove transaction class since it is no longer needed (only functions remained) - Reorder functions so it reads top to bottom Add protocol magic to byron address on testnet - This has always been a part of the spec, but it hasn't been implemented before, because it wasn't really needed. Update trezorlib Update tests - Transaction messages are no longer required - Expected values are different since tx format changed - Common values in test cases have been extracted Remove unused file - Progress was used when receiving previous transactions Add CRC check to output address validation
ea4a4b3
to
12ecbb5
Compare
I've opened the second PR -> #1112 |
Cardano Shelley update issue: #948
As promised (#1048) we are splitting the Cardano Shelley update into (at least) 3 PRs. This is the first of them.
This PR contains minimal changes with which Trezor can work on the new Shelley fork. It enables sending funds from one Byron address to another. New addresses are not yet added. Neither are certificates and withdrawals.
What's changed:
sign_tx.py
file. The logic around fee calculation has been removed and it has also been refactored quite a lot - e.g. Transaction class has been removed since it now mostly contained only functions anyways.What can still change in the following days (regarding this PR):
We still don't have specs/information about witnesses for Byron inputs from IOHK. This will probably require changes to the way the witnesses are built for Byron inputs. There's also a todo there.This has already been added.Protocol magic in Byron addresses on Testnets - this functionality is drafted, but also needs to be confirmed by IOHK.This has already been added.Here's a gist with a sample transaction input file for trezorctl (although tests also provide some samples).
Here's a gist with a description of the Shelley transaction format (including certificates and withdrawals).
Here's the official CDDL spec for Shelley.
This hasn't been tested on the latest testnet yet, since Byron addresses are not yet fully supported. Support should be added in the following days. When this happens, we will test it and let you know of the status (Some changes may still need to be made regarding this).