nimbus-eth1/nimbus/sync
Jordan Hrycaj 4feaa2cfab
Aristo db update for short nodes key edge cases (#1887)
* Aristo: Provide key-value list signature calculator

detail:
  Simple wrappers around `Aristo` core functionality

* Update new API for `CoreDb`

details:
+ Renamed new API functions `contains()` => `hasKey()` or `hasPath()`
  which disables the `in` operator on non-boolean 	`contains()` functions
+ The functions `get()` and `fetch()` always return a not-found error if
  there is no item, available. The new functions `getOrEmpty()` and
  `mergeOrEmpty()` return an an empty `Blob` if there is no such key
  found.

* Rewrite `core_apps.nim` using new API from `CoreDb`

* Use `Aristo` functionality for calculating Merkle signatures

details:
  For debugging, the `VerifyAristoForMerkleRootCalc` can be set so
  that `Aristo` results will be verified against the legacy versions.

* Provide general interface for Merkle signing key-value tables

details:
  Export `Aristo` wrappers

* Activate `CoreDb` tests

why:
  Now, API seems to be stable enough for general tests.

* Update `toHex()` usage

why:
  Byteutils' `toHex()` is superior to `toSeq.mapIt(it.toHex(2)).join`

* Split `aristo_transcode` => `aristo_serialise` + `aristo_blobify`

why:
+ Different modules for different purposes
+ `aristo_serialise`: RLP encoding/decoding
+ `aristo_blobify`: Aristo database encoding/decoding

* Compacted representation of small nodes' links instead of Keccak hashes

why:
  Ethereum MPTs use Keccak hashes as node links if the size of an RLP
  encoded node is at least 32 bytes. Otherwise, the RLP encoded node
  value is used as a pseudo node link (rather than a hash.) Such a node
  is nor stored on key-value database. Rather the RLP encoded node value
  is stored instead of a lode link in a parent node instead. Only for
  the root hash, the top level node is always referred to by the hash.

  This feature needed an abstraction of the `HashKey` object which is now
  either a hash or a blob of length at most 31 bytes. This leaves two
  ways of representing an empty/void `HashKey` type, either as an empty
  blob of zero length, or the hash of an empty blob.

* Update `CoreDb` interface (mainly reducing logger noise)

* Fix copyright years (to make `Lint` happy)
2023-11-08 12:18:32 +00:00
..
beacon Beacon skeleton works with ttdPassed=true flag too (#1826) 2023-10-19 10:29:06 +07:00
full Code reorg 4 snap sync suite (#1560) 2023-04-24 21:24:07 +01:00
handlers Fix ForkID calculation 2023-10-25 11:10:01 +07:00
misc Unified database frontend integration (#1670) 2023-08-04 12:10:09 +01:00
protocol Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
snap Aristo db update for short nodes key edge cases (#1887) 2023-11-08 12:18:32 +00:00
beacon.nim Working prototype of beacon downloader (#1780) 2023-09-28 13:20:12 +07:00
full.nim Code reorg 4 snap sync suite (#1560) 2023-04-24 21:24:07 +01:00
handlers.nim When memory backend selected, no snap sync (#1738) 2023-09-08 15:21:59 +07:00
legacy.nim Change EthTime from std.Time to distinct uint64 (#1820) 2023-10-18 09:16:11 +07:00
peers.nim Slightly change the static peer manager lookup behaviour (#1484) 2023-03-06 09:22:07 +00:00
protocol.nim initial wire protocol transformation 2022-10-15 19:48:21 +07:00
snap.nim Unified database frontend integration (#1670) 2023-08-04 12:10:09 +01:00
stateless.nim bump submodules 2023-06-07 18:12:02 +07:00
sync_desc.nim Unified database frontend integration (#1670) 2023-08-04 12:10:09 +01:00
sync_sched.nim Snap sync update pivot updating via rpc (#1583) 2023-05-16 14:52:44 +01:00
types.nim Bump nim-eth and remove unneeded Defect raises (#1575) 2023-05-10 18:04:35 +02:00