Giter Site home page Giter Site logo

Comments (7)

BCIGRA avatar BCIGRA commented on September 16, 2024 1

Perhaps the node provider (RPC) requires maintenance?

I've attempted various troubleshooting steps. While processing data, I utilize the rpc helius, and for sending transaction data, I employ mainnet beta. Some transactions have gone through, indicating that there may be an issue with the RPC provider node that needs to be addressed.

from raydium-sdk-v1-demo.

DYSIM avatar DYSIM commented on September 16, 2024

same here, code worked 2 days ago but no longer

from raydium-sdk-v1-demo.

oxtrue-dev avatar oxtrue-dev commented on September 16, 2024

Can anyone solve this problem.?

from raydium-sdk-v1-demo.

WolfXBT avatar WolfXBT commented on September 16, 2024

Solana is heavily congested. To increase the chances of your transactions being included you must add priority fee to them. Unfortunately it does not guarantee that it will be accepted... Refer to this tweet to know why: https://twitter.com/0xCygaar/status/1776331763477819701

If you want a function that handle priority fee, add this in utils.ts:

export async function createAndSendV0Tx(txInstructions: TransactionInstruction[], wallets: Keypair[]) {

  let latestBlockhash = await connection.getLatestBlockhash('finalized');

  // Set your fee values here 
  const priority_fee_price = ComputeBudgetProgram.setComputeUnitPrice({microLamports: 25000})
  txInstructions.push(priority_fee_price);

  const messageV0 = new TransactionMessage({
    payerKey: wallets[0].publicKey,
    recentBlockhash: latestBlockhash.blockhash,
    instructions: txInstructions
  }).compileToV0Message();
  const transaction = new VersionedTransaction(messageV0);
  
  console.log("Transaction size:", transaction.serialize().length);

  transaction.sign(wallets);

  const txid = await connection.sendTransaction(transaction, { skipPreflight: true, maxRetries: 5 });
  console.log("Transaction sent to network");

  const confirmation = await connection.confirmTransaction({ signature: txid, blockhash: latestBlockhash.blockhash, lastValidBlockHeight: latestBlockhash.lastValidBlockHeight });
  
  if (confirmation.value.err) { throw new Error("Transaction not confirmed.") }
  console.log(`Transaction succesfully confirmed! https://explorer.solana.com/tx/${txid}`);
}

Then in the scripts instead of:

return { txids: await buildAndSendTx(innerTransactions) }

Do this:

return await createAndSendV0Tx(innerTransactions[0].instructions, [wallet]);

If your transaction doesn't show on the explorer after that, try to increase the priority fee and / or change RPC.

You can come to the Raydium discord in the ask-dev channel, you will get more active assistance than here.

from raydium-sdk-v1-demo.

BCIGRA avatar BCIGRA commented on September 16, 2024

So we need to set the microLamports higher, right?

from raydium-sdk-v1-demo.

WolfXBT avatar WolfXBT commented on September 16, 2024

As stated in the tweet I shared, the problem is bots spamming the nodes, most transactions don't even get in because they are full. The fee is for when your transaction is received, to be prioritized and not fail. So, having a priority fee + retrying to send your transaction is the solution. But don't set the microLamports too high, 25000-250000 max should do, more would be a waste of money.

4
(Source: 0xCygaar and 0xBreadguy)

from raydium-sdk-v1-demo.

DYSIM avatar DYSIM commented on September 16, 2024

Priority fees is likely less important than the tx dropping in this case. You can use the method getRecentPriorityFees method to do a check. most txns does not pay that much priority fees to get executed.

For the bot that spams txn on the network layer, is it correct to state there is no fee imposed on them since those dropped txn never made it to chain to pay any fee? So it is a matter of free spamming till your txn gets through.

from raydium-sdk-v1-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.