Versioned Transactions on Solana Mainnet
Solana Mainnet is enabling Versioned Transactions — here's what you need to know.
Here's everything you need to know to prepare for the upcoming Solana Mainnet feature activation and how to avoid errors once it occurs.
The Solana Foundation estimates that on Monday, October 10, 2022, at the beginning of epoch 358
, a feature activation will occur, enabling Versioned Transactions — "the new transaction format that allows for additional functionality in the Solana runtime, including Address Lookup Tables."
Avoid Issues from Versioned Transactions Update
This activation can potentially raise exceptions in your code and affect production.
The following methods are affected by this change:
- getTransaction
- getBlock
To avoid potential issues, you'll need to adapt your code to add a new parameter, otherwise, it might return an error when running some methods. If there's no change, you will get errors when requesting blocks that have those new versioned transactions
Add this Parameter to your getBlock and getTransaction Requests
The request would need to have the following additional parameter:maxSupportedTransactionVersion: 0
For example:
{
"jsonrpc": "2.0",
"id": 1,
"method": "getBlock",
"params": [
94101948,
{
"encoding": "json",
"maxSupportedTransactionVersion": 0,
"transactionDetails": "full",
"rewards": false
}
]
}
In case this new parameter is not explicitly added in the request, maxSupportedTransactionVersion
will default to legacy
, so any block containing a versioned transaction of version 0
or higher will be answered with an error by the client.
Our documentation for these methods has been updated to reflect the new requirements with examples of multiple languages and libraries:
We also recommend requesting getBlock
with jsonParsed
encoding, which would translate the looked-up addresses for versioned transactions into the addresses we are used to seeing right now in the pre/postBalances
fields.
For more details on how to prepare and integrate these changes into your code, we recommend checking the following resources:
- Solana Documentation — Versioned Transaction Migration
- Solana Documentation — Versioned Transactions
- Solana Documentation — JSON RPC API - getBlock
- Solana Documentation — JSON RPC API - getTransaction
- Twitter Update from the Solana Developers account
About QuickNode
QuickNode is building infrastructure to support the future of Web3. Since 2017, we've worked with hundreds of developers and companies, helping scale dApps and providing high-performance access to 16+ blockchains. Subscribe to our newsletter for more content like this and stay in the loop with what's happening in Web3!