nimbus-eth2/beacon_chain.nimble

83 lines
3.0 KiB
Plaintext
Raw Normal View History

mode = ScriptMode.Verbose
import
2019-03-12 12:56:33 +00:00
beacon_chain/version as ver
2018-07-20 13:46:03 +00:00
packageName = "beacon_chain"
version = versionAsStr
2018-07-20 13:46:03 +00:00
author = "Status Research & Development GmbH"
2018-09-26 16:26:39 +00:00
description = "Eth2.0 research implementation of the beacon chain"
2018-07-20 13:46:03 +00:00
license = "MIT or Apache License 2.0"
installDirs = @["beacon_chain", "research"]
2019-11-28 22:01:12 +00:00
skipDirs = @["nfuzz"]
bin = @[
"beacon_chain/beacon_node",
"research/serialized_sizes",
2020-02-27 11:14:24 +00:00
"nbench/nbench",
]
2018-07-20 13:46:03 +00:00
### Dependencies
2019-02-07 11:02:40 +00:00
requires "nim >= 0.19.0",
"blscurve",
"chronicles",
"chronos",
"confutils",
"eth",
"json_rpc",
"json_serialization",
"libbacktrace",
2019-07-31 08:32:35 +00:00
"libp2p",
"metrics",
"nimcrypto",
"serialization",
"stew",
"testutils",
2019-10-02 12:38:14 +00:00
"prompt",
"web3",
"yaml"
2018-07-20 13:46:03 +00:00
### Helper functions
proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "", lang = "c") =
2018-07-20 13:46:03 +00:00
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)
2020-02-20 16:41:10 +00:00
exec "nim " & lang & " --out:./build/" & name & " -r " & extra_params & " " & srcDir & name & ".nim" & " " & cmdParams
2018-07-20 13:46:03 +00:00
task moduleTests, "Run all module tests":
buildBinary "beacon_node", "beacon_chain/",
"-d:chronicles_log_level=TRACE " &
"-d:const_preset=minimal " &
"-d:testutils_test_build"
2018-07-20 13:46:03 +00:00
### 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"
2019-08-07 03:09:26 +00:00
2019-11-06 11:17:03 +00:00
# Generic SSZ test, doesn't use consensus objects minimal/mainnet presets
buildBinary "test_fixture_ssz_generic_types", "tests/official/", "-d:chronicles_log_level=TRACE"
2019-11-06 11:17:03 +00:00
# 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"
2019-08-07 03:09:26 +00:00
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/", "-d:const_preset=minimal", "--validators=2000 --slots=32"
buildBinary "state_sim", "research/", "-d:const_preset=mainnet", "--validators=2000 --slots=128"