mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 16:01:36 +00:00
Replace the gob-encoded `rawdb.{Read,Write}VerkleTransitionState`
plumbing with a direct read from the binary transition registry system
contract at `params.BinaryTransitionRegistryAddress`. The registry
exposes the transition state via fixed storage slots; a tiny
`StorageReader` interface (`Storage(addr, slot) (Hash, error)`)
captures what the loader needs.
`LoadTransitionState` now takes a `StorageReader` instead of an
`ethdb.KeyValueReader` and returns `nil` when the registry has not been
initialised (slot 0 unset). `IsTransitionActive` is exposed for callers
that only need the started flag.
`core/state/reader.go:newUBTTrieReader` is updated:
- It now takes the binary triedb, an optional MPT triedb, and a
`wrapInTransitionTrie` flag so callers can opt out of the wrap.
- It uses a small `binTrieStorageReader` adapter to query the
registry directly from the binary trie at the requested root,
avoiding the MPT key-hashing in `flatReader`.
- When wrap=true and the registry's BaseRoot is non-zero, the MPT
base is opened against the supplied MPT triedb. With the current
callers (mptdb=nil) the wrap degenerates to a passthrough,
preserving existing master semantics until the dual-triedb routing
lands in the next commit.
The dead `rawdb` accessors and `VerkleTransitionStatePrefix` schema
constant are removed.
|
||
|---|---|---|
| .. | ||
| state_transition.go | ||