-
Notifications
You must be signed in to change notification settings - Fork 137
Throw on non-divisible transaction plan #1155
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
Throw on non-divisible transaction plan #1155
Conversation
🦋 Changeset detectedLatest commit: f168194 The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 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 (7)
Unchanged files (129)
Total files change +871B +0.22% Final result: ✅ View report in BundleMon website ➡️ |
|
Documentation Preview: https://kit-docs-d2mk37dm0-anza-tech.vercel.app |
f5a4399 to
f168194
Compare
| [SOLANA_ERROR__INSTRUCTION_PLANS__NON_DIVISIBLE_TRANSACTION_PLANS_NOT_SUPPORTED]: | ||
| 'This transaction plan executor does not support non-divisible sequential plans. To support them, you may create your own executor such that multi-transaction atomicity is preserved — e.g. by targetting RPCs that support transaction bundles.', |
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 is an important part of the PR to review. Lmk what you think. 🙏
mcintyre94
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.
LGTM! Error message looks good, and agree with a patch update.
|
🔎💬 Inkeep AI search and chat service is syncing content for source 'Solana Kit Docs' |

Problem
We currently offer a default implementation of
TransactionPlanExecutorswhich requires a function to send a single transaction message. As such, this default implementation cannot handleNonDivisibleSequentialTransactionPlanssince it would involve sending multiple transactions atomically — e.g. using Jito bundles.The issue is the default implementation currently ignores the requirement of
NonDivisibleSequentialTransactionPlansand sends them as if they were regularSequentialTransactionPlans. This is a mistake (made by me) as it invalid the atomicity of theNonDivisibleSequentialTransactionPlansand could lead to serious issues.Summary of Changes
This PR fixes this issue by throwing a
SolanaErrorwhen we encounter aNonDivisibleSequentialTransactionPlanin our defaultTransactionPlanExecutorimplementation.Importantly, it asserts that no
NonDivisibleSequentialTransactionPlanexists in the potentially nestedTransactionPlanprovided before trying to send any transaction. This avoid having a partially successful plan execution when we could have avoided it from the start.Changeset reasoning
I went with a
patchupdate here because, whilst this is a breaking change, it was not working as intended before. Therefore, I see this more as a bug fix than a breaking change but do let me know if you have another view on this.Acknowledgements
Shout out to Andy for flagging this in one of his latest videos.