go-ethereum/core/state
Arran Schlosberg 3ab3cd2c2b
feat(core/types): Block RLP overriding (#133)
## Why this should be merged

Support for configurable `core/types.Block` with RLP encoding, including
interplay with `Body`.

## How this works

`Block` doesn't export most of its fields so relies on an internal type,
`extblock`, for RLP encoding. This type is modified to implement the
`rlp.Encoder` and `Decoder` methods as a point to inject hooks using
`rlp.Fields` (as in #120 for `Body`).

`Block` shares the same registered extra type as `Body`. Unlike
`Header`, which has its own field in a `Block`, the fields in `Body` are
promoted to be carried directly. This suggests that (at least for pure
data payloads) the modifications might be equivalent (and
`ava-labs/coreth` evidences this). Should different payloads be
absolutely required in the future, we can split the types—the
`RegisterExtras` signature is already too verbose though 😢.

## How this was tested

Explicit inclusion of a backwards-compatibility test for
`NOOPBlockBodyHooks` + implicit testing via the multiple upstream tests
in `block_test.go`. Re implicit testing: default behaviour is now to use
the noop hooks even when no registration is performed, but if we change
this then the tests in `block_test.go` can still be called as subtests
from a test that explicitly registers noops.

---------

Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
Co-authored-by: Quentin McGaw <quentin.mcgaw@avalabs.org>
2025-02-13 16:20:17 +00:00
..
pruner [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
snapshot feat: state.SnapshotTree interface for drop-in replacement (#77) 2024-11-26 17:22:13 +00:00
access_list.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
database.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
dump.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
iterator.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
iterator_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
journal.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
metrics.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
state.libevm.go feat: types.HeaderHooks for RLP overrides (#89) 2024-12-17 13:54:58 +00:00
state.libevm_test.go feat(core/types): Block RLP overriding (#133) 2025-02-13 16:20:17 +00:00
state_object.go fix: state.stateObject.empty() with extra payload (#62) 2024-10-28 11:34:19 -07:00
state_object.libevm_test.go feat(core/types): Block RLP overriding (#133) 2025-02-13 16:20:17 +00:00
state_object_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
state_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
statedb.go feat: state.SnapshotTree interface for drop-in replacement (#77) 2024-11-26 17:22:13 +00:00
statedb.libevm.go feat: state.SnapshotTree interface for drop-in replacement (#77) 2024-11-26 17:22:13 +00:00
statedb.libevm_test.go feat: state.SnapshotTree interface for drop-in replacement (#77) 2024-11-26 17:22:13 +00:00
statedb_fuzz_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
statedb_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
sync.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
sync_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
transient_storage.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
trie_prefetcher.go feat(core/state): async trie prefetching (#76) 2024-11-26 08:01:47 -08:00
trie_prefetcher.libevm.go feat(core/state): async trie prefetching (#76) 2024-11-26 08:01:47 -08:00
trie_prefetcher.libevm_test.go feat(core/state): async trie prefetching (#76) 2024-11-26 08:01:47 -08:00
trie_prefetcher_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00