Skip to content

Include full simulation data in compute limit estimation error#27

Merged
lorisleiva merged 2 commits intomainfrom
loris/full-simulation-data-in-cu-estimation-error
Mar 11, 2026
Merged

Include full simulation data in compute limit estimation error#27
lorisleiva merged 2 commits intomainfrom
loris/full-simulation-data-in-cu-estimation-error

Conversation

@lorisleiva
Copy link
Copy Markdown
Member

This PR updates the SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT error to include the full simulation result data in its context, matching the shape of the preflight failure error (Omit<RpcSimulateTransactionResult, 'err'>). Previously, only unitsConsumed (downcast to number) was included. The unitsConsumed field is now passed through as the raw bigint from the RPC response — the u64→u32 downcast only applies to the success return path. Bumps @solana/kit to ^6.3.0 which ships the updated error context type.

This PR updates the `SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT` error to include the full simulation result data in its context, matching the shape of the preflight failure error (`Omit<RpcSimulateTransactionResult, 'err'>`). Previously, only `unitsConsumed` (downcast to number) was included. The unitsConsumed field is now passed through as the raw `bigint` from the RPC response — the u64→u32 downcast only applies to the success return path. Bumps `@solana/kit` to `^6.3.0` which ships the updated error context type.
@lorisleiva lorisleiva requested a review from mcintyre94 March 11, 2026 15:11
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.

Nice, this error is way more helpful!

@lorisleiva lorisleiva merged commit 1c5b871 into main Mar 11, 2026
5 checks passed
lorisleiva added a commit to anza-xyz/kit-plugins that referenced this pull request Mar 11, 2026
… ^6.3.0

This updates `@solana-program/compute-budget` from ^0.14.0 to ^0.15.0, which includes full simulation data in the compute limit estimation error context (solana-program/compute-budget#27). The new version requires `@solana/kit` ^6.3.0 as a peer dependency, so all `@solana/kit` references across the monorepo are bumped accordingly.

The error context for `SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT` now contains `Omit<RpcSimulateTransactionResult, 'err'>` instead of just `{ unitsConsumed: number }`. The `unitsConsumed` field is now a raw `bigint` from the RPC response rather than a downcast `number`. The RPC executor's skip-preflight recovery path is updated to downcast the bigint to a u32 number, matching the downcast logic on the success path.
lorisleiva added a commit to anza-xyz/kit-plugins that referenced this pull request Mar 11, 2026
… ^6.3.0 (#145)

This updates `@solana-program/compute-budget` from ^0.14.0 to ^0.15.0, which includes full simulation data in the compute limit estimation error context (solana-program/compute-budget#27). The new version requires `@solana/kit` ^6.3.0 as a peer dependency, so all `@solana/kit` references across the monorepo are bumped accordingly.

The error context for `SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT` now contains `Omit<RpcSimulateTransactionResult, 'err'>` instead of just `{ unitsConsumed: number }`. The `unitsConsumed` field is now a raw `bigint` from the RPC response rather than a downcast `number`. The RPC executor's skip-preflight recovery path is updated to downcast the bigint to a u32 number, matching the downcast logic on the success path.
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.

2 participants