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

Add compute unit request to transaction packing algorithm #110

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

nickgarfield
Copy link
Member

@nickgarfield nickgarfield commented Dec 7, 2022

Users (specifically, Helium) have been hitting the compute unit limit in their transactions. This PR adds a ComputeBudgetInstruction::set_compute_unit_limit instruction to the front of every transaction. During simulation, we request the maximum 1.4M compute units available, giving transactions the flexibility of using as many compute units as they need. After simulation, we update the transaction to request only the compute units that were actually consumed. This way, Clockwork transactions will always request exactly the number of compute units they need. This will help with prioritization when solana-labs/solana#28751 lands on Solana.

@nickgarfield nickgarfield merged commit dae6cf7 into main Dec 7, 2022
@nickgarfield
Copy link
Member Author

nickgarfield added a commit that referenced this pull request Dec 8, 2022
* Add compute unit request to transaction packing algorithm

* Dynamically set the compute unit limit based on simulation results

* Update import paths and comments

* Account for off-by-one error in transaction building

* Update log statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant