-
Notifications
You must be signed in to change notification settings - Fork 217
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
Fix decodeUnsignedTx
to correctly try previous eras
#2874
Fix decodeUnsignedTx
to correctly try previous eras
#2874
Conversation
This doesn't seem to work. Actually sending HW device transaction crashes the wallet. Sending it via wallet endpoint:
In the wallet log there is:
|
remove unneeded lang extension
a722206
to
b5118cd
Compare
I've done some manual testing of this branch with the following transaction submission command:
(The above is a serialized Mary-era transaction.) On
With this branch, we see the following error: HardForkApplyTxErrFromEra S (S (S (S (Z (WrapApplyTxErr {unwrapApplyTxErr = ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 0 (fromList [])) (Value 56426212 (fromList []))))),UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (BadInputsUTxO (fromList [TxInCompact (TxId {_unTxId = SafeHash "45c12d4910d70d073374ddd0c095f6a65ff10a3be72c0cb54680803d2d709f1a"}) 0,TxInCompact (TxId {_unTxId = SafeHash "d61b9b69bffa67975dc6bc51c3933d2f93cf1b78a000b0e22c762c6cad5229c3"}) 1])))),UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 36233709)}) (SlotNo 36705607))))]}))))) However, I believe this last error is expected, as this transaction has already been previously submitted to testnet. Therefore, it's attempting to spend already-spent UTxOs, which produces a failure, as expected. |
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.
I've reviewed the code, and it looks good.
I've made some minor changes to error strings (to make them more understandable), and removed a small amount of code duplication.
I've also confirmed that this branch produces the "expected" failure (see #2874 (comment)).
I haven't merged this yet, as I still need to be convinced that we've done a sufficient amount of testing.
bors try |
decodeUnsignedTx
to correctly try formats of previous era
decodeUnsignedTx
to correctly try formats of previous eradecodeUnsignedTx
to correctly try previous eras
tryBuild succeeded: |
Nice! I was able to produce serialized tx with Ledger Nano S and Daedalus and successfully send over:
(edit: confirmed also with Trezor and Ledger nano S on testnet and mainnet) |
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
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.
Looks like a good short term solution, thanks @paweljakubas, @jonathanknowles.
The test cases we are interested in are:
- wallet and node in alonzo era, transaction in {mary,allegra,shelley} era (current testnet).
- wallet and node in mary era, transaction in {mary,allegra,shelley} era (test cluster set to mary era, or mainnet).
As an indicator of successful decoding, transaction rejection by the node due to validation seems fine to me.
At present, it's not really feasible to test with a wide range of example transactions. For this, we should use signTx.
bors r+ |
Build succeeded: |
Issue Number
ADP-1110
Comments
This PR adjusts
decodeSignedTx
so that when decoding in a given era, it also correctly tries all previous eras.