Skip to content

Commit f55010d

Browse files
committed
move the floorcost update and add debug log
1 parent 7e8562e commit f55010d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/vm/src/runTx.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,14 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {
627627
if (vm.DEBUG) {
628628
debugGas(`tx add baseFee ${intrinsicGas} to totalGasSpent (-> ${results.totalGasSpent})`)
629629
}
630+
if (vm.common.isActivatedEIP(7623)) {
631+
if (results.totalGasSpent < floorCost) {
632+
results.totalGasSpent = floorCost
633+
if (vm.DEBUG) {
634+
debugGas(`tx apply floorCost ${floorCost} to totalGasSpent (-> ${results.totalGasSpent})`)
635+
}
636+
}
637+
}
630638

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

653-
if (vm.common.isActivatedEIP(7623)) {
654-
if (results.totalGasSpent < floorCost) {
655-
results.totalGasSpent = floorCost
656-
}
657-
}
658661

659662
results.amountSpent = results.totalGasSpent * gasPrice
660663

0 commit comments

Comments
 (0)