You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON RPC simulate_transaction method does not return a meaningful consumed_units. It returns what is consumed by the successful ixs only. Rather than the total consumed units.
According to the docs for simulateTransaction at https://docs.solana.com/api/http#simulatetransaction, the unitsConsumed field is "The number of compute budget units consumed during the processing of this transaction", which means that it should probably be reporting all units consumed, even from an errored instruction.
Whoa, is that AI spam? I wonder where it got the 545 value.
"each successful instruction manual" is my favorite part.
Okay, I'll shut up now, in case this will encourage it.
Problem
The JSON RPC simulate_transaction method does not return a meaningful
consumed_units
. It returns what is consumed by the successful ixs only. Rather than the total consumed units.Example:
https://explorer.solana.com/tx/3KMqaFZQwWaL9evSZYWHzptxdqZfS7o1XhQDgLmvPzU1hsAgssnWqQJTWYfXbqBMH4MimSEjLSepQg74aYxe9GN2
Simulating this transaction returned
consumed_units
19165However, it consumed 111,898 units. That value is correct in the transaction meta after submitting as we can see in the explorer
Proposed Solution
@joncinque found it should be an easy fix by adding
total_errored_units
toaccumulated_units
solana/runtime/src/bank.rs
Lines 4359 to 4365 in 2dfcdce
The text was updated successfully, but these errors were encountered: