mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 22:06:21 +00:00
cbc998ed93
* initial fork-choice refactor * Add fork_choice test for "no votes" * Initial test with voting: fix handling of unknown validators and parent blocks * Fix tiebreak of votes * Cleanup debugging traces * Complexify the vote test * fakeHash use the bigEndian repr of number + fix tiebreak for good * Stash changes: found critical bug in nimcrypto `==` and var openarray * Passing fork choice tests with varying votes * Add FFG fork choice scenario + fork choice to the test suite * Not sure why lmdb / rocksdb reappeared in rebase * Add sanity checks to .nimble file + integrate fork choice tests to the test DB and test timing * Cleanup debugging echos * nimcrypto fix https://github.com/status-im/nim-beacon-chain/pull/864 as been merged, remove TODO comment * Turn fork choice exception-free * Cleanup "result" to ensure early return is properly used * Add a comment on private/public error code vs Result * result -> results following https://github.com/status-im/nim-beacon-chain/pull/866 * Address comments: - raises: [Defect] doesn't work -> TODO - process_attestation cannot fail - try/except as expression pending Nim v1.2.0 - cleanup TODOs * re-enable all sanity checks * tag no raise for process_attestation * use raises defect everywhere in fork choice and fix process_attestation test
76 lines
2.8 KiB
Nim
76 lines
2.8 KiB
Nim
mode = ScriptMode.Verbose
|
|
|
|
import
|
|
beacon_chain/version as ver
|
|
|
|
packageName = "beacon_chain"
|
|
version = versionAsStr
|
|
author = "Status Research & Development GmbH"
|
|
description = "Eth2.0 research implementation of the beacon chain"
|
|
license = "MIT or Apache License 2.0"
|
|
installDirs = @["beacon_chain", "research"]
|
|
skipDirs = @["nfuzz"]
|
|
bin = @[
|
|
"beacon_chain/beacon_node",
|
|
"research/serialized_sizes",
|
|
"nbench/nbench",
|
|
]
|
|
|
|
### Dependencies
|
|
requires "nim >= 0.19.0",
|
|
"blscurve",
|
|
"chronicles",
|
|
"chronos",
|
|
"confutils",
|
|
"eth",
|
|
"json_rpc",
|
|
"json_serialization",
|
|
"libbacktrace",
|
|
"libp2p",
|
|
"metrics",
|
|
"nimcrypto",
|
|
"serialization",
|
|
"stew",
|
|
"prompt",
|
|
"web3",
|
|
"yaml"
|
|
|
|
### Helper functions
|
|
proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "", lang = "c") =
|
|
if not dirExists "build":
|
|
mkDir "build"
|
|
# allow something like "nim test --verbosity:0 --hints:off beacon_chain.nims"
|
|
var extra_params = params
|
|
for i in 2..<paramCount():
|
|
extra_params &= " " & paramStr(i)
|
|
exec "nim " & lang & " --out:./build/" & name & " -r " & extra_params & " " & srcDir & name & ".nim" & " " & cmdParams
|
|
|
|
### tasks
|
|
task test, "Run all tests":
|
|
# We're enabling the TRACE log level so we're sure that those rarely used
|
|
# pieces of code get tested regularly. Increased test output verbosity is the
|
|
# price we pay for that.
|
|
|
|
# Minimal config
|
|
buildBinary "proto_array", "beacon_chain/fork_choice/", "-d:const_preset=minimal"
|
|
buildBinary "fork_choice", "beacon_chain/fork_choice/", "-d:const_preset=minimal"
|
|
buildBinary "all_tests", "tests/", "-d:chronicles_log_level=TRACE -d:const_preset=minimal"
|
|
# Mainnet config
|
|
buildBinary "proto_array", "beacon_chain/fork_choice/", "-d:const_preset=mainnet"
|
|
buildBinary "fork_choice", "beacon_chain/fork_choice/", "-d:const_preset=mainnet"
|
|
buildBinary "all_tests", "tests/", "-d:const_preset=mainnet"
|
|
|
|
# Generic SSZ test, doesn't use consensus objects minimal/mainnet presets
|
|
buildBinary "test_fixture_ssz_generic_types", "tests/official/", "-d:chronicles_log_level=TRACE"
|
|
|
|
# Consensus object SSZ tests
|
|
buildBinary "test_fixture_ssz_consensus_objects", "tests/official/", "-d:chronicles_log_level=TRACE -d:const_preset=minimal"
|
|
buildBinary "test_fixture_ssz_consensus_objects", "tests/official/", "-d:const_preset=mainnet"
|
|
|
|
buildBinary "all_fixtures_require_ssz", "tests/official/", "-d:chronicles_log_level=TRACE -d:const_preset=minimal"
|
|
buildBinary "all_fixtures_require_ssz", "tests/official/", "-d:const_preset=mainnet"
|
|
|
|
# State sim; getting into 4th epoch useful to trigger consensus checks
|
|
buildBinary "state_sim", "research/", "", "--validators=1024 --slots=32"
|
|
buildBinary "state_sim", "research/", "-d:const_preset=mainnet", "--validators=1024 --slots=128"
|