Skip to content

Commit

Permalink
chore: ensure highest gas limit tracks txenv.gaslimit of success (#9702)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jul 22, 2024
1 parent 0592333 commit d07955e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/rpc/rpc-eth-api/src/helpers/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,11 @@ pub trait Call: LoadState + SpawnBlocking {

// At this point we know the call succeeded but want to find the _best_ (lowest) gas the
// transaction succeeds with. We find this by doing a binary search over the possible range.
//

// we know the tx succeeded with the configured gas limit, so we can use that as the
// highest, in case we applied a gas cap due to caller allowance above
highest_gas_limit = env.tx.gas_limit;

// NOTE: this is the gas the transaction used, which is less than the
// transaction requires to succeed.
let mut gas_used = res.result.gas_used();
Expand Down

0 comments on commit d07955e

Please sign in to comment.