1502014e36
* Kvt: Update API hooks * Aristo: Generalised merging snap proofs, now for multiple state roots why: This accommodates pre-loading partial tries for unit tests * Aristo: Update some unit tests * CoreDb+Aristo: Re-factor tracer why: Was bonkers anyway. The main change is that the trace journal is now kept in a way similar to a transaction layer so that it can predictably interact with DB transactions. * Ledger: Debugging helper * Update tracer unit test applicable for `Aristo` * Fix copyright year * Disable `dump()` function as compile time default why: This needs to pull in the `rocks_db` library at compile time. |
||
---|---|---|
.. | ||
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(..) |