-
Notifications
You must be signed in to change notification settings - Fork 141
Allow signing a transaction that does not have TransactionWithLifetime #1058
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
Conversation
🦋 Changeset detectedLatest commit: 1bcc4c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 42 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
BundleMonUnchanged files (133)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
0852290 to
1bcc4c0
Compare
|
Documentation Preview: https://kit-docs-977pmwlrg-anza-tech.vercel.app |
lorisleiva
left a comment
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.
Since I got a bit confused by the potential consequences of this PR and Callum reassured me in DMs, I just want to flag here that this does not create a loss of type safety in the following consumer workflow: "TransactionMessage → compile/sign → Transaction → send".
This is because the TransactionMessage contains lifetime information and the functions that will return a Transaction object from it will ensure a lifetime has been specified.
However, the Transaction type itself only contains the compiled message as its source of truth. The TransactionWithLifetime type is an additional metadata flag we added to the object to easily identify which lifetime is set within the compiled message. Removing this requirement to the signing helper is only removing the need to have this redundant lifetime identifier when signing.
|
cc/ @Jac0xb. |
steveluscher
left a comment
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.
|
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |


Problem
I think we went a bit far here. It's important that
signTransactionandpartiallySignTransactionreturn the sameTTransaction extends Transactionthat is passed to them, so that they eg. preserve the lifetime. But I think it is ok to sign aTransactionthat does not have a lifetime field attached to it. One place this is useful is a server that receives serialized transactions to sign, it should be able to sign the result oftransactionDecoder.decode(transactionBytes)without concerning itself with that transaction's lifetime.Summary of Changes
Remove
TransactionWithLifetimefrom the required input type ofsignTransactionandpartiallySignTransaction.