nimbus-eth1/nimbus/db/ledger
Jordan Hrycaj 3a62250d04
Make test op memory work again (#2236)
* Remove crufty `pruneTrie` arguments

* Replaced legacy `distinct_trie` logic by new `ledger` functionality

why:
  The module `distinct_trie` is supported by `Aristo` in trivial cases.

* Activate `test_op_memory`
2024-05-28 14:24:10 +00:00
..
backend Fix accounts_ledger savePoint conversion (#2226) 2024-05-26 17:42:02 +07:00
base Attempt to roll back stateless mode implementation in a single PR (#2209) 2024-05-22 21:01:19 +00:00
README.md Aristo resume off line syncing on pre loaded database (#2203) 2024-05-22 13:41:14 +00:00
accounts_ledger.nim Make test op memory work again (#2236) 2024-05-28 14:24:10 +00:00
base.nim Attempt to roll back stateless mode implementation in a single PR (#2209) 2024-05-22 21:01:19 +00:00
base_iterators.nim Aristo resume off line syncing on pre loaded database (#2203) 2024-05-22 13:41:14 +00:00
distinct_ledgers.nim Make test op memory work again (#2236) 2024-05-28 14:24:10 +00:00

README.md

The file accounts_cache.nim has been relocated

Background

The new LedgerRef module unifies different implementations of the legacy accounts_cache. It is intended to be used as new base method for all of the AccountsCache implementations. The legacy accounts_cache version has been removed.

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(..)