f4fb3ab555
* Move v0.8.1 tests to a legacy folder * Convert BLS and Shuffling tests to new format |
||
---|---|---|
eth2.0-spec-tests@ae6dd9011d | ||
json_tests_v0.8.1 | ||
json_tests_v0.8.3 | ||
patches | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
README.md | ||
batch_convert_v0_8_1.nim | ||
batch_convert_v0_8_3.nim | ||
fixtures_utils.nim | ||
run_batch_convert_v0_8_1.nims |
README.md
nim-eth2-official-tests
This repo reformats the official Ethereum 2 tests to a format suitable for Nimbus/nim-beacon-chain.
Cloning the repo
Due to upstream usage of Git LFS to store the large test vectors, there is an extra step after cloning the repo:
git clone https://github.com/status-im/nim-eth2-official-tests
cd nim-eth2-official-tests
git lfs install
git submodule update --init --recursive
Usage in nim-beacon-chain
For v0.7.1 to v0.8.1
This repository is meant to be used in the devel branch of the Nimbus build environment
where it appears as a submodule in nimbus/vendor/nim-beacon-chain/tests/official/fixtures
.
This repository contains patches to Nim and NimYAML created to work around a number of outstanding issues:
- no YAML support in nim-serialization library which allows well-tested serialization and deserialization into and from Ethereum types.
- NimYAML uses int by default for numerals and cannot deserialize 18446744073709551615 (2^64-1), the FAR_FUTURE_SLOT constant.
- Furthermore as of 0.7.1, the yaml test files includes thousands of random epochs
in the [2^63-1 .. 2^64-1] range for the
source_epoch
andtarget_epoch
field. - All those workarounds requires an intermediate reformatted JSON file, but the tests are huge (100k+ lines) and will cause review issues in the main repo.
The required patch application is automated in the run_batch_convert_v0.8.1.nims
script. After executing it, you'll find all
converted test vectors in the json_tests_v0.8.1
folder.
For v0.8.3
The huge tests now have a Simple-Serialize (SSZ) version that should be preferred as it's more compact and do not use Git LFS on the EF side (and risk hitting Github LFS quota ceiling)
Small tests like BLS and shuffling are YAML only and do not have conversion issue as they do not use high uint64 numbers.