Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solana swap transactions fail because block height is exceeded... no matter how many times I retry #1987

Closed
michaelessiet opened this issue Dec 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@michaelessiet
Copy link

No matter how many times I retry to send the transaction that I get from the Jupiter swap API I keep getting an error telling me that the block height has been exceeded. From what I gathered online I should just retry the transaction, however, that doesn't fix it, I just get the error repeated over and over again. Is there a way I can increate transaction priority, pay higher fee to get placed in the block or something?
The error is below

[TransactionExpiredBlockheightExceededError: Signature CFAGYcJesvueTRMtbJBXwBXP3GAdvpD4xfauoG4XfJCvgGLt5chCurSVqgpCSEygeJFC6d46VAgJyNwNq7Z6voT has expired: block height exceeded.]

Here's what the routes look like

[{"amount": "34892178", "inAmount": "34892178", "marketInfos": [[Object], [Object]], "otherAmountThreshold": "9706785", "outAmount": "9716501", "priceImpactPct": 0.003581409927264523, "slippageBps": 10, "swapMode": "ExactIn"}, {"amount": "34892178", "inAmount": "34892178", "marketInfos": [[Object], [Object], [Object]], "otherAmountThreshold": "9698066", "outAmount": "9707773", "priceImpactPct": 0.0043228319552641725, "slippageBps": 10, "swapMode": "ExactIn"}, {"amount": "34892178", "inAmount": "34892178", "marketInfos": [[Object], [Object], [Object]], "otherAmountThreshold": "9674055", "outAmount": "9683738", "priceImpactPct": 0.013760941264121307, "slippageBps": 10, "swapMode": "ExactIn"}]

I go through the process of serializing the this then signing it, then sending it using sendRawTransaction then I use the confirmTransaction function

await solanaService().provider.confirmTransaction({
    signature: txid,
    blockhash: blockData.blockhash,
    lastValidBlockHeight: blockData.lastValidBlockHeight
})
@michaelessiet michaelessiet added the bug Something isn't working label Dec 22, 2023
@mcintyre94
Copy link
Contributor

mcintyre94 commented Dec 22, 2023

This isn't a bug in web3js. You're probably correct that you need to increase the priority of your transaction. See Jupiter's documentation on that here.

If you're still having trouble please open a question on https://solana.stackexchange.com, we can't provide support through Github issues.

Copy link
Contributor

github-actions bot commented Jan 1, 2024

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants