Commit Graph

42 Commits

Author SHA1 Message Date
web3-developer 93fb4c8f59
More witness fixes (#2009)
* Update experimental rpc test to do further validation on proof responses.

* Enable zero value storage slots in the witness cache data so that proofs will be returned when a storage slot is updated to zero. Refactor and simplify implementation of getProofs endpoint.

* Improve test validation.

* Minor fixes and added test to track the changes introduced in every block using a local state.

* Refactor and cleanup test.

* Comments added to test and account cache fixes applied to account ledger.

* Return updated storage slots even when storage is empty and add test to build.

* Fix copyright and remove incorrect depth check during witness building in writeShortRlp assertion.
2024-02-09 12:09:02 +08:00
jangko b0000eed8b
Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
Jordan Hrycaj 221e6c9e2f
Unified database frontend integration (#1670)
* Nimbus folder environment update

details:
* Integrated `CoreDbRef` for the sources in the `nimbus` sub-folder.
* The `nimbus` program does not compile yet as it needs the updates
  in the parallel `stateless` sub-folder.

* Stateless environment update

details:
* Integrated `CoreDbRef` for the sources in the `stateless` sub-folder.
* The `nimbus` program compiles now.

* Premix environment update

details:
* Integrated `CoreDbRef` for the sources in the `premix` sub-folder.

* Fluffy environment update

details:
* Integrated `CoreDbRef` for the sources in the `fluffy` sub-folder.

* Tools environment update

details:
* Integrated `CoreDbRef` for the sources in the `tools` sub-folder.

* Nodocker environment update

details:
* Integrated `CoreDbRef` for the sources in the
  `hive_integration/nodocker` sub-folder.

* Tests environment update

details:
* Integrated `CoreDbRef` for the sources in the `tests` sub-folder.
* The unit tests compile and run cleanly now.

* Generalise `CoreDbRef` to any `select_backend` supported database

why:
  Generalisation was just missed due to overcoming some compiler oddity
  which was tied to rocksdb for testing.

* Suppress compiler warning for `newChainDB()`

why:
  Warning was added to this function which must be wrapped so that
  any `CatchableError` is re-raised as `Defect`.

* Split off persistent `CoreDbRef` constructor into separate file

why:
  This allows to compile a memory only database version without linking
  the backend library.

* Use memory `CoreDbRef` database by default

detail:
 Persistent DB constructor needs to import `db/core_db/persistent

why:
 Most tests use memory DB anyway. This avoids linking `-lrocksdb` or
 any other backend by default.

* fix `toLegacyBackend()` availability check

why:
  got garbled after memory/persistent split.

* Clarify raw access to MPT for snap sync handler

why:
  Logically, `kvt` is not the raw access for the hexary trie (although
  this holds for the legacy database)
2023-08-04 12:10:09 +01:00
jangko 4e332868b7
reduce compiler warnings 2023-05-16 11:15:10 +07:00
Jordan Hrycaj 6b9f3c9ac5
Silence compiler gossip after nim upgrade cont1 (#1455)
* Silence some compiler gossip -- part 5, common

details:
  Mostly removing redundant imports and `Defect` tracer after switch
  to nim 1.6

* Silence some compiler gossip -- part 6, db, rpc, utils

details:
  Mostly removing redundant imports and `Defect` tracer after switch
  to nim 1.6

* Silence some compiler gossip -- part 7, randomly collected source files

details:
  Mostly removing redundant imports and `Defect` tracer after switch
  to nim 1.6

* Silence some compiler gossip -- part 8, assorted tests

details:
  Mostly removing redundant imports and `Defect` tracer after switch
  to nim 1.6

* Clique update

why:
  More impossible exceptions (undoes temporary fix from previous PR)
2023-01-31 01:32:17 +00:00
Jacek Sieka c2ed731fa5
eth: adapt to smaller eth_types (#1210) 2022-09-03 20:15:35 +02:00
Jamie Lokier 242dfdd5ac
Bugfix: Off by 1 in EIP-170 code size checks in `stateless`
Fixes an off by 1 error where `EIP170_CODE_SIZE_LIMIT` was being treated as the
lowest invalid value by EVM code, but the highest valid value by witness code.

To remove confusion, this is renamed to `EIP170_MAX_CODE_SIZE` with value
0x6000, which matches the name (`MAX_CODE_SIZE`) and value used for this limit
in [EIP-170](https://eips.ethereum.org/EIPS/eip-170).

Signed-off-by: Jamie Lokier <jamie@shareable.org>
2021-10-19 10:30:53 +01:00
jangko 165f9fea2e
reduce warnings 2020-07-21 13:15:06 +07:00
jangko a2de3067a9
add test for short rlp in block witness 2020-07-08 23:17:48 +07:00
jangko 0d0bc35137
block witness spec changes: explicit short rlp encoding 2020-07-08 21:05:20 +07:00
jangko e130cab959
remove unused artefact 2020-05-24 11:40:01 +07:00
jangko 612192cf86
block witness: switch uint encoding to uvarint LEB128 encoding 2020-05-16 13:18:05 +07:00
jangko 61c60abdf2
block witness new spec impl 2020-05-14 11:09:01 +07:00
andri lim bac4913a5a
tidying up branch node code 2020-05-07 22:03:00 +07:00
andri lim ba4360ba34
fix multikeys algorithm with multiple nibbles common prefix 2020-05-07 21:36:51 +07:00
andri lim 12b6d805cf
fix some invalid doAssert 2020-05-07 11:28:11 +07:00
andri lim 78f06426db
add more comments for both witness builder and tree builder 2020-05-06 11:45:21 +07:00
andri lim e5c4c7d16f
fix typo 2020-05-06 10:36:00 +07:00
andri lim 64af577d8d
tidying up witness builder 2020-05-05 20:30:28 +07:00
andri lim aa572696c5
fix account node with 'CodeUntouched' type 2020-05-05 20:07:38 +07:00
andri lim 37db9a55ee
deals with touched/not touched account code 2020-05-05 15:21:39 +07:00
andri lim 743759a979
wrong address ignored 2020-05-05 15:05:17 +07:00
andri lim e9191fefa1
witness builder major transformation, support multiproof 2020-05-05 13:50:31 +07:00
andri lim 6a9555b2b9
add raises to public API 2020-05-03 08:47:14 +07:00
andri lim fdb750f67e
implement witness header encoding decoding and implement buildForest 2020-04-29 15:29:25 +07:00
andri lim 90c2ede43b
deals with EIP170 error 2020-04-29 13:06:27 +07:00
andri lim c325ce1863
fix contract code retrieval from db 2020-04-29 13:06:27 +07:00
andri lim 4974ca49db
fix buildWitness API 2020-04-29 13:06:27 +07:00
andri lim 4e12ba825c
separate underdeveloped stack based witness builder source code from recursive code 2020-04-29 13:06:26 +07:00
andri lim d95ded217b
implement account storage encoding and decoding 2020-04-29 13:06:26 +07:00
andri lim 4de8eaa81d
implement account code encoding and decoding 2020-04-29 13:06:26 +07:00
andri lim 2ae02fd629
implement account serializer and deserializer 2020-04-29 13:06:25 +07:00
andri lim 692bed176e
allow test_block_witness to run single test 2020-04-29 13:06:24 +07:00
andri lim a1a6b7b9c4
add some remarks on interesting findings during experiment 2020-04-29 13:06:24 +07:00
andri lim 9589f9cd90
remove shallowcopy from witness builder 2020-04-29 13:06:24 +07:00
andri lim 8db1109515
remove 17th elem code from branch node parser/encoder 2020-04-29 13:06:23 +07:00
andri lim cecb8986a4
readU32 new spec, change LE to BE 2020-04-29 13:06:23 +07:00
andri lim 323204d939
deals with short node len < 32 2020-04-29 13:06:22 +07:00
andri lim ef038c6125
witness_from_tree minor refactor 2020-04-29 13:06:21 +07:00
andri lim c33fb4deed
block witness: trie node encoding roundtrip test success using recursive functions 2020-04-29 13:06:20 +07:00
andri lim 809f9d13bd
move witness types from tree_from_witness.nim to witness_types.nim 2020-04-29 13:06:20 +07:00
andri lim 785e1dadce
implement crude witness builder 2020-04-29 13:05:19 +07:00