Skip to content

Commit

Permalink
fix: naming
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Jun 25, 2024
1 parent df47331 commit 5312a41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zero_bin/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub mod retry;

use compat::Compat;

const PREVIOUS_HASHES_SIZE: usize = 256;
const PREVIOUS_HASHES_COUNT: usize = 256;

/// The RPC type.
#[derive(ValueEnum, Clone, Debug)]
Expand Down Expand Up @@ -90,7 +90,7 @@ where

let previous_block_numbers =
std::iter::successors(Some(target_block_number as i128 - 1), |&it| Some(it - 1))
.take(PREVIOUS_HASHES_SIZE)
.take(PREVIOUS_HASHES_COUNT)
.filter(|i| *i >= 0)
.collect::<Vec<_>>();
let concurrency = previous_block_numbers.len();
Expand Down Expand Up @@ -124,7 +124,7 @@ where
.await
.context("couldn't fill previous hashes")?;

let mut prev_hashes = [B256::ZERO; PREVIOUS_HASHES_SIZE];
let mut prev_hashes = [B256::ZERO; PREVIOUS_HASHES_COUNT];
collected_hashes
.into_iter()
.flatten()
Expand All @@ -133,7 +133,7 @@ where
if let (Some(hash), Some(block_num)) = (hash, block_num) {
// Most recent previous block hash is expected at the end of the array
prev_hashes
[PREVIOUS_HASHES_SIZE - (target_block_number - block_num as u64) as usize] =
[PREVIOUS_HASHES_COUNT - (target_block_number - block_num as u64) as usize] =
hash;
}
});
Expand Down

0 comments on commit 5312a41

Please sign in to comment.