Skip to content

feat(rpcserver): Agave-parity simulateTransaction wire format#238

Merged
rupansh merged 1 commit intorupansh/simul-txnfrom
koro/simul-txn-fixes
May 5, 2026
Merged

feat(rpcserver): Agave-parity simulateTransaction wire format#238
rupansh merged 1 commit intorupansh/simul-txnfrom
koro/simul-txn-fixes

Conversation

@rupansh
Copy link
Copy Markdown
Collaborator

@rupansh rupansh commented May 5, 2026

  • Strict response shape: all 14 RpcSimulateTransactionResult fields with correct nil/empty/null distinctions
  • Custom JSON-RPC errors: -32602 InvalidParams, -32016 MinContextSlotNotReached with structured contextSlot data
  • Inner instruction recording with stackHeight (Option), preserved across InstructionError paths via AssembleInnerInstructions
  • SPL Token + Token-2022 balance decoding with precise uiAmountString for high-decimals tokens (no float saturation)
  • Pre/post account snapshots for token balance pre-state
  • accounts.encoding base58/binary rejection
  • too-many-accounts cap uses post-ALT-resolved key count
  • ALT resolve before sigVerify so sigVerify-fail responses carry resolved loadedAddresses
  • PACKET_DATA_SIZE encoded-length cap matching Agave constants
  • Log + return-data clamping to spec limits (10KB / 1KB)

Live-verified A-to-Z (48/48) against real mainnet CPI swaps, Token-2022 txs, ALT-using txs, vote txs, sigVerify-fail paths, and 50-parallel concurrent simulates. Block-replay running cleanly across 400+ slots with these changes.

- Strict response shape: all 14 RpcSimulateTransactionResult fields
  with correct nil/empty/null distinctions
- Custom JSON-RPC errors: -32602 InvalidParams, -32016
  MinContextSlotNotReached with structured contextSlot data
- Inner instruction recording with stackHeight (Option<u32>),
  preserved across InstructionError paths via AssembleInnerInstructions
- SPL Token + Token-2022 balance decoding with precise uiAmountString
  for high-decimals tokens (no float saturation)
- Pre/post account snapshots for token balance pre-state
- accounts.encoding base58/binary rejection
- too-many-accounts cap uses post-ALT-resolved key count
- ALT resolve before sigVerify so sigVerify-fail responses carry
  resolved loadedAddresses
- PACKET_DATA_SIZE encoded-length cap matching Agave constants
- Log + return-data clamping to spec limits (10KB / 1KB)

Live-verified A-to-Z (48/48) against real mainnet CPI swaps,
Token-2022 txs, ALT-using txs, vote txs, sigVerify-fail paths,
and 50-parallel concurrent simulates. Block-replay running
cleanly across 400+ slots with these changes.
@rupansh rupansh merged commit d68a3e6 into rupansh/simul-txn May 5, 2026
1 check 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