go-ethereum/eth
rjl493456442 03c37cdb2b
core/state: introduce code reader interface (#30816)
This PR introduces a `ContractCodeReader` interface with functions defined:

type ContractCodeReader interface {
	Code(addr common.Address, codeHash common.Hash) ([]byte, error)
	CodeSize(addr common.Address, codeHash common.Hash) (int, error)
}

This interface can be implemented in various ways. Although the codebase
currently includes only one implementation, additional implementations
could be created for different purposes and scenarios, such as a code
reader designed for the Verkle tree approach or one that reads code from
the witness.

*Notably, this interface modifies the function’s semantics. If the
contract code is not found, no error will be returned. An error should
only be returned in the event of an unexpected issue, primarily for
future implementations.*

The original state.Reader interface is extended with ContractCodeReader
methods, it gives us more flexibility to manipulate the reader with additional
logic on top, e.g. Hooks.

type Reader interface {
	ContractCodeReader
	StateReader
}

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-11-29 15:32:45 +01:00
..
catalyst core/txpool, eth/catalyst: clear transaction pool in Rollback (#30534) 2024-11-19 13:35:52 +01:00
downloader build: update to golangci-lint 1.61.0 (#30587) 2024-10-14 19:25:22 +02:00
ethconfig eth/ethconfig: improve error message if TTD missing (#30807) 2024-11-26 09:49:12 +08:00
fetcher eth/fetcher: fix blob transaction propagation (#30125) 2024-09-06 13:32:01 +03:00
filters core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
gasestimator core, eth, internal, cmd: rework EVM constructor (#30745) 2024-11-20 12:35:52 +01:00
gasprice core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
protocols core/state: introduce code reader interface (#30816) 2024-11-29 15:32:45 +01:00
tracers all: exclude empty outputs in requests commitment (#30670) 2024-11-28 11:48:50 +01:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go core, eth, internal, cmd: rework EVM constructor (#30745) 2024-11-20 12:35:52 +01:00
api_debug.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
api_debug_test.go core/state: state reader abstraction (#29761) 2024-09-05 13:10:47 +03:00
api_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
bloombits.go eth: move eth.Config to a common package (#22205) 2021-02-05 13:51:15 +01:00
handler.go core, trie, triedb: minor changes from snapshot integration (#30599) 2024-10-18 17:06:31 +02:00
handler_eth.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
handler_eth_test.go build: update to golangci-lint 1.61.0 (#30587) 2024-10-14 19:25:22 +02:00
handler_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
peer.go eth: remove admin.peers[i].eth.head and difficulty (#26804) 2023-03-06 09:27:46 +02:00
peerset.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
state_accessor.go core, eth, internal, miner: remove unnecessary parameters (#30776) 2024-11-22 08:17:32 +01:00
sync.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
sync_test.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00