Skip to content

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.

// 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.

3 participants