Skip to main content

Solana Agave 2.0: How to Prepare

Updated on
Oct 11, 2024

4 min read

Overview

Solana is planning a major release to mainnet-beta, known as Agave version 2.0, at the end of September or early October of 2024 (Source: GitHub - Anza-xyz/agave/Wiki). The changes have already gone live on Devnet and Testnet. This release will introduce a number of changes to the Solana network, including modifications to the Solana RPC APIs and SDK elements.

In this guide, we will summarize methods that will no longer be supported after the latest release and how to prepare for the changes.


Backwards Compatibility

All changes are backward compatible and available on previous versions of Solana's mainnet, allowing you to upgrade your applications seamlessly.

To avoid any issues with your application, we recommend updating your codebase to use the replacement calls listed below as soon as possible.

Prefer a visual format? Follow along with Sahil to learn about the changes in 3 minutes.
Subscribe to our YouTube channel for more videos!

Changes to RPC Endpoints and SDK Elements

A number of RPC endpoints are being deprecated and no longer supported in Agave version 2.0. Please use the replacement calls listed below.

Deprecated v1 API Callv2 Replacement Call
(and link to Latest Documentation)
confirmTransactiongetSignatureStatuses
getSignatureStatusgetSignatureStatuses
getSignatureConfirmationgetSignatureStatuses
getConfirmedSignaturesForAddressgetSignaturesForAddress
getConfirmedBlockgetBlock
getConfirmedBlocksgetBlocks
getConfirmedBlocksWithLimitgetBlocksWithLimit
getConfirmedTransactiongetTransaction
getConfirmedSignaturesForAddress2getSignaturesForAddress
getRecentBlockhashgetLatestBlockhash
getFeesgetFeeForMessage
getFeeCalculatorForBlockhashisBlockhashValid or getFeeForMessage
getFeeRateGovernorgetFeeForMessage
getSnapshotSlotgetHighestSnapshotSlot
getStakeActivationgetAccountInfo

Follow the links above or browse our Solana docs to learn more about alternatives to the deprecated RPC endpoints.

Many of the replacement calls are one for one replacements, but some may require a little more modification to your code. Let's take a look at a few examples. If you have additional questions, let us know or feel free to reach out to us on Discord.

confirmTransaction

Given the new upgrade, you will need to create your own confirmation logic to verify that a transaction has been accepted by the network. To achieve this, we can create a similar confirmTransaction function that will rely on the getSignatureStatuses call to check the status of a transaction. Here's one solution using the @solana/web3.js library:

import { Connection, TransactionSignature, TransactionConfirmationStatus, SignatureStatus } from '@solana/web3.js';

async confirmTransaction(
connection: Connection,
signature: TransactionSignature,
desiredConfirmationStatus: TransactionConfirmationStatus = 'confirmed',
timeout: number = 30000,
pollInterval: number = 1000
): Promise<SignatureStatus> {
const start = Date.now();

while (Date.now() - start < timeout) {
const { value: statuses } = await connection.getSignatureStatuses([signature]);

if (!statuses || statuses.length === 0) {
throw new Error('Failed to get signature status');
}

const status = statuses[0];

if (status === null) {
// If status is null, the transaction is not yet known
await new Promise(resolve => setTimeout(resolve, pollInterval));
continue;
}

if (status.err) {
throw new Error(`Transaction failed: ${JSON.stringify(status.err)}`);
}

if (status.confirmationStatus && status.confirmationStatus === desiredConfirmationStatus) {
return status;
}

if (status.confirmationStatus === 'finalized') {
return status;
}

await new Promise(resolve => setTimeout(resolve, pollInterval));
}

throw new Error(`Transaction confirmation timeout after ${timeout}ms`);
}

This script simply polls the getSignatureStatuses method until the transaction realizes our desired status or the timeout is reached. It then returns the status of the transaction.

For additional ideas, check out our Guide on Solana Transaction Propagation.

If you anticipate needing to do this often, consider building your own Custom Function to handle this logic.

getStakeActivation

Since the getStakeActivation method is being deprecated, you will need to use the getAccountInfo method and deserialize/parse the data returned to get the stake activation status. Check out the following resources to learn more:

Building with QuickNode

Building on Solana? Quicknode's RPC endpoints are up-to-date with the latest versions of the Solana Network. QuickNode offers a competitive edge through its advanced Solana infrastructure:

🌎 High Transaction Success Rate: Our global network and cutting-edge hardware ensure your transactions are reliably sent to the Solana's Mainnet, Devnet, or Testnet.

🚀 Proprietary Hyperscaling: Our custom solution outperforms standard Solana clients, delivering superior scalability, performance, and latency.

🛠️ Continuous Improvement: We're constantly enhancing our infrastructure:

  • Expanding our global node network to meet growing demand
  • Deploying in new regions with diverse infrastructure providers
  • Implementing a Priority Fee API for optimal transaction handling during network congestion
  • Investing in next-gen hardware and secure priority access to additional servers
  • Refining our hyperscaling technology for improved transaction routing and support for emerging methods

Sign up for a free account here and create a Solana endpoint:

We ❤️ Feedback!

Let us know if you have any feedback or requests for new topics. We'd love to hear from you.

Follow us on Twitter and join our Discord to stay up to date with the latest developments.

Resources

Share this guide