7d9e1d8607
* Code cosmetics * Aristo+Kvt: Fix api wrappers why: Api setup killed the backend descriptor when backend mapping was disabled. * Aristo: Implement masked profiling entries why: Database backend should be listed but not counted in tally * CoreDb: Simplify backend() methods why: DBMS backend access Was provided very early and over engineered. Now there are only two backend machines, one for `Kvt` and the other one for an `Mpt` available only via new API. * CoreDb: Code cleanup regarding descriptor types * CoreDb: Refactor/redefine `persistent()` methods why: There were `persistent()` methods for any type of caching storage facilities `Kvt`, `Mpt`, `Phk`, and `Acc`. Now there is only a single `persistent()` method storing all facilities in tandem (similar to how transactions work.) For non shared `Kvt` tables, there is now an extra storage method `saveOffSite()`. * CoreDb lingo update: `trie` becomes `column` why: Notion of a `trie` is pretty much hidden by the new `CoreDb` api. Revealed are sort of database columns for accounts an storage data, any of which have an internal state represented by a Keccack hash. So a `trie` or `MPT` becomes a `column` and a `rootHash` becomes a column state. * Aristo: rename backend filed `filters` => `journal` * Update full sync logging details: + Disable eth handler noise while syncing + Log journal depth (if available) * Fix copyright year * Fix cruft and unwanted imports |
||
---|---|---|
.. | ||
backend | ||
base | ||
README.md | ||
accounts_cache.nim | ||
accounts_ledger.nim | ||
base.nim | ||
base_iterators.nim | ||
distinct_ledgers.nim |
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(..) |