Open staaason opened 2 months ago
The root cause is that Solana doesn't have a Merkle Patricie Tree like Ethereum, and it doesn't have methods to get an account state BEFORE the transaction execution. It just has the RPC method to get not-committed/confirmed/finalized account state.
So the simulator in the following method loads the CURRENT account state: https://github.com/ZpokenWeb3/solana-zkvm/blob/203ec62cdc253b09805808a929fc3fa746e96ad5/risczero/methods/core/src/solana_simulator/mod.rs#L160
Case 1. Account https://solscan.io/account/8yjT3DD1ZfYDDrVJe23hhPsU1ag591s3WYKRP7sQkVBH in the current Solana state doesn't have tokens, and the transaction simulation failed with the corresponding error:
Program log: Error: insufficient funds
Case 2. Account https://solscan.io/account/3QCk918PfqHFaT8c3fewVT3JAXcgdXo9keDX3reXp5Sf doesn't exist anymore in the current Solana state, and the transaction simulation failed with the corresponding error:
Program log: AnchorError caused by account: order. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized.
So, to resolve the issue, you should provide the account state that is valid for the transaction execution.
An error occurs when processing some transactions from Mainnet in solana simulator, even though they are successful on Solscan:
Transfer method Tx link. Request:
Full log:
Monaco cancel order program Tx link Request:
Full log:
Calls were made from the host in this file and link to the program logic .
The exact issues occurred in the native Solana simulator.