• Pricing
  • Enterprise
  • Customers
  • Blog

Prepare now for the Solana Agave 2.0 upgrade

The Solana Agave 2.0 upgrade is just around the corner, and Chainstack is fully prepared to support you through this major release! This is more than just an upgrade—it’s a significant step in enhancing the decentralization, security, and performance of the Solana blockchain. As a Web3 developer, here’s everything you need to prepare for a seamless transition.

Why Solana Agave 2.0 matters?

Agave, the new Rust-based client for Solana, is designed to bolster network resilience by moving toward a multi-client structure. Alongside Agave, Solana is introducing the C-based Firedancer client. Together, these clients will decentralize and strengthen the network, requiring all nodes to transition to Agave v2.0 by October 21, 2024.

The Agave 2.0 upgrade affects various API methods, phasing out older methods and replacing them with optimized ones. This shift aims to minimize any potential disruptions, with backward-compatible replacements already widely available.

Key changes to prepare for

If you’re using any of the following deprecated API methods, now is the time to update your calls to ensure compatibility with Agave 2.0:

Deprecated methodReplacement method
confirmTransactiongetSignatureStatuses
getSignatureStatusgetSignatureStatuses
getSignatureConfirmationgetSignatureStatuses
getConfirmedSignaturesForAddressgetSignaturesForAddress
getConfirmedBlockgetBlock
getConfirmedBlocksgetBlocks
getConfirmedBlocksWithLimitgetBlocksWithLimit
getConfirmedTransactiongetTransaction
getConfirmedSignaturesForAddress2getSignaturesForAddress
getRecentBlockhashgetLatestBlockhash
getFeesgetFeeForMessage
getFeeCalculatorForBlockhashisBlockhashValid or getFeeForMessage
getFeeRateGovernorgetFeeForMessage
getSnapshotSlotgetHighestSnapshotSlot
getStakeActivationgetAccountInfo | Solana (alternative approach)

How to replace confirmTransaction with getSignaturesStatuses?

To replace the deprecated confirmTransaction method with its getSignaturesStatuses replacement, you can use the following:

import { Connection, Transaction, SendOptions } from '@solana/web3.js';
async function sendAndConfirmTransaction(
  connection: Connection,
  transaction: Transaction,
  timeout: number = 30000, // 30 seconds default timeout
  options?: SendOptions
): Promise<string> {
  // Send the transaction
  const signature = await connection.sendTransaction(transaction, options?.signers || [], {
    ...options,
    skipPreflight: options?.skipPreflight || false
  });
  // Create a promise that will reject after the timeout
  const timeoutPromise = new Promise((_, reject) => {
    setTimeout(() => {
      reject(new Error(`Transaction confirmation timeout after ${timeout}ms`));
    }, timeout);
  });
  // Create the confirmation promise
  const confirmationPromise = (async () => {
    let done = false;
    while (!done) {
      // Get the status of the transaction
      const response = await connection.getSignatureStatuses([signature]);
      const status = response.value[0];
      if (status) {
        if (status.err) {
          throw new Error(`Transaction failed: ${status.err.toString()}`);
        }
        // Check if we have enough confirmations
        if (status.confirmationStatus === 'finalized') {
          done = true;
          return signature;
        }
      }
      // Wait a bit before checking again
      await new Promise(resolve => setTimeout(resolve, 1000));
    }
  })();
  // Race between timeout and confirmation
  try {
    return await Promise.race([confirmationPromise, timeoutPromise]);
  } catch (error) {
    // If it's a timeout error, we should still return the signature
    if (error.message.includes('timeout')) {
      return signature;
    }
    throw error;
  }
}
// Example usage
async function example() {
  const connection = new Connection('CHAINSTACK_NODE');
  const transaction = new Transaction();
  // ... add your transaction instructions here ...
  try {
    const signature = await sendAndConfirmTransaction(connection, transaction, 60000, {
      skipPreflight: false,
      // ... other options
    });
    console.log('Transaction confirmed:', signature);
  } catch (error) {
    console.error('Transaction failed:', error);
  }
}

Chainstack: Ready for Agave 2.0

At Chainstack, we’ve ensured that your infrastructure is fully prepared for Agave 2.0, offering you a smooth and uninterrupted transition:

  • Seamless transition: Chainstack services are ready and fully compatible with Agave 2.0.
  • Enhanced security: Benefit from Agave’s multi-client architecture, designed to increase decentralization and security.
  • Optimized performance: Transitioning to updated API methods means faster and more reliable interaction with the Solana network.

To get ready for Agave 2.0, review the Agave v2.0 transition guide and adjust your API calls as needed. Our support team is on standby to assist, ensuring this transition is as seamless as possible for you.

Further reading

Bringing it all together

The Solana Agave 2.0 upgrade is a crucial step forward for the network, and at Chainstack, we’re ensuring that you can harness its full potential without any disruptions. By aligning our infrastructure with the Agave 2.0 upgrade, we’re giving you the tools you need to continue building scalable, secure, and high-performance DApps on Solana.

Stay informed, stay ahead, and build the future of Web3 together with Chainstack and Solana Agave 2.0.

Power-boost your project on Chainstack

Have you already explored what you can achieve with Chainstack? Get started for free today.

SHARE THIS ARTICLE
Customer Stories

Defined

Defined deliver real-time blockchain data for over 2M tokens and 800M NFTs with reliable Web3 infrastructure.

Brave Wallet

Brave Wallet optimizes cross-chain operations with reliable Chainstack RPC infrastructure, enhancing user experience and security.

IguVerse

Balancing the heavy network load of breakneck social gaming interactions on-chain with an adaptive BNB setup.