-
Notifications
You must be signed in to change notification settings - Fork 69
Use TransactionMessageWithinSizeLimit
in helper functions
#468
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
Use TransactionMessageWithinSizeLimit
in helper functions
#468
Conversation
🦋 Changeset detectedLatest commit: 6a72451 The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 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 |
BundleMonFiles updated (10)
Unchanged files (117)
Total files change +788B +0.22% Final result: ✅ View report in BundleMon website ➡️ |
dd2f2ca
to
55b2177
Compare
87e27cf
to
af5d54a
Compare
55b2177
to
e92d632
Compare
af5d54a
to
51d3791
Compare
e92d632
to
d0b31b2
Compare
Documentation Preview: https://kit-docs-h48nru5ks-anza-tech.vercel.app |
d0b31b2
to
0128277
Compare
13ffe0b
to
e09c9e5
Compare
0128277
to
c1b833d
Compare
e09c9e5
to
924e539
Compare
d2c1252
to
a9d2409
Compare
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.
* A type guard that checks if a transaction message is within the size limit | ||
* when compiled into a transaction. | ||
*/ | ||
export type TransactionMessageWithinSizeLimit = { readonly __within_size_limit: unique symbol }; |
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.
Consider how you're going to implement this. I'll throw out some thoughts but ultimately leave it up to you.
NominalType<'withinSizeLimit', true>; // Either present or not
NominalType<'relationshipToSizeLimit', 'under' | 'meets' | 'over'>; // Useful? I don't know.
NominalType<'size', 'within_1232'>; // Imagine a world where the size limit gets increased. Do we need to be able to distinguish between limits at different versions of the cluster?
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'm thinking:
NominalType<'transactionSize', 'withinLimit'>
As it follows a similar convention to the existing:
NominalType<'transactionSignedness', 'fullySigned'>
I don't think there is any point in using values such as within_1232
since we are planning on fixing cluster differences at build time.
c787e76
to
33bcc16
Compare
a9d2409
to
1ff66ef
Compare
33bcc16
to
9065d3a
Compare
1ff66ef
to
d55aa07
Compare
9065d3a
to
f995600
Compare
6ec858e
to
f780cb8
Compare
f995600
to
8d02b50
Compare
8d02b50
to
c471402
Compare
f780cb8
to
2311a56
Compare
2311a56
to
d205506
Compare
c471402
to
3dc8904
Compare
d205506
to
61c1f71
Compare
3dc8904
to
4165595
Compare
Merge activity
|
61c1f71
to
6a72451
Compare
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 adds, removes or forwards the
TransactionMessageWithinSizeLimit
andTransactionWithinSizeLimit
types in all helpers that may affect the size of a transaction.Namely it does the following:
TransactionMessageWithinSizeLimit
type to@solana/transaction-messages
so it can be used within transaction message helpers (not we cannot move the other helper functions since they rely on compiling the transaction to get its size).ExcludeTransactionMessageWithinSizeLimit
type helper to remove the size limit type safety from a message.createTransactionMessage
return type since it always returns empty messages.SetTransactionWithinSizeLimitFromTransactionMessage
type helper that forwards the size limit type safety from a message to a transaction, if any.SetTransactionLifetimeFromCompilableTransactionMessage
type helper that forwards the lifetime constraint from a message to a transaction, if any.TransactionFromCompilableTransactionMessage
type helper that creates aTransaction
type with all the appropriate flags based on the provided message. This helper is then used in the following helpers to significantly simplify their function signatures (they now only require one):compileTransaction
signTransactionMessageWithSigners
partiallySignTransactionMessageWithSigners