nimbus-eth1/nimbus/db/ledger
Jordan Hrycaj 889a1165b0
Core db+aristo update tracer for non trivial operations (#2102)
* Remove cruft

* Docu/code cosmetics

* Aristo: Update `forkBase()`

why:
  Was not up to the job

* Update/correct tracer for running against `Aristo`

details:
  This patch makes sure that before creating a new `BaseVMState` the
  `CoreDb` context is adjusted to accommodate for the state root that
  is passed to the `BaseVMState` constructor.

* CpreDb+legacy: Always return current context with `ctxFromTx()`

why:
  There was an experimental setting trying to find the node with the
  proper setting in the KVT (not the hexary tie layer) which currently
  does not work reliable, probably due to `Ledger` caching effects.
2024-03-22 17:31:56 +00:00
..
backend Core db implement ctx layer for mpt state admin (#2082) 2024-03-18 19:40:23 +00:00
base Core db implement ctx layer for mpt state admin (#2082) 2024-03-18 19:40:23 +00:00
README.md Ledger abstraction for accounts cache (#1824) 2023-10-18 20:27:22 +01:00
accounts_cache.nim Fix 'value out of range' RangeDefect in block witness generation. (#2072) 2024-03-19 15:41:40 +08:00
accounts_ledger.nim Core db simplify new api storage modes (#2075) 2024-03-14 22:17:43 +00:00
base.nim Core db implement ctx layer for mpt state admin (#2082) 2024-03-18 19:40:23 +00:00
base_iterators.nim Core db implement ctx layer for mpt state admin (#2082) 2024-03-18 19:40:23 +00:00
distinct_ledgers.nim Core db+aristo update tracer for non trivial operations (#2102) 2024-03-22 17:31:56 +00:00

README.md

The file accounts_cache.nim has been relocated

Background

The new LedgerRef module unifies different implementations of the accounts_cache. It is intended to be used as new base method for all of the AccountsCache implementations. Only constructors differ, depending on the implementation.

This was needed to accomodate for different CoreDb API paradigms. While the overloaded legacy AccountsCache implementation is just a closure based wrapper around the accounts_cache module, the overloaded AccountsLedgerRef is a closure based wrapper around the accounts_ledger module with the new CoreDb API returning Result[] values and saparating the meaning of trie root hash and trie root reference.

This allows to use the legacy hexary database (with the new CoreDb API) as well as the Aristo database (only supported on new API.)

Instructions

Legacy notation LedgerRef replacement Comment
import accounts_cache import ledger preferred method,
AccountsCache.init(..) AccountsCache.init(..) wraps AccountsCache
methods
or
import ledger/accounts_cache stay with legacy
AccountsCache.init(..) version of
AccountsCache
--
fn(ac: AccountsCache) fn(ac: LedgerRef) function example for
preferred wrapper
or method
fn(ac: AccountsCache) with legacy version,
no change here

The constructor decides which CoreDb API is to be used

Legacy API constructor new API Constructor
import ledger import ledger
let w = AccountsCache.init(..) let w = AccountsLedgerRef.init(..)