solana
solana copied to clipboard
Feat: simulate multiple transactions RPC call
Problem
Currently, if you want to sign multiple transactions at once, wallets will send multiple simulateTransaction calls on each transaction, and if any of the transactions are dependent on previous transactions, the simulation will fail. This results in a "Transaction may fail to complete" error message on most wallets if some of the dependent simulations fail.
Summary of Changes
This PR adds support for simulating multiple dependent transactions in one call. It utilizes the account_override
field in the load_and_execute_transactions
Bank method to update the mutable accounts after each subsequent transaction.
TODO:
- [x] Add config values to limit max transactions to simulate
- [ ] Limit the max number of config_accounts that are passed in
- [ ] Figure out the performance overhead and potentially add some benchmarks here
- [ ] More complicated test cases
another reference implementation: https://github.com/jito-foundation/jito-solana/blob/e3f294ffa1d3856048189b3e47d92df7b53aae2b/rpc/src/rpc.rs#L3990
Thanks @buffalu! Reviewing the Jito implementation and fixing the issues you brought up!
What would the best way to benchmark the performance impacts an rpc change like this would have? I added some minimal rpc tests to make sure my code sorta works, but obviously that isn't sufficient for making sure this doesn't slow the validator down. Are there any existing rpc/performance benchmarks I could replicate for this? I couldn't find any in the rpc integration tests. If anyone could point me in the right direction for this that would be amazing!
Planning on working on this again. Is there a way to unmark this PR as stale without having to reopen it again?
This repository is no longer in use. Please re-open this pull request in the agave repo: https://github.com/anza-xyz/agave