Skip to content

Solana v1 transactions cannot be signed #1266

Description

@gemcoder21

Impact: The wallet cannot sign a Solana v1 transaction (SIMD-0385, live on mainnet). Signing a swap or a WalletConnect request that carries one fails with "failed to decode transaction". Nothing is broken today because providers and dapps still emit v0, but swaps on Solana stop working the moment an aggregator switches.

Where:

  • core/crates/gem_solana/src/types/transaction/decoder.rs:99-108decode_message accepts legacy and 0, and returns unsupported message version: {version} for anything else.
  • core/crates/gem_solana/src/signer/swap.rs:25 — decodes the provider's base64 transaction before adjusting the compute unit limit and priority fee.
  • core/crates/gem_solana/src/transaction.rs:146is_transaction_bytes gates WalletConnect sign requests through the same decoder.

Reproduce: call decode_transaction(<base64 v1 transaction>) from gem_solana, or hand the wallet a v1 transaction through a swap quote or a dapp sign request. A v1 message starts with the version byte 0x81 (MESSAGE_VERSION_PREFIX | 1). It returns Err("failed to decode transaction").

Note: v1 is more than a version byte. The compute budget moves out of instructions into a transactionConfig on the message, resource limits (compute unit limit, loaded-accounts data size) default to zero and must be set explicitly, and the priority fee is absolute lamports rather than micro-lamports per compute unit — which is exactly what signer/swap.rs manipulates today. v1 also caps accounts at 64 inline with no lookup tables, so the v0 builder we use for our own transactions stays valid.

The read path is already handled: getBlock and getTransaction now send maxSupportedTransactionVersion: 1 (3527559).

Check the RPC accepts version 1:

curl -s https://solana-rpc.publicnode.com -X POST -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getBlock","params":[447120004,{"commitment":"confirmed","encoding":"json","transactionDetails":"full","rewards":false,"maxSupportedTransactionVersion":1}]}' | head -c 400

With "maxSupportedTransactionVersion": 0 the same block answers -32015 Transaction version (1) is not supported by the requesting client. Use the JSON integer, not the string "1".

Run the Solana parser against the node in core/Settings.yaml:

cd core && cargo run -p daemon parser solana

Run the Solana chain integration tests (they call the live node):

cd core && cargo test --lib -p gem_solana --features chain_integration_tests -- chain_integration_tests --test-threads=1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions