-
Notifications
You must be signed in to change notification settings - Fork 873
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
Refactor transaction-confirmation to use new transaction lifetimes #2485
Conversation
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @mcintyre94 and the rest of your teammates on Graphite |
4c0aed8
to
e24a32b
Compare
db247b0
to
3b6f6ee
Compare
Could you remind me why we need the My other related question is: does this information already lives inside the compiled and encoded If so — and if the |
I think it's only used for transaction confirmation, but I haven't exhausively worked through everything using transactions yet so I'm not 100% sure if there are any other places. I think any other use cases will be much smaller though. It lives in So we could take a I think in practice most people would probably just cast to whatever lifetime they were using instead of using a helper that requires address lookup tables or an RPC and not care that much, so the DX is the bigger point I think. I also think the downside here is limited because there's just not much you need to/can do with a Transaction. |
3b6f6ee
to
b6c7a62
Compare
This PR has ended up pulling in most of #2487 because it broke |
Gotcha, it sounds like — whilst technically the information is there — the process required to get 100% of the compiled information is not simple enough to justify decompiling on-demand when we need access to that information. I'm happy with that. I just wanted to make sure we didn't end up with another version of our "we need to keep our data in sync with the compiled bytes" problem — which is the primary reason for this entire refactoring haha. |
b6c7a62
to
4ec570c
Compare
4ec570c
to
3b2ee65
Compare
@@ -23,7 +28,7 @@ interface SendAndConfirmDurableNonceTransactionConfig | |||
'getNonceInvalidationPromise' | 'getRecentSignatureConfirmationPromise' | |||
>, | |||
) => Promise<void>; | |||
transaction: IDurableNonceTransaction & SendableTransaction; | |||
transaction: FullySignedTransaction & { lifetimeConstraint: TransactionDurableNonceLifetime }; |
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.
Maybe Readonly<{...}>
all of these?
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.
Good idea! I'll do this in an update to #2486 to avoid rebase conflicts there
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.
🎉 This PR is included in version 1.91.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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. |
This PR refactors transaction-confirmation to take
NewTransaction & {lifetimeConstraint: ...}
as input. This removes the dependency on the old transaction model.lastValidBlockHeight
addednonceAccountAddress
added. Previously this was pulled from the transaction's instructions, but we no longer have access to decompiled instructions when we have a signed Transaction object.Note: I'm leaning away from providing a helper to assert on the lifetime of a
NewTransaction
if you don't know it, at least for now. It would require decompiling almost all of the transaction (up to its first instruction), and potentially fetching address lookup tables (if they're used for any of the accounts in the advance nonce instruction). At that point I don't think it provides much value over our existing functions to decompile (using either known address table lookups or an rpc). We can always add this later if we find we need to, it doesn't block anything.