1
0
Fork 0
forked from forks/go-ethereum
go-ethereum-modded-tocallarg/core/state
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
..
pruner all: clean up goerli flag and config (#30289) 2024-08-20 15:59:48 +02:00
snapshot all: use fmt.Appendf instead of fmt.Sprintf where possible (#31301) 2025-03-25 14:53:02 +01:00
access_events.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
access_events_test.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
access_list.go core/state: remove pointless wrapper functions (#30891) 2024-12-11 11:05:59 +01:00
database.go core: implement in-block prefetcher (#31557) 2025-05-08 22:28:16 +08:00
dump.go core/state: fix log format (#31610) 2025-04-16 23:46:38 +02:00
iterator.go core/state: introduce code reader interface (#30816) 2024-11-29 15:32:45 +01:00
iterator_test.go core/state: state reader abstraction (#29761) 2024-09-05 13:10:47 +03:00
journal.go all: implement eip-7702 set code tx (#30078) 2024-12-16 11:29:37 +01:00
metrics.go core/rawdb,state: add preimage miss metric (#31295) 2025-03-07 11:23:19 +01:00
reader.go all: create global hasher pool (#31769) 2025-05-09 13:52:40 +08:00
state_object.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
state_object_test.go build: use golangci-lint (#20295) 2019-11-18 10:49:17 +02:00
state_test.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
statedb.go core/state: fix incorrect description of function behavior (#31809) 2025-05-12 15:41:24 +08:00
statedb_fuzz_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
statedb_hooked.go core/tracing: state journal wrapper (#30441) 2025-02-05 13:58:25 +01:00
statedb_hooked_test.go core/tracing: stringer for gas and nonce change reasons (#31234) 2025-02-28 12:53:56 +01:00
statedb_test.go core/tracing: state journal wrapper (#30441) 2025-02-05 13:58:25 +01:00
stateupdate.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
sync.go core,eth,internal: fix typo (#29024) 2024-02-20 19:42:48 +08:00
sync_test.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
transient_storage.go core/state: better randomized testing (postcheck) on journalling (#29627) 2024-04-25 09:56:25 +02:00
trie_prefetcher.go metrics, cmd/geth: change init-process of metrics (#30814) 2024-12-10 13:27:29 +01:00
trie_prefetcher_test.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00