mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 22:06:21 +00:00
f70aceef37
* Harden handling of unviable forks In our current handling of unviable forks, we allow peers to send us blocks that come from a different fork - this is not necessarily an error as it can happen naturally, but it does open up the client to a case where the same unviable fork keeps getting requested - rather than allowing this to happen, we'll now give these peers a small negative score - if it keeps happening, we'll disconnect them. * keep track of unviable forks in quarantine, to avoid filling it with known junk * collect peer scores in single module * descore peers when they send unviable blocks during sync * don't give score for duplicate blocks * increase quarantine size to a level that allows finality to happen under optimal conditions - this helps avoid downloading the same blocks over and over in case of an unviable fork * increase initial score for new peers to make room for one more failure before disconnection * log and score invalid/unviable blocks in requestmanager too * avoid ChainDAG dependency in quarantine * reject gossip blocks with unviable parent * continue processing unviable sync blocks in order to build unviable dag * docs * Update beacon_chain/consensus_object_pools/block_pools_types.nim * add unviable queue test
60 lines
1.8 KiB
Nim
60 lines
1.8 KiB
Nim
# beacon_chain
|
|
# Copyright (c) 2018-2021 Status Research & Development GmbH
|
|
# Licensed and distributed under either of
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
# All tests except scenarios, which as compiled separately for mainnet and minimal
|
|
|
|
import
|
|
chronicles,
|
|
./testutil
|
|
|
|
import # Unit test
|
|
./test_action_tracker,
|
|
./test_attestation_pool,
|
|
./test_beacon_chain_db,
|
|
./test_beacon_time,
|
|
./test_block_dag,
|
|
./test_block_processor,
|
|
./test_block_quarantine,
|
|
./test_datatypes,
|
|
./test_discovery,
|
|
./test_eth1_monitor,
|
|
./test_eth2_ssz_serialization,
|
|
./test_exit_pool,
|
|
./test_forks,
|
|
./test_gossip_transition,
|
|
./test_gossip_validation,
|
|
./test_helpers,
|
|
./test_honest_validator,
|
|
./test_interop,
|
|
./test_message_signatures,
|
|
./test_peer_pool,
|
|
./test_spec,
|
|
./test_statediff,
|
|
./test_sync_committee_pool,
|
|
./test_sync_manager,
|
|
./test_zero_signature,
|
|
./fork_choice/tests_fork_choice,
|
|
./consensus_spec/all_tests as consensus_all_tests,
|
|
./slashing_protection/test_fixtures,
|
|
./slashing_protection/test_slashing_interchange,
|
|
./slashing_protection/test_slashing_protection_db
|
|
|
|
import # Refactor state transition unit tests
|
|
# In mainnet these take 2 minutes and are empty TODOs
|
|
./spec_block_processing/test_process_deposits,
|
|
./spec_epoch_processing/test_process_justification_and_finalization
|
|
|
|
when not defined(i386):
|
|
# Avoids "Out of memory" CI failures
|
|
import
|
|
./test_blockchain_dag,
|
|
./test_keystore,
|
|
./test_keystore_management,
|
|
./test_keymanager_api
|
|
|
|
summarizeLongTests("AllTests")
|