Skip to content

Commit 122c474

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

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/vm/src/runTx.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,15 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {
628628
debugGas(`tx add baseFee ${intrinsicGas} to totalGasSpent (-> ${results.totalGasSpent})`)
629629
}
630630

631+
if (vm.common.isActivatedEIP(7623)) {
632+
if (results.totalGasSpent < floorCost) {
633+
results.totalGasSpent = floorCost
634+
if (vm.DEBUG) {
635+
debugGas(`tx apply floorCost ${floorCost} to totalGasSpent (-> ${results.totalGasSpent})`)
636+
}
637+
}
638+
}
639+
631640
// Add blob gas used to result
632641
if (isBlob4844Tx(tx)) {
633642
results.blobGasUsed = totalblobGas
@@ -650,11 +659,6 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {
650659
}
651660
}
652661

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

659663
results.amountSpent = results.totalGasSpent * gasPrice
660664

0 commit comments

Comments
 (0)