nimbus-eth1/tests/test_aristo
Jordan Hrycaj a84a2131cd
No ext update (#2494)
* Imported/rebase from `no-ext`, PR #2485

  Store extension nodes together with the branch

  Extension nodes must be followed by a branch - as such, it makes sense
  to store the two together both in the database and in memory:

  * fewer reads, writes and updates to traverse the tree
  * simpler logic for maintaining the node structure
  * less space used, both memory and storage, because there are fewer
    nodes overall

  There is also a downside: hashes can no longer be cached for an
  extension - instead, only the extension+branch hash can be cached - this
  seems like a fine tradeoff since computing it should be fast.

  TODO: fix commented code

* Fix merge functions and `toNode()`

* Update `merkleSignCommit()` prototype

why:
  Result is always a 32bit hash

* Update short Merkle hash key generation

details:
  Ethereum reference 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.) This is
  specified in the yellow paper, appendix D.

  Different to the `Aristo` implementation, the reference MPT would not
  store such a node on the key-value database. Rather the RLP encoded node value is stored instead of a node link in a parent node
  is stored as a node link on the parent database.

  Only for the root hash, the top level node is always referred to by the
  hash.

* Fix/update `Extension` sections

why:
  Were commented out after removal of a dedicated `Extension` type which
  left the system disfunctional.

* Clean up unused error codes

* Update unit tests

* Update docu

---------

Co-authored-by: Jacek Sieka <jacek@status.im>
2024-07-16 19:47:59 +00:00
..
sample0.txt.gz Remove obsolete tests (#2307) 2024-06-06 09:29:38 +00:00
sample1.txt.gz Remove obsolete tests (#2307) 2024-06-06 09:29:38 +00:00
sample2.txt.gz Remove obsolete tests (#2307) 2024-06-06 09:29:38 +00:00
sample3.txt.gz Remove obsolete tests (#2307) 2024-06-06 09:29:38 +00:00
test_blobify.nim No ext update (#2494) 2024-07-16 19:47:59 +00:00
test_filter.nim No ext update (#2494) 2024-07-16 19:47:59 +00:00
test_helpers.nim No ext update (#2494) 2024-07-16 19:47:59 +00:00
test_samples_xx.nim Remove obsolete tests (#2307) 2024-06-06 09:29:38 +00:00
test_short_keys.nim No ext update (#2494) 2024-07-16 19:47:59 +00:00
test_tx.nim storage: store root id together with vid, for better locality of refe… (#2449) 2024-07-04 15:46:52 +02:00