go-ethereum/core/vm
qu0b 734fa6f8a5 core/vm: fix EIP-8037 blockGasUsed underflow from code-store OOG
When CREATE init code produces valid code but UseGas fails for code
storage, TotalStateGasCharged was incremented by the full code storage
state gas (potentially millions) without consuming any actual gas.
This inflated TSC propagated up through RefundGas and caused
blockGasUsed() to underflow (execRegularUsed = totalExecUsed - TSC
wraps uint64), resulting in incorrect gas pool accounting and state
root mismatches when validating blocks from other clients.

The fix removes the TSC increment when UseGas fails for code storage.
Since the contract creation failed and state was reverted, the state
gas demand didn't materialize and shouldn't be tracked.

Also removes the ErrCodeStoreOutOfGas case from isCodeValidation since
TSC is no longer inflated in that code path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 01:26:33 +00:00
..
program all: fix problematic function name in comment (#32513) 2025-08-29 08:54:23 +08:00
runtime core: fix rebasing issues 2026-03-05 13:55:51 +01:00
testdata core/vm: switch modexp gas computation to uint64 (#32527) 2025-09-08 13:33:10 +02:00
analysis_legacy.go core/vm: add configurable jumpdest analysis cache (#32143) 2025-08-01 13:57:38 +02:00
analysis_legacy_test.go core/vm: using testing.B.Loop (#32660) 2025-09-19 17:06:55 -06:00
common.go core: implement eip 7954 increase Maximum Contract Size 2026-03-04 20:03:50 -05:00
contract.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
contracts.go core/vm: touch precompile object with Amsterdam enabled (#33742) 2026-02-24 21:55:10 +08:00
contracts_fuzz_test.go core/vm: touch precompile object with Amsterdam enabled (#33742) 2026-02-24 21:55:10 +08:00
contracts_test.go core/vm: touch precompile object with Amsterdam enabled (#33742) 2026-02-24 21:55:10 +08:00
doc.go core/vm: remove JIT VM codes (#16362) 2018-03-26 13:48:04 +03:00
eips.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
errors.go build: update to golangci-lint 1.61.0 (#30587) 2024-10-14 19:25:22 +02:00
evm.go core/vm: fix EIP-8037 blockGasUsed underflow from code-store OOG 2026-03-07 01:26:33 +00:00
gas.go core/vm, cmd/evm: implement eof validation (#30418) 2024-10-02 15:05:50 +02:00
gas_table.go core: fixed issues from devnet 2026-03-05 19:29:57 +01:00
gas_table_test.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
gascosts.go core: fixed issues from devnet 2026-03-05 19:29:57 +01:00
instructions.go core: fixed issues from devnet 2026-03-05 19:29:57 +01:00
instructions_test.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
interface.go all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
interpreter.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
interpreter_test.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
jump_table.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
jump_table_export.go core/vm: use amsterdam jump table in lookup (#33947) 2026-03-04 13:42:25 +08:00
jump_table_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
jumpdests.go core/vm: add configurable jumpdest analysis cache (#32143) 2025-08-01 13:57:38 +02:00
memory.go core/vm: improve memory resize (#33056) 2025-11-26 16:50:16 +01:00
memory_table.go core/vm, cmd/evm: remove EOF (#32000) 2025-06-11 14:50:46 +02:00
memory_test.go core/vm: improve memory resize (#33056) 2025-11-26 16:50:16 +01:00
opcodes.go core/vm: implement eip-7843: SLOTNUM (#33589) 2026-02-26 13:53:46 +01:00
operations_acl.go core/vm: fix EIP-8037 CALL state gas ordering 2026-03-06 21:23:20 +00:00
operations_verkle.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
stack.go core/vm: improved stack swap performance (#30249) 2024-08-06 14:38:47 +02:00
stack_table.go core/vm: 64 bit memory and gas calculations (#19210) 2019-03-12 11:40:05 +02:00