nimbus-eth2/tests
Jacek Sieka a7a65bce42
disentangle eth2 types from the ssz library (#2785)
* reorganize ssz dependencies

This PR continues the work in
https://github.com/status-im/nimbus-eth2/pull/2646,
https://github.com/status-im/nimbus-eth2/pull/2779 as well as past
issues with serialization and type, to disentangle SSZ from eth2 and at
the same time simplify imports and exports with a structured approach.

The principal idea here is that when a library wants to introduce SSZ
support, they do so via 3 files:

* `ssz_codecs` which imports and reexports `codecs` - this covers the
basic byte conversions and ensures no overloads get lost
* `xxx_merkleization` imports and exports `merkleization` to specialize
and get access to `hash_tree_root` and friends
* `xxx_ssz_serialization` imports and exports `ssz_serialization` to
specialize ssz for a specific library

Those that need to interact with SSZ always import the `xxx_` versions
of the modules and never `ssz` itself so as to keep imports simple and
safe.

This is similar to how the REST / JSON-RPC serializers are structured in
that someone wanting to serialize spec types to REST-JSON will import
`eth2_rest_serialization` and nothing else.

* split up ssz into a core library that is independendent of eth2 types
* rename `bytes_reader` to `codec` to highlight that it contains coding
and decoding of bytes and native ssz types
* remove tricky List init overload that causes compile issues
* get rid of top-level ssz import
* reenable merkleization tests
* move some "standard" json serializers to spec
* remove `ValidatorIndex` serialization for now
* remove test_ssz_merkleization
* add tests for over/underlong byte sequences
* fix broken seq[byte] test - seq[byte] is not an SSZ type

There are a few things this PR doesn't solve:

* like #2646 this PR is weak on how to handle root and other
dontSerialize fields that "sometimes" should be computed - the same
problem appears in REST / JSON-RPC etc

* Fix a build problem on macOS

* Another way to fix the macOS builds

Co-authored-by: Zahary Karadjov <zahary@gmail.com>
2021-08-18 20:57:58 +02:00
..
fork_choice rework spec imports (#2779) 2021-08-12 13:08:20 +00:00
fuzzing disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
helpers rework spec imports (#2779) 2021-08-12 13:08:20 +00:00
mocking disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
official disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
simulation don't try to use lsof on Windows (#2762) 2021-08-05 10:49:34 +02:00
slashing_protection unexport various parts of tests/ and remove unused code (#2794) 2021-08-18 13:58:43 +00:00
spec_block_processing disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
spec_epoch_processing rework spec imports (#2779) 2021-08-12 13:08:20 +00:00
ssz disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
all_tests.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
all_tests.nim.cfg remove remaining traces of nim-prompt 2021-08-16 21:56:50 +03:00
test_attestation_pool.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
test_beacon_chain_db.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
test_beaconstate.nim rework spec imports (#2779) 2021-08-12 13:08:20 +00:00
test_bitseqs.nim forkedbeaconstate_helpers -> forks (#2772) 2021-08-10 22:46:35 +02:00
test_block_pool.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
test_datatypes.nim remove false OnBlockAdded dependency on phase0 HashedBeaconState (#2661) 2021-06-21 08:35:24 +00:00
test_discovery.nim unexport various parts of tests/ and remove unused code (#2794) 2021-08-18 13:58:43 +00:00
test_eth1_monitor.nim Introduce unittest2 and junit reports (#2522) 2021-04-28 18:41:02 +02:00
test_eth2_ssz_serialization.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
test_exit_pool.nim rework spec imports (#2779) 2021-08-12 13:08:20 +00:00
test_gossip_validation.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
test_helpers.nim Introduce unittest2 and junit reports (#2522) 2021-04-28 18:41:02 +02:00
test_honest_validator.nim sync committee topic names; borrow -> template/distinctbase (#2781) 2021-08-15 16:50:31 +02:00
test_interop.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
test_keystore.nim unexport various parts of tests/ and remove unused code (#2794) 2021-08-18 13:58:43 +00:00
test_message_signatures.nim sync committee/aggregate signature signing and verification (#2784) 2021-08-17 08:07:17 +00:00
test_peer_pool.nim switch result = foo to expression return; unexport rest of logtrace symbols (#2788) 2021-08-17 09:51:39 +00:00
test_statediff.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
test_sync_manager.nim unexport various parts of tests/ and remove unused code (#2794) 2021-08-18 13:58:43 +00:00
test_sync_manager.nim.cfg Split Eth2Processor in prep for batching (#2396) 2021-03-11 11:10:57 +01:00
test_zero_signature.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
testblockutil.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
testdbutil.nim rework spec imports (#2779) 2021-08-12 13:08:20 +00:00
teststateutil.nim disentangle eth2 types from the ssz library (#2785) 2021-08-18 20:57:58 +02:00
testutil.nim forkedbeaconstate_helpers -> forks (#2772) 2021-08-10 22:46:35 +02:00