1
0
Fork 0
forked from forks/go-ethereum
go-ethereum-modded-tocallarg/core/vm
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
..
program
runtime
testdata
analysis_eof.go
analysis_legacy.go
analysis_legacy_test.go
common.go
contract.go
contracts.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
contracts_fuzz_test.go
contracts_test.go
doc.go
eips.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
eof.go
eof_control_flow.go
eof_immediates.go
eof_instructions.go
eof_test.go
eof_validation.go
eof_validation_test.go
errors.go
evm.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
gas.go
gas_table.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
gas_table_test.go
instructions.go all: create global hasher pool (#31769) 2025-05-09 13:52:40 +08:00
instructions_test.go
interface.go core/state: fix incorrect description of function behavior (#31809) 2025-05-12 15:41:24 +08:00
interpreter.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
interpreter_test.go
jump_table.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
jump_table_export.go
jump_table_test.go
memory.go
memory_table.go
memory_test.go
opcodes.go
operations_acl.go
operations_verkle.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
stack.go
stack_table.go