1

We used the ComputeBudget Program and set the Unit Price and Unit Limit.

I have increased the Unit Limit from the default of 200K, but it appears that transactions are being lost more frequently than when the Unit Limit was 200K.

What is the use case for raising the compute unit above 200K? Is it unnecessary to just run SOL send/receive (SystemProgram.Transfer) or StakeProgram?

1 Answer 1

2

That can indeed be the case. As the scheduler is currently implemented increasing priority fees above a certain point does not help much and transactions with samller requested cu are more likely to be included. It makes no sense to request more than you need it just makes it harder for the scheduler to predict how much blockspace it can schedule. Around 300 CU are enough for a simple transfer for example. The cu limit influences the priorit fee depending on how many microlamports per cu you define. Here some resources: cu optimization thread: https://x.com/solplay_jonas/status/1768657446111789313?s=46&t=pb8I5Pb14n_KFLIDwDfdSA. Scheduler explained: https://youtu.be/R7hq8ampBio?si=XOl_MhdyVCD0w6_K especially interesting is the part about the new version in 1.18

You can simulate your transaction and request exactly how many CUs your transaction will need and then request them. For example like so: enter image description here https://x.com/DoctorBlocks/status/1767228653744607240?s=20

https://gist.github.com/stegaBOB/7c0cdc916db4524dd9c285f9e4309475

2
  • Thank you. In the case of other blockchains, the higher the Fee, the faster the approval. unit limit 100000 and unit limit 10000, the former has a higher Fee, but can it delay the approval more than the latter? It is difficult to estimate the best unit limit...
    – Koichi
    Commented Mar 17 at 7:15
  • You can simulate and see how much the transaction needs, i updated the answer.
    – Jonas H.
    Commented Mar 17 at 16:44

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.