From c446eb7cff0ad4aee74868c73edfc87d2023322d Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 19 Oct 2020 13:53:23 +0000 Subject: [PATCH] update v1.0.0-rc.0 preset spec references (#1891) * update ve1.0.0-rc.0 preset spec references * remove runtime preset ETH1_FOLLOW_DISTANCE from preset files; remove two CI build items to try to keep Travis from timing out --- AllTests-mainnet.md | 6 ++-- beacon_chain.nimble | 17 ++++------ .../spec/presets/v1_0_0-rc_0/mainnet.nim | 31 ++++++++++------- .../spec/presets/v1_0_0-rc_0/minimal.nim | 33 +++++++++++-------- docs/the_nimbus_book/src/intro.md | 2 +- scripts/run_ssz_fuzzing_test.nims | 2 +- .../test_fixture_const_sanity_check.nim | 1 + 7 files changed, 52 insertions(+), 40 deletions(-) diff --git a/AllTests-mainnet.md b/AllTests-mainnet.md index fd4cb0586..e67e030f1 100644 --- a/AllTests-mainnet.md +++ b/AllTests-mainnet.md @@ -138,7 +138,7 @@ OK: 1/1 Fail: 0/1 Skip: 0/1 + EPOCHS_PER_HISTORICAL_VECTOR 65536 [Preset: mainnet] OK + EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION 256 [Preset: mainnet] OK + EPOCHS_PER_SLASHINGS_VECTOR 8192 [Preset: mainnet] OK -+ ETH1_FOLLOW_DISTANCE 1024 [Preset: mainnet] OK + ETH1_FOLLOW_DISTANCE 1024 [Preset: mainnet] Skip GENESIS_DELAY 172800 [Preset: mainnet] Skip GENESIS_FORK_VERSION "0x00000000" [Preset: mainnet] Skip + HISTORICAL_ROOTS_LIMIT 16777216 [Preset: mainnet] OK @@ -179,7 +179,7 @@ OK: 1/1 Fail: 0/1 Skip: 0/1 + VALIDATOR_REGISTRY_LIMIT 1099511627776 [Preset: mainnet] OK + WHISTLEBLOWER_REWARD_QUOTIENT 512 [Preset: mainnet] OK ``` -OK: 52/60 Fail: 0/60 Skip: 8/60 +OK: 51/60 Fail: 0/60 Skip: 9/60 ## PeerPool testing suite ```diff + Access peers by key test OK @@ -285,4 +285,4 @@ OK: 1/1 Fail: 0/1 Skip: 0/1 OK: 1/1 Fail: 0/1 Skip: 0/1 ---TOTAL--- -OK: 155/163 Fail: 0/163 Skip: 8/163 +OK: 154/163 Fail: 0/163 Skip: 9/163 diff --git a/beacon_chain.nimble b/beacon_chain.nimble index 8a7f35fdb..cd3c7e2b6 100644 --- a/beacon_chain.nimble +++ b/beacon_chain.nimble @@ -61,20 +61,17 @@ task test, "Run all tests": # pieces of code get tested regularly. Increased test output verbosity is the # price we pay for that. - # Just the part of minimal config which explicitly differs from mainnet - buildAndRunBinary "test_fixture_const_sanity_check", "tests/official/", """-d:const_preset=minimal -d:ETH2_SPEC="v0.12.3" -d:chronicles_sinks="json[file]"""" - + # TODO re-add minimal const sanity check for 1.0.0 buildAndRunBinary "test_fixture_const_sanity_check", "tests/official/", """-d:const_preset=mainnet -d:ETH2_SPEC="v1.0.0" -d:chronicles_sinks="json[file]"""" # Generic SSZ test, doesn't use consensus objects minimal/mainnet presets buildAndRunBinary "test_fixture_ssz_generic_types", "tests/official/", """-d:chronicles_log_level=TRACE -d:chronicles_sinks="json[file]"""" # Consensus object SSZ tests + # v0.12.3 is reasonably covered by rest of SSZ fixture tests and lack of + # non-numeric-constant changes in SSZ types between v0.12.3 and v1.0.0. buildAndRunBinary "test_fixture_ssz_consensus_objects", "tests/official/", """-d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:ETH2_SPEC="v1.0.0" -d:chronicles_sinks="json[file]"""" - # Consensus object SSZ tests - buildAndRunBinary "test_fixture_ssz_consensus_objects", "tests/official/", """-d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:ETH2_SPEC="v0.12.3" -d:chronicles_sinks="json[file]"""" - # EF tests buildAndRunBinary "all_fixtures_require_ssz", "tests/official/", """-d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:ETH2_SPEC="v0.12.3" -d:chronicles_sinks="json[file]"""" @@ -92,7 +89,7 @@ task test, "Run all tests": buildAndRunBinary "test_block_pool", "tests/", """-d:chronicles_log_level=TRACE -d:const_preset=mainnet -d:ETH2_SPEC="v0.12.3" -d:BLS_FORCE_BACKEND=miracl -d:chronicles_sinks="json[file]"""" # State and block sims; getting to 4th epoch triggers consensus checks - buildAndRunBinary "state_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v0.12.3\" -d:chronicles_log_level=INFO", "--validators=3000 --slots=128" - # buildAndRunBinary "state_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v0.12.3\" -d:BLS_FORCE_BACKEND=miracl -d:chronicles_log_level=INFO", "--validators=3000 --slots=128" - buildAndRunBinary "block_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v0.12.3\"", "--validators=3000 --slots=128" - # buildAndRunBinary "block_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v0.12.3\" -d:BLS_FORCE_BACKEND=miracl", "--validators=3000 --slots=128" + buildAndRunBinary "state_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v1.0.0\" -d:chronicles_log_level=INFO", "--validators=3000 --slots=128" + # buildAndRunBinary "state_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v1.0.0\" -d:BLS_FORCE_BACKEND=miracl -d:chronicles_log_level=INFO", "--validators=3000 --slots=128" + buildAndRunBinary "block_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v1.0.0\"", "--validators=3000 --slots=128" + # buildAndRunBinary "block_sim", "research/", "-d:const_preset=mainnet -d:ETH2_SPEC=\"v1.0.0\" -d:BLS_FORCE_BACKEND=miracl", "--validators=3000 --slots=128" diff --git a/beacon_chain/spec/presets/v1_0_0-rc_0/mainnet.nim b/beacon_chain/spec/presets/v1_0_0-rc_0/mainnet.nim index a9e97cfb5..7550bdc93 100644 --- a/beacon_chain/spec/presets/v1_0_0-rc_0/mainnet.nim +++ b/beacon_chain/spec/presets/v1_0_0-rc_0/mainnet.nim @@ -16,7 +16,7 @@ import const # Misc # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L6 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L5 CONFIG_NAME* = "mainnet" MAX_COMMITTEES_PER_SLOT* {.intdefine.}: uint64 = 64 @@ -39,13 +39,15 @@ const CHURN_LIMIT_QUOTIENT*: uint64 = 2'u64 ^ 16 SHUFFLE_ROUND_COUNT*: uint64 = 90 + # MIN_GENESIS_ACTIVE_VALIDATOR_COUNT and MIN_GENESIS_TIME are runtime presets + HYSTERESIS_QUOTIENT*: uint64 = 4 HYSTERESIS_DOWNWARD_MULTIPLIER*: uint64 = 1 HYSTERESIS_UPWARD_MULTIPLIER*: uint64 = 5 # Gwei values # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L61 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L60 MIN_DEPOSIT_AMOUNT*: uint64 = 2'u64^0 * 10'u64^9 ##\ ## Minimum amounth of ETH that can be deposited in one call - deposits can @@ -62,12 +64,17 @@ const # Initial values # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L73 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L72 + # GENESIS_FORK_VERSION is a runtime preset + BLS_WITHDRAWAL_PREFIX*: byte = 0 # Time parameters # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L80 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L79 + + # GENESIS_DELAY is a runtime preset + SECONDS_PER_SLOT* {.intdefine.}: uint64 = 12'u64 # Compile with -d:SECONDS_PER_SLOT=1 for 12x faster slots ## TODO consistent time unit across projects, similar to C++ chrono? @@ -111,7 +118,7 @@ const # State vector lengths # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L108 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L105 EPOCHS_PER_HISTORICAL_VECTOR*: uint64 = 65536 ##\ ## epochs (~0.8 years) @@ -126,7 +133,7 @@ const # Reward and penalty quotients # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L120 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L117 BASE_REWARD_FACTOR*: uint64 = 2'u64^6 WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9 PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3 @@ -136,7 +143,7 @@ const # Max operations per block # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L134 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L133 MAX_PROPOSER_SLASHINGS*: uint64 = 2'u64 ^ 4 MAX_ATTESTER_SLASHINGS*: uint64 = 2'u64 ^ 1 MAX_ATTESTATIONS*: uint64 = 2'u64 ^ 7 @@ -145,13 +152,15 @@ const # Fork choice # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L32 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L31 SAFE_SLOTS_TO_UPDATE_JUSTIFIED*: uint64 = 8 # 96 seconds # Validators # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L38 - ETH1_FOLLOW_DISTANCE* {.intdefine.}: uint64 = 2048 # blocks ~ 8 hours + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L37 + + # ETH1_FOLLOW_DISTANCE is a runtime preset + TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 = 16 # validators RANDOM_SUBNETS_PER_VALIDATOR*: uint64 = 1 # subnet EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION*: uint64 = 256 # epochs ~ 27 hours @@ -159,7 +168,7 @@ const # Deposit contract # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L52 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/mainnet/phase0.yaml#L51 # Ethereum PoW Mainnet # TODO These violate the spec (this is a temporary change to allow `make medalla` to work) diff --git a/beacon_chain/spec/presets/v1_0_0-rc_0/minimal.nim b/beacon_chain/spec/presets/v1_0_0-rc_0/minimal.nim index 1fd226148..13fc4424c 100644 --- a/beacon_chain/spec/presets/v1_0_0-rc_0/minimal.nim +++ b/beacon_chain/spec/presets/v1_0_0-rc_0/minimal.nim @@ -16,7 +16,7 @@ import const # Misc # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L4 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L5 CONFIG_NAME* = "minimal" # Changed @@ -31,6 +31,8 @@ const # Changed SHUFFLE_ROUND_COUNT*: uint64 = 10 + # MIN_GENESIS_ACTIVE_VALIDATOR_COUNT and MIN_GENESIS_TIME are runtime presets + # Unchanged HYSTERESIS_QUOTIENT*: uint64 = 4 HYSTERESIS_DOWNWARD_MULTIPLIER*: uint64 = 1 @@ -38,10 +40,7 @@ const # Gwei values # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L61 - - # Changed - ETH1_FOLLOW_DISTANCE* {.intdefine.}: uint64 = 16 # blocks + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L61 # Unchanged MIN_DEPOSIT_AMOUNT*: uint64 = 2'u64^0 * 10'u64^9 @@ -51,16 +50,20 @@ const # Initial values # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L73 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L73 + + # GENESIS_FORK_VERSION is a runtime preset BLS_WITHDRAWAL_PREFIX*: byte = 0 # Time parameters # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L80 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L80 # Changed: Faster to spin up testnets, but does not give validator # reasonable warning time for genesis + # GENESIS_DELAY is a runtime preset + # Unchanged SECONDS_PER_SLOT*{.intdefine.}: uint64 = 6 @@ -88,7 +91,7 @@ const # State vector lengths # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L108 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L106 # Changed EPOCHS_PER_HISTORICAL_VECTOR*: uint64 = 64 @@ -100,7 +103,7 @@ const # Reward and penalty quotients # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L120 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L118 BASE_REWARD_FACTOR*: uint64 = 2'u64^6 WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9 @@ -111,7 +114,7 @@ const # Max operations per block # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L134 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L134 MAX_PROPOSER_SLASHINGS*: uint64 = 2'u64 ^ 4 MAX_ATTESTER_SLASHINGS*: uint64 = 2'u64 ^ 1 @@ -121,7 +124,7 @@ const # Deposit contract # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L52 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L52 # Ethereum Goerli testnet DEPOSIT_CHAIN_ID* = 5 @@ -129,17 +132,19 @@ const # Fork choice # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L32 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L32 # Changed SAFE_SLOTS_TO_UPDATE_JUSTIFIED*: uint64 = 2 # Validators # --------------------------------------------------------------- - # https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L38 + # https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/configs/minimal/phase0.yaml#L38 + + # ETH1_FOLLOW_DISTANCE is a runtime preset # Unchanged TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 = 16 # validators RANDOM_SUBNETS_PER_VALIDATOR*: uint64 = 1 # subnet EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION*: uint64 = 256 # epochs ~ 27 hours - SECONDS_PER_ETH1_BLOCK* {.intdefine.}: uint64 = 14 # estimate from Eth1 mainnet) + SECONDS_PER_ETH1_BLOCK* {.intdefine.}: uint64 = 14 # (estimate from Eth1 mainnet) diff --git a/docs/the_nimbus_book/src/intro.md b/docs/the_nimbus_book/src/intro.md index 03711f786..e8f2a31f8 100644 --- a/docs/the_nimbus_book/src/intro.md +++ b/docs/the_nimbus_book/src/intro.md @@ -5,7 +5,7 @@ The Nimbus beacon chain is a research implementation of the Beacon Chain – the - Open sourced at [github.com/status-im/nimbus-eth2](https://github.com/status-im/nimbus-eth2/tree/master) -- Specification described at [ethereum/eth2.0-specs](https://github.com/ethereum/eth2.0-specs/tree/v0.12.3#phase-0) +- Specification described at [ethereum/eth2.0-specs](https://github.com/ethereum/eth2.0-specs/tree/v1.0.0-rc.0#phase-0) ### Helpful resources diff --git a/scripts/run_ssz_fuzzing_test.nims b/scripts/run_ssz_fuzzing_test.nims index 7e9802666..1a3a74fa8 100644 --- a/scripts/run_ssz_fuzzing_test.nims +++ b/scripts/run_ssz_fuzzing_test.nims @@ -4,7 +4,7 @@ import testutils/fuzzing_engines const gitRoot = thisDir() / ".." - fixturesDir = gitRoot / "vendor" / "nim-eth2-scenarios" / "tests-v0.12.3" / "mainnet" / "phase0" / "ssz_static" + fixturesDir = gitRoot / "vendor" / "nim-eth2-scenarios" / "tests-v1.0.0-rc.0" / "mainnet" / "phase0" / "ssz_static" fuzzingTestsDir = gitRoot / "tests" / "fuzzing" fuzzingCorpusesDir = fuzzingTestsDir / "corpus" diff --git a/tests/official/test_fixture_const_sanity_check.nim b/tests/official/test_fixture_const_sanity_check.nim index 1b9780602..4ba392dd1 100644 --- a/tests/official/test_fixture_const_sanity_check.nim +++ b/tests/official/test_fixture_const_sanity_check.nim @@ -104,6 +104,7 @@ const IgnoreKeys = [ "MIN_GENESIS_TIME", "GENESIS_FORK_VERSION", "GENESIS_DELAY", + "ETH1_FOLLOW_DISTANCE", # TODO remove when possible "DEPOSIT_CHAIN_ID",