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

solana-program-test: warp_to_slot resets program cache, causing slowness #33390

Closed
ckamm opened this issue Sep 25, 2023 · 0 comments
Closed

solana-program-test: warp_to_slot resets program cache, causing slowness #33390

ckamm opened this issue Sep 25, 2023 · 0 comments
Labels
community Community contribution stale [bot only] Added to stale content; results in auto-close after a week.

Comments

@ckamm
Copy link
Contributor

ckamm commented Sep 25, 2023

Problem

For the mango program we recently investigated upgrading to solana 1.16.14. When we did, the program tests started taking >10x as long.

Debugging showed that every single transaction we sent with banks_client.process_transaction_with_commitment() would take 280ms in Bank::replenish_program_cache to reload the mango and token programs.

This happened because we used ProgramTestContext::warp_to_slot after every transaction. Apparently that used to preserve the cache but now resets it somehow.

We were able to work around the issue by removing warp_to_slot. (we only cared about new blockhashes for every transaction, and using the new get_new_latest_blockhash() works just as well for that)

Proposed Solution

Make warp_to_slot() retain the program cache as before

@ckamm ckamm added the community Community contribution label Sep 25, 2023
@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Sep 25, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

No branches or pull requests

1 participant