Skip to content

Replace priorityFees with TransactionPlannerConfig in transaction planner plugins#193

Merged
lorisleiva merged 1 commit into
mainfrom
04-14-replace_priorityfees_with_transactionplannerconfig_in_transaction_planner_plugins
Apr 17, 2026
Merged

Replace priorityFees with TransactionPlannerConfig in transaction planner plugins#193
lorisleiva merged 1 commit into
mainfrom
04-14-replace_priorityfees_with_transactionplannerconfig_in_transaction_planner_plugins

Conversation

@lorisleiva
Copy link
Copy Markdown
Member

This PR replaces the inline priorityFees config on rpcTransactionPlanner and litesvmTransactionPlanner with a new TransactionPlannerConfig type that supports microLamportsPerComputeUnit and version. The all-in-one plugins (solanaRpc and litesvm) gain a transactionConfig option for passing this configuration through.

This prepares us for v1 transactions, which will configure priority fees in a completely different way (flat lamport amount instead of micro-lamports per compute unit). The TransactionPlannerConfig type gives us a place to provide per-version configuration — e.g. a future { version: 1, priorityFees: lamports(100n) } variant — without breaking the existing API surface.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 14, 2026

🦋 Changeset detected

Latest commit: 55f154d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@solana/kit-plugin-rpc Minor
@solana/kit-plugin-litesvm Minor
@solana/kit-client-rpc Minor
@solana/kit-plugins Minor
@solana/kit-client-litesvm Minor

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

Copy link
Copy Markdown
Member Author

lorisleiva commented Apr 14, 2026

@lorisleiva lorisleiva marked this pull request as ready for review April 14, 2026 20:54
@lorisleiva
Copy link
Copy Markdown
Member Author

@trevor-cortex

Copy link
Copy Markdown

@trevor-cortex trevor-cortex left a comment

Choose a reason for hiding this comment

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

Summary

Clean refactor that replaces the inline priorityFees option on rpcTransactionPlanner and litesvmTransactionPlanner with a new TransactionPlannerConfig type supporting microLamportsPerComputeUnit and version. The all-in-one plugins (solanaRpc / litesvm) gain a transactionConfig passthrough option. This sets up a nice extension point for future v1 transaction support with different priority fee semantics.

Notes

  • The TransactionPlannerConfig type is defined identically in both kit-plugin-rpc and kit-plugin-litesvm transaction-planner modules. The barrel export in kit-plugins correctly disambiguates by explicitly re-exporting from kit-plugin-rpc. This is fine for now, but worth noting that the two definitions need to stay in sync manually (the TODO comments help here).
  • kit-client-rpc still exposes a priorityFees field on its ClientConfig type and maps it to microLamportsPerComputeUnit internally — this is the right call since createClient/createLocalClient are already deprecated.
  • The RPC transaction planner still includes fillTransactionMessageProvisoryComputeUnitLimit in its pipeline while the LiteSVM planner does not — this is pre-existing and intentional (LiteSVM doesn't need CU estimation), just noting for subsequent reviewers.
  • Test coverage is thorough: version default, legacy version, compute unit price presence/absence.

Looks good to me 👍

* Defaults to version 0.
*/
version?: 'legacy' | 0;
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: since this type is identical to the one in kit-plugin-rpc/src/transaction-planner.ts, would it make sense to extract it into a shared package (e.g. kit-plugin-instruction-plan or a new shared types package) to avoid the manual sync + the explicit disambiguation in kit-plugins/src/index.ts? Not blocking — the TODO comments and barrel re-export handle it fine for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did that on purpose to allow the two config objects to grow independently of each other.

@@ -1,4 +1,5 @@
export type { FailedTransactionMetadata, TransactionMetadata } from 'litesvm';
export type { LiteSvmConfig } from './litesvm';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good catch exporting LiteSvmConfig from the browser entry point so consumers can still reference the type even when the runtime function throws.

@lorisleiva lorisleiva requested a review from mcintyre94 April 14, 2026 21:03
@lorisleiva lorisleiva changed the base branch from 04-14-remove_payer_config_option_from_transaction_planner_plugins to graphite-base/193 April 16, 2026 13:05
@lorisleiva lorisleiva force-pushed the 04-14-replace_priorityfees_with_transactionplannerconfig_in_transaction_planner_plugins branch from 5afaad7 to ad9fa85 Compare April 16, 2026 13:06
@graphite-app graphite-app Bot changed the base branch from graphite-base/193 to main April 16, 2026 13:06
… planner plugins

This PR replaces the inline `priorityFees` config on `rpcTransactionPlanner` and `litesvmTransactionPlanner` with a new `TransactionPlannerConfig` type that supports `microLamportsPerComputeUnit` and `version`. The all-in-one plugins (`solanaRpc` and `litesvm`) gain a `transactionConfig` option for passing this configuration through.

This prepares us for v1 transactions, which will configure priority fees in a completely different way (flat lamport amount instead of micro-lamports per compute unit). The `TransactionPlannerConfig` type gives us a place to provide per-version configuration — e.g. a future `{ version: 1, priorityFees: lamports(100n) }` variant — without breaking the existing API surface.
@lorisleiva lorisleiva force-pushed the 04-14-replace_priorityfees_with_transactionplannerconfig_in_transaction_planner_plugins branch from ad9fa85 to 55f154d Compare April 16, 2026 13:06
Copy link
Copy Markdown
Member

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

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

This looks great! It'll be really nice to get the simpler priority fees in v1 here too.

@lorisleiva lorisleiva merged commit 0cbf9a3 into main Apr 17, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants