nimbus-eth1/nimbus/db
Jordan Hrycaj 3e88589eb1
Optional accounts cache module for creating genesis (#1897)
* Split off `ReadOnlyStateDB` from `AccountStateDB` from `state_db.nim`

why:
  Apart from testing, applications use `ReadOnlyStateDB` as an easy
  way to access the accounts ledger. This is well supported by the
  `Aristo` db, but writable mode is only parially supported.

  The writable AccountStateDB` object for modifying accounts is not
  used by production code.

  So, for lecgacy and testing apps, the full support of the previous
  `AccountStateDB` is now enabled by `import db/state_db/read_write`
  and the `import db/state_db` provides read-only mode.

* Encapsulate `AccountStateDB` as `GenesisLedgerRef` or genesis creation

why:
  `AccountStateDB` has poor support for `Aristo` and is not widely used
   in favour of `AccountsLedger` (which will be abstracted as `ledger`.)

   Currently, using other than the `AccountStateDB` ledgers within the
   `GenesisLedgerRef` wrapper is experimental and test only. Eventually,
    the wrapper should disappear so that the `Ledger` object (which
    encapsulates `AccountsCache` and `AccountsLedger`) will prevail.

* For the `Ledger`, provide access to raw accounts `MPT`

why:
  This gives to the `CoreDbMptRef` descriptor from the `CoreDb` (which is
  the legacy version of 	CoreDxMptRef`.) For the new `ledger` API, the
  accounts are based on the `CoreDxMAccRef` descriptor which uses a
  particular sub-system for accounts while legacy applications use the
  `CoreDbPhkRef` equivalent of the `SecureHexaryTrie`.

  The only place where this feature will currently be used is the
 `genesis.nim` source file.

* Fix `Aristo` bugs, missing boundary checks, typos, etc.

* Verify root vertex in `MPT` and account constructors

why:
  Was missing so far, in particular the accounts constructor must
  verify `VertexID(1)

* Fix include file
2023-11-20 11:51:43 +00:00
..
aristo Optional accounts cache module for creating genesis (#1897) 2023-11-20 11:51:43 +00:00
core_db Optional accounts cache module for creating genesis (#1897) 2023-11-20 11:51:43 +00:00
kvt Core db and aristo updates for destructor and tx logic (#1894) 2023-11-16 19:35:03 +00:00
ledger Optional accounts cache module for creating genesis (#1897) 2023-11-20 11:51:43 +00:00
notused Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
state_db Optional accounts cache module for creating genesis (#1897) 2023-11-20 11:51:43 +00:00
access_list.nim implement EIP-1153: Transient storage 2023-06-23 14:04:36 +07:00
accounts_cache.nim Aristo and ledger small updates (#1888) 2023-11-08 16:52:25 +00:00
aristo.nim Core db and aristo updates for destructor and tx logic (#1894) 2023-11-16 19:35:03 +00:00
core_db.nim Core db and aristo updates for destructor and tx logic (#1894) 2023-11-16 19:35:03 +00:00
distinct_tries.nim Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
geth_db.nim Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
incomplete_db.nim Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
kvstore_rocksdb.nim Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
kvt.nim Core db aristo and kvt updates preparing for integration (#1760) 2023-09-18 21:20:28 +01:00
ledger.nim Fix default pruning for ledger and update core db and ledger logging (#1861) 2023-10-25 15:03:09 +01:00
select_backend.nim Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
state_db.nim Optional accounts cache module for creating genesis (#1897) 2023-11-20 11:51:43 +00:00
storage_types.nim Refactor beacon skeleton (#1761) 2023-09-19 11:52:28 +07:00
transient_storage.nim implement EIP-1153: Transient storage 2023-06-23 14:04:36 +07:00
values_from_bytes.nim Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00