Skip to content

Commit

Permalink
move the floorcost update and add debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Dec 16, 2024
1 parent 7e8562e commit f55010d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/vm/src/runTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,14 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {
if (vm.DEBUG) {
debugGas(`tx add baseFee ${intrinsicGas} to totalGasSpent (-> ${results.totalGasSpent})`)
}
if (vm.common.isActivatedEIP(7623)) {
if (results.totalGasSpent < floorCost) {
results.totalGasSpent = floorCost
if (vm.DEBUG) {
debugGas(`tx apply floorCost ${floorCost} to totalGasSpent (-> ${results.totalGasSpent})`)
}
}
}

// Add blob gas used to result
if (isBlob4844Tx(tx)) {
Expand All @@ -650,11 +658,6 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {
}
}

if (vm.common.isActivatedEIP(7623)) {
if (results.totalGasSpent < floorCost) {
results.totalGasSpent = floorCost
}
}

results.amountSpent = results.totalGasSpent * gasPrice

Expand Down

0 comments on commit f55010d

Please sign in to comment.