Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/discovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ impl<E: EthSpec> Discovery<E> {
/// updates the min_ttl field.
fn add_subnet_query(&mut self, subnet: Subnet, min_ttl: Option<Instant>, retries: usize) {
// remove the entry and complete the query if greater than the maximum search count
if retries > MAX_DISCOVERY_RETRY {
if retries >= MAX_DISCOVERY_RETRY {
debug!("Subnet peer discovery did not find sufficient peers. Reached max retry limit");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/sync/backfill_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ impl<T: BeaconChainTypes> BackFillSync<T> {
.iter()
.filter(|&(_epoch, batch)| in_buffer(batch))
.count()
> BACKFILL_BATCH_BUFFER_SIZE as usize
>= BACKFILL_BATCH_BUFFER_SIZE as usize
{
return None;
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/sync/block_lookups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {

// Lookups contain untrusted data, bound the total count of lookups hold in memory to reduce
// the risk of OOM in case of bugs of malicious activity.
if self.single_block_lookups.len() > MAX_LOOKUPS {
if self.single_block_lookups.len() >= MAX_LOOKUPS {
warn!(?block_root, "Dropping lookup reached max");
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl<T: BeaconChainTypes> CustodyBackFillSync<T> {
.iter()
.filter(|&(_epoch, batch)| in_buffer(batch))
.count()
> BACKFILL_BATCH_BUFFER_SIZE as usize
>= BACKFILL_BATCH_BUFFER_SIZE as usize
{
return None;
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/sync/network_context/custody.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl<T: BeaconChainTypes> ActiveCustodyRequest<T> {
if let Some(wait_duration) = request.is_awaiting_download() {
// Note: an empty response is considered a successful response, so we may end up
// retrying many more times than `MAX_CUSTODY_COLUMN_DOWNLOAD_ATTEMPTS`.
if request.download_failures > MAX_CUSTODY_COLUMN_DOWNLOAD_ATTEMPTS {
if request.download_failures >= MAX_CUSTODY_COLUMN_DOWNLOAD_ATTEMPTS {
return Err(Error::TooManyFailures);
}

Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/sync/range_sync/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
.iter()
.filter(|&(_epoch, batch)| in_buffer(batch))
.count()
> BATCH_BUFFER_SIZE as usize
>= BATCH_BUFFER_SIZE as usize
{
return None;
}
Expand Down
Loading