Replace priorityFees with TransactionPlannerConfig in transaction planner plugins#193
Conversation
🦋 Changeset detectedLatest commit: 55f154d The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
trevor-cortex
left a comment
There was a problem hiding this comment.
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
TransactionPlannerConfigtype is defined identically in bothkit-plugin-rpcandkit-plugin-litesvmtransaction-planner modules. The barrel export inkit-pluginscorrectly disambiguates by explicitly re-exporting fromkit-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-rpcstill exposes apriorityFeesfield on itsClientConfigtype and maps it tomicroLamportsPerComputeUnitinternally — this is the right call sincecreateClient/createLocalClientare already deprecated.- The RPC transaction planner still includes
fillTransactionMessageProvisoryComputeUnitLimitin 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; | ||
| }; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'; | |||
There was a problem hiding this comment.
Good catch exporting LiteSvmConfig from the browser entry point so consumers can still reference the type even when the runtime function throws.
5afaad7 to
ad9fa85
Compare
a18d01f to
4de71b9
Compare
… 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.
ad9fa85 to
55f154d
Compare
mcintyre94
left a comment
There was a problem hiding this comment.
This looks great! It'll be really nice to get the simpler priority fees in v1 here too.

This PR replaces the inline
priorityFeesconfig onrpcTransactionPlannerandlitesvmTransactionPlannerwith a newTransactionPlannerConfigtype that supportsmicroLamportsPerComputeUnitandversion. The all-in-one plugins (solanaRpcandlitesvm) gain atransactionConfigoption 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
TransactionPlannerConfigtype 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.