Skip to content

Commit

Permalink
tx: add missing forks
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer committed Jan 13, 2025
1 parent 5abc991 commit 8535e2c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/tx/test/transactionRunner.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const file: string | undefined = argv.file

const forkNames: ForkName[] = [
'Prague',
'Cancun',
'Shanghai',
'Paris',
'London+3860',
'London',
'Berlin',
Expand All @@ -31,6 +34,9 @@ const forkNames: ForkName[] = [
const forkNameMap: ForkNamesMap = {
Prague: 'prague',
'London+3860': 'london',
Cancun: 'cancun',
Shanghai: 'shanghai',
Paris: 'paris',
London: 'london',
Berlin: 'berlin',
Istanbul: 'istanbul',
Expand Down
3 changes: 3 additions & 0 deletions packages/tx/test/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export type ForkName =
| 'Prague'
| 'Cancun'
| 'Shanghai'
| 'Paris'
| 'London+3860'
| 'London'
| 'Berlin'
Expand Down
8 changes: 5 additions & 3 deletions packages/vm/src/runTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,11 +652,13 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {

if (vm.common.isActivatedEIP(7623)) {
if (results.totalGasSpent < floorCost) {
// TODO: likely set `results.gasRefund = BIGINT_0`
results.totalGasSpent = floorCost
if (vm.DEBUG) {
debugGas(`tx apply floorCost ${floorCost} to totalGasSpent (-> ${results.totalGasSpent})`)
debugGas(
`tx floorCost ${floorCost} is higher than to total execution gas spent (-> ${results.totalGasSpent}), setting floor as gas paid`,
)
}
results.gasRefund = BIGINT_0
results.totalGasSpent = floorCost
}
}

Expand Down

0 comments on commit 8535e2c

Please sign in to comment.