Skip to content

Commit

Permalink
fix(levm): double substraction in GAS opcode (#1412)
Browse files Browse the repository at this point in the history
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->

**Description**

- previously there was a double substraction in `op_gas`, I removed
that.
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #1365

Co-authored-by: Ivan Litteri <[email protected]>
  • Loading branch information
JereSalo and ilitteri authored Dec 5, 2024
1 parent 378fa53 commit 9d1fe1c
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ impl VM {
.env
.gas_limit
.checked_sub(self.env.consumed_gas)
.ok_or(VMError::OutOfGas(OutOfGasError::ConsumedGasOverflow))?
.checked_sub(gas_cost::GAS)
.ok_or(VMError::OutOfGas(OutOfGasError::ConsumedGasOverflow))?;
.ok_or(OutOfGasError::ConsumedGasOverflow)?;
// Note: These are not consumed gas calculations, but are related, so I used this wrapping here
current_call_frame.stack.push(remaining_gas)?;

Expand Down

0 comments on commit 9d1fe1c

Please sign in to comment.