Skip to content
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

Attach a typed lifetime constraint field when we compile a transaction #2481

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

mcintyre94
Copy link
Collaborator

@mcintyre94 mcintyre94 commented Apr 12, 2024

This PR adds a typed lifetimeConstraint field to the return of compileTransaction, ie to the Transaction object produced by compiling a TransactionMessage. This is required to distinguish between a blockhash and a nonce - the value of these is stored in the lifetimeToken field (and ultimately serialized) but the type is not.

This is required for transaction confirmation which relies on the lifetime constraint to know how to confirm the transaction. Our new Transaction object alone is insufficient for this.

In a future PR I'll need to add code that can take a Transaction and find its lifetime constraint, which will require decoding it and inspecting its first instruction. But in the case where we have an uncompiled TransactionMessage we already know the constraint type and can attach it.

Copy link

changeset-bot bot commented Apr 12, 2024

⚠️ No Changeset found

Latest commit: ef42435

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mcintyre94 mcintyre94 changed the title attach a typed lifetime constraint field when we compile a transaction Attach a typed lifetime constraint field when we compile a transaction Apr 12, 2024
@mcintyre94 mcintyre94 marked this pull request as ready for review April 12, 2024 18:15
Copy link
Collaborator

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you might just be missing something little based on CI, but lgtm!

packages/transactions/src/new-compile-transaction.ts Outdated Show resolved Hide resolved
packages/transactions/src/new-compile-transaction.ts Outdated Show resolved Hide resolved
@mcintyre94 mcintyre94 force-pushed the tx-lifetime branch 3 times, most recently from 5a1360b to aa8b833 Compare April 15, 2024 08:07
Copy link
Collaborator

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that this mimics the way it's structured on the TransactionMessage (but with slightly less information needed at this stage).

Copy link
Collaborator

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Contributor

🎉 This PR is included in version 1.91.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

github-actions bot commented May 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants