go-ethereum/core
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
..
filtermaps core/filtermaps: fix operator precedence in delete logging condition (#33280) 2025-12-06 04:21:38 +01:00
forkid params: set osaka and BPO1 & BPO2 mainnet dates (#33063) 2025-11-03 17:41:22 +01:00
history core: initialize history pruning in BlockChain (#31636) 2025-04-15 14:32:46 +02:00
overlay core/overlay: fix incorrect debug log key/value in LoadTransitionState (#32637) 2025-12-14 21:51:13 +01:00
rawdb all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
state address more lint errors 2026-03-04 21:17:43 -05:00
stateless cmd/geth: add inspect trie tool to analysis trie storage (#28892) 2026-02-24 10:56:00 -07:00
tracing all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
txpool core: fix rebasing issues 2026-03-05 13:55:51 +01:00
types address more lint errors 2026-03-04 21:17:43 -05:00
vm core/vm: fix EIP-8037 blockGasUsed underflow from code-store OOG 2026-03-07 01:26:33 +00:00
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
bench_test.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
bintrie_witness_test.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
block_validator.go all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
block_validator_test.go eth/catalyst: add initial OpenTelemetry tracing for newPayload (#33521) 2026-02-17 17:08:57 +01:00
blockchain.go address more lint errors 2026-03-04 21:17:43 -05:00
blockchain_insert.go core: remove unused peek function in insertIterator (#33155) 2025-11-12 15:30:16 +08:00
blockchain_reader.go ethstats: report newPayload processing time to stats server (#33395) 2026-01-05 17:49:30 +01:00
blockchain_repair_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
blockchain_sethead_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
blockchain_snapshot_test.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
blockchain_stats.go all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
blockchain_test.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
chain_makers.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
chain_makers_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
dao_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
error.go core: implement eip-7778: block gas accounting without refunds (#33593) 2026-03-04 18:18:18 +08:00
eth_transfer_logs_test.go core, core/vm: implement EIP-7708 2026-03-04 19:23:37 -05:00
events.go ethstats: report newPayload processing time to stats server (#33395) 2026-01-05 17:49:30 +01:00
evm.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
gaspool.go core: fixed issues from devnet 2026-03-05 19:29:57 +01:00
gen_genesis.go all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
genesis.go all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
genesis_alloc.go params: add hoodi testnet definition (#31406) 2025-03-18 12:07:49 +01:00
genesis_test.go trie/bintrie: fix tree key hashing to match spec (#33694) 2026-01-28 11:51:02 +01:00
headerchain.go core/rawdb: reduce allocations in rawdb.ReadHeaderNumber (#31913) 2025-07-15 15:48:36 +02:00
headerchain_test.go core/state, core/tracing: new state update hook (#33490) 2026-01-08 11:07:19 +08:00
mkalloc.go accounts, cmd/geth, core: close opened files (#29598) 2024-04-30 15:47:21 +02:00
parallel_state_processor.go core: fixed issues from devnet 2026-03-05 17:26:27 +01:00
rlp_test.go crypto/keccak: vendor in golang.org/x/crypto/sha3 (#33323) 2026-02-03 14:55:27 -07:00
sender_cacher.go core: use sync.Once for SenderCacher initialization (#31029) 2025-01-16 14:36:45 +01:00
state_prefetcher.go core: implement eip-7778: block gas accounting without refunds (#33593) 2026-03-04 18:18:18 +08:00
state_processor.go core: fix rebasing issues 2026-03-05 13:55:51 +01:00
state_processor_test.go core/vm: implement eip-7843: SLOTNUM (#33589) 2026-02-26 13:53:46 +01:00
state_transition.go core/vm: fix EIP-8037 CALL state gas ordering 2026-03-06 21:23:20 +00:00
stateless.go all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00
txindexer.go core/rawdb: reduce allocations in rawdb.ReadHeaderNumber (#31913) 2025-07-15 15:48:36 +02:00
txindexer_test.go core/rawdb: integrate eradb backend for RPC (#31604) 2025-06-03 10:47:38 +02:00
types.go all: implement eip 7928 block access lists 2026-03-04 20:03:46 -05:00