mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Sync wrong dbg assertion (#2821)
## Issue Addressed Running a beacon node I triggered a sync debug panic. And so finally the time to create tests for sync arrived. Fortunately, te bug was not in the sync algorithm itself but a wrong assertion ## Proposed Changes - Split Range's impl from the BeaconChain via a trait. This is needed for testing. The TestingRig/Harness is way bigger than needed and does not provide the modification functionalities that are needed to test sync. I find this simpler, tho some could disagree. - Add a regression test for sync that fails before the changes. - Fix the wrong assertion.
This commit is contained in:
@@ -6,7 +6,6 @@ use super::range_sync::{BatchId, ChainId};
|
||||
use super::RequestId as SyncRequestId;
|
||||
use crate::service::NetworkMessage;
|
||||
use crate::status::ToStatusMessage;
|
||||
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
||||
use fnv::FnvHashMap;
|
||||
use lighthouse_network::rpc::{
|
||||
BlocksByRangeRequest, BlocksByRootRequest, GoodbyeReason, RequestId,
|
||||
@@ -61,9 +60,9 @@ impl<T: EthSpec> SyncNetworkContext<T> {
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn status_peers<U: BeaconChainTypes>(
|
||||
pub fn status_peers<C: ToStatusMessage>(
|
||||
&mut self,
|
||||
chain: Arc<BeaconChain<U>>,
|
||||
chain: C,
|
||||
peers: impl Iterator<Item = PeerId>,
|
||||
) {
|
||||
if let Ok(status_message) = &chain.status_message() {
|
||||
|
||||
Reference in New Issue
Block a user