Skip to content

fix(rpc): return InvalidParams instead of panic in simulateTransaction#528

Merged
MicaiahReid merged 1 commit intosolana-foundation:mainfrom
bonlime:codex/rpc-invalid-params-origin-main
Feb 27, 2026
Merged

fix(rpc): return InvalidParams instead of panic in simulateTransaction#528
MicaiahReid merged 1 commit intosolana-foundation:mainfrom
bonlime:codex/rpc-invalid-params-origin-main

Conversation

@bonlime
Copy link
Contributor

@bonlime bonlime commented Feb 12, 2026

Another PR with a small fix

Summary

This PR fixes a panic path in simulateTransaction when the input transaction payload is invalid (for example, oversized base64).
Instead of panicking, the RPC now returns a proper JSON-RPC InvalidParams error.

What changed

  • Replaced panic-prone unwrap handling in the transaction decode path with explicit error returns.
  • Added a regression test for oversized base64 input to ensure InvalidParams is returned.

Copy link
Collaborator

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @bonlime!

@MicaiahReid MicaiahReid merged commit c94abc6 into solana-foundation:main Feb 27, 2026
5 checks passed
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