RPC error -32015: Transaction version is not supported

Last updated:

At a glance

Error details
PropertyValue
Applies toSolana JSON-RPC
Code-32015 (UNSUPPORTED_TRANSACTION_VERSION)
MethodsgetTransaction, getBlock
OriginThe node, relayed unchanged
Fix"maxSupportedTransactionVersion": 0
RetryableNot unchanged: the same request fails the same way

Cause

Versioned transactions can load extra accounts through address lookup tables, which changes how account keys are read. A client written for legacy transactions could misread them, so the node refuses to return one unless the request says it understands the format. Without maxSupportedTransactionVersion, the node only returns legacy transactions and answers -32015 for the rest. Routers and bots commonly send version 0 transactions, so code tested against old legacy signatures can start failing on new ones.

Solution

  1. Add "maxSupportedTransactionVersion": 0 to the config object of getTransaction and getBlock.
  2. Update every call site, including retries and backfill jobs that build their own request.
  3. Read meta.loadedAddresses as well as message.accountKeys, or you will miss accounts loaded from lookup tables.
  4. Check the version field in the response before assuming the legacy layout.

The request that works

The parameter sits in the config object, next to encoding. It has to be in every request, including ones built by retry code.

curl https://triport.io/sol \
  -H "x-token: $TRIPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0", "id": 1,
    "method": "getTransaction",
    "params": ["<signature>", {
      "encoding": "jsonParsed",
      "maxSupportedTransactionVersion": 0
    }]
  }'

On getBlock, one transaction fails the whole call

getBlock returns all of a block's transactions, so a single version 0 transaction makes the call fail for the whole block unless the parameter is set. If an indexer stops at the first new block after working through old history, check this before anything else.

Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32015,
    "message": "Transaction version (0) is not supported by the requesting client. Please try the request again with the following configuration parameter: \"maxSupportedTransactionVersion\": 0"
  }
}

FAQ

What value should maxSupportedTransactionVersion have?
0, the highest version the error message names. It sets the highest version you can read; older legacy transactions are still returned.
Does this mean the transaction failed?
No. It says nothing about the transaction's result. The node declined to return it in a format your request did not ask for.
Why does it work for some signatures and not others?
Legacy transactions are returned without the parameter. Only version 0 transactions trigger the error, so the failures depend on what each sender used.