go-ethereum/core
Guillaume Ballet af9a3a1a03
core/state, core/vm: update stateless gas costs to follow the verkle-gen-7 testnet (#31014)
Adding values to the witness introduces a new class of issues for
computing gas: if there is not enough gas to cover adding an item to the
witness, then the item should not be added to the witness.

The problem happens when several items are added together, and that
process runs out of gas. The witness gas computation needs a way to
signal that not enough gas was provided. These values can not be
hardcoded, however, as they are context dependent, i.e. two calls to the
same function with the same parameters can give two different results.

The approach is to return both the gas that was actually consumed, and
the gas that was necessary. If the values don't match, then a witness
update OOG'd. The caller should then charge the `consumed` value
(remaining gas will be 0) and error out.

Why not return a boolean instead of the wanted value? Because when
several items are touched, we want to distinguish which item lacked gas.

---------

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2025-05-15 20:43:52 +08:00
..
filtermaps logs(indexer)Clean up log format in head index progress messages (#31761) 2025-05-05 10:09:58 +08:00
forkid params: add prague timestamp for mainnet (#31535) 2025-04-17 10:46:00 +02:00
history core: initialize history pruning in BlockChain (#31636) 2025-04-15 14:32:46 +02:00
rawdb all: create global hasher pool (#31769) 2025-05-09 13:52:40 +08:00
state core/state, core/vm: update stateless gas costs to follow the verkle-gen-7 testnet (#31014) 2025-05-15 20:43:52 +08:00
stateless
tracing
txpool core/txpool/legacypool: fix data race of pricedList access (#31758) 2025-05-04 10:16:33 +08:00
types core/types: reduce allocations in tx.EffectiveGasTip (#31598) 2025-05-09 12:56:00 +02:00
vm core/state, core/vm: update stateless gas costs to follow the verkle-gen-7 testnet (#31014) 2025-05-15 20:43:52 +08:00
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
bench_test.go core, ethdb: introduce database sync function (#31703) 2025-05-08 19:10:26 +08:00
block_validator.go
block_validator_test.go core: initialize history pruning in BlockChain (#31636) 2025-04-15 14:32:46 +02:00
blockchain.go core: use unix time to check fork readiness (#31800) 2025-05-14 09:26:08 +08:00
blockchain_insert.go metrics: add chain/mgasps to track gas usage rate (#31753) 2025-05-10 08:27:27 +08:00
blockchain_reader.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
blockchain_repair_test.go core, ethdb: introduce database sync function (#31703) 2025-05-08 19:10:26 +08:00
blockchain_sethead_test.go core, ethdb: introduce database sync function (#31703) 2025-05-08 19:10:26 +08:00
blockchain_snapshot_test.go core, ethdb: introduce database sync function (#31703) 2025-05-08 19:10:26 +08:00
blockchain_test.go core, ethdb: introduce database sync function (#31703) 2025-05-08 19:10:26 +08:00
chain_makers.go core: fail execution if system call fails to execute (#31639) 2025-04-19 13:42:54 +02:00
chain_makers_test.go
dao_test.go
error.go core, eth/downloader: implement pruning mode sync (#31414) 2025-04-03 15:16:35 +02:00
events.go
evm.go params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
gaspool.go core, miner: revert block gas counter in case of invalid transaction (#26799) 2023-03-07 05:23:52 -05:00
gen_genesis.go
genesis.go core: apply overrides to mainnet chainconfig (#31733) 2025-04-29 08:29:56 +02:00
genesis_alloc.go
genesis_test.go
headerchain.go core, ethdb: introduce database sync function (#31703) 2025-05-08 19:10:26 +08:00
headerchain_test.go
mkalloc.go
rlp_test.go
sender_cacher.go
state_prefetcher.go core: implement in-block prefetcher (#31557) 2025-05-08 22:28:16 +08:00
state_processor.go core: fail execution if system call fails to execute (#31639) 2025-04-19 13:42:54 +02:00
state_processor_test.go ethclient: allow passing AuthorizationList to calls (#31198) 2025-04-23 21:01:03 +02:00
state_transition.go core/state, core/vm: update stateless gas costs to follow the verkle-gen-7 testnet (#31014) 2025-05-15 20:43:52 +08:00
stateless.go
txindexer.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
txindexer_test.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
types.go
verkle_witness_test.go