1

Due to some limitations in my protocol I can't really estimate the budget needed for Solana transactions to successfully execute. I am using durable nonces so I want transactions to be executed so the nonce advances correctly. However, when a transaction's compute budget is lower than the compute limits used I can't get the transaction included in a block (of course as a failed transaction).

I am sending the transactions with the skip_preflight enabled so even reverted transactions get sent. That works well for transactions that revert somewhere in the program execution, in a sense that they get included in a block (as a failed transaction of course). However, for transactions where the computational budget is exceeded the transactions are never included on chain. Is that intended behavior of the Solana validators or am I missing something?

1 Answer 1

0

If the computational budget of a transaction is exceeded, it is always reverted. You can't have a successful transaction that doesn't finish.

Imagine a smart contract for trading where you send token A into it, then it sends back token B. If the computational budget is exceeded in between the two transfers, and the transaction is successful, then you'll have sent in token A, but never received token B. You would have a huge opportunity to hack the network and steal everything!

It would be better to avoid using skip_preflight in your case to avoid sending a failing transaction. You can always modify the compute unit limit and try again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.