Skip to content

Request compute units per price update instruction #44

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

Merged
merged 3 commits into from
Feb 15, 2023
Merged

Request compute units per price update instruction #44

merged 3 commits into from
Feb 15, 2023

Conversation

jayantk
Copy link
Contributor

@jayantk jayantk commented Feb 15, 2023

The new pyth agent seems to request 20k CUs for the entire transaction

https://explorer.solana.com/tx/5zzK9k3pBrL7aH4jMrSrYLjT5AnqbRqu4aE5gK7ozF3MRCzdhhCrcXZu3Fdzo5uUiYF3YdrVAoVfvkJK29rrzuMU

but the old agent seems to request 20k CUs per price update instruction in the transaction:

https://explorer.solana.com/tx/4ASipr9GayTsejvRxLneWiMaZXdbwASo6iGtTYLM3pwwMU1u7X1HZ94K9Lvs2ntNQn45zt1EZ6V9xANwRfyx7kYJ

This explains why the new pyth-agent is running out of compute on mainnet. This PR changes it to request cus per instruction.

@@ -383,7 +384,7 @@ impl Exporter {

// Pay priority fees, if configured
instructions.push(ComputeBudgetInstruction::set_compute_unit_limit(
self.config.compute_unit_limit,
self.config.compute_unit_limit * refreshed_batch_size,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should actually be the length of the instructions vector.

@jayantk jayantk merged commit 3bf50bf into main Feb 15, 2023
@jayantk jayantk deleted the cu_fix branch February 15, 2023 23:49
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.

2 participants