Skip to content

Commit

Permalink
Underflow and Typo (#6885)
Browse files Browse the repository at this point in the history
I was looking at sync and noticed a potential underflow and a typo, so just fixed those whilst I was in there.
  • Loading branch information
AgeManning authored Jan 30, 2025
1 parent d297d08 commit 1fe0ac7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions beacon_node/network/src/sync/peer_sync_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pub fn remote_sync_type<T: BeaconChainTypes>(
) -> PeerSyncType {
// auxiliary variables for clarity: Inclusive boundaries of the range in which we consider a peer's
// head "near" ours.
let near_range_start = local.head_slot - SLOT_IMPORT_TOLERANCE as u64;
let near_range_end = local.head_slot + SLOT_IMPORT_TOLERANCE as u64;
let near_range_start = local.head_slot.saturating_sub(SLOT_IMPORT_TOLERANCE);
let near_range_end = local.head_slot.saturating_add(SLOT_IMPORT_TOLERANCE);

match remote.finalized_epoch.cmp(&local.finalized_epoch) {
Ordering::Less => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<T: BeaconChainTypes> ChainCollection<T> {
RangeSyncState::Head(syncing_head_ids)
};
} else {
// we removed a head chain, or an stoped finalized chain
// we removed a head chain, or a stopped finalized chain
debug_assert!(!was_syncing || sync_type != RangeSyncType::Finalized);
}
}
Expand Down

0 comments on commit 1fe0ac7

Please sign in to comment.