Skip to content

Commit

Permalink
Fix some typos (sigp#4565)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu authored and Woodpile37 committed Jan 6, 2024
1 parent 487379f commit e8a53ce
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ pub enum WhenSlotSkipped {
///
/// This is how the HTTP API behaves.
None,
/// If the slot it a skip slot, return the previous non-skipped block.
/// If the slot is a skip slot, return the previous non-skipped block.
///
/// This is generally how the specification behaves.
Prev,
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/beacon_proposer_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl BeaconProposerCache {

/// Compute the proposer duties using the head state without cache.
pub fn compute_proposer_duties_from_head<T: BeaconChainTypes>(
current_epoch: Epoch,
request_epoch: Epoch,
chain: &BeaconChain<T>,
) -> Result<(Vec<usize>, Hash256, ExecutionStatus, Fork), BeaconChainError> {
// Atomically collect information about the head whilst holding the canonical head `Arc` as
Expand All @@ -159,7 +159,7 @@ pub fn compute_proposer_duties_from_head<T: BeaconChainTypes>(
.ok_or(BeaconChainError::HeadMissingFromForkChoice(head_block_root))?;

// Advance the state into the requested epoch.
ensure_state_is_in_epoch(&mut state, head_state_root, current_epoch, &chain.spec)?;
ensure_state_is_in_epoch(&mut state, head_state_root, request_epoch, &chain.spec)?;

let indices = state
.get_beacon_proposer_indices(&chain.spec)
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/operation_pool/src/reward_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct Initialization {
#[derive(Debug, Clone, Default)]
pub struct RewardCache {
initialization: Option<Initialization>,
/// `BitVec` of validator indices which don't have default participation flags for the prev. epoch.
/// `BitVec` of validator indices which don't have default participation flags for the prev epoch.
///
/// We choose to only track whether validators have *any* participation flag set because
/// it's impossible to include a new attestation which is better than the existing participation
Expand Down
7 changes: 2 additions & 5 deletions consensus/fork_choice/src/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,10 @@ where
// for lower slots to account for skip slots.
.find(|(_, slot)| *slot <= ancestor_slot)
.map(|(root, _)| root)),
Ordering::Less => Ok(Some(block_root)),
Ordering::Equal =>
// Root is older than queried slot, thus a skip slot. Return most recent root prior
// to slot.
{
Ok(Some(block_root))
}
Ordering::Less => Ok(Some(block_root)),
Ordering::Equal => Ok(Some(block_root)),
}
}

Expand Down
2 changes: 1 addition & 1 deletion consensus/proto_array/src/proto_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ impl ProtoArray {
Ok(())
}

/// Indicates if the node itself is viable for the head, or if it's best descendant is viable
/// Indicates if the node itself is viable for the head, or if its best descendant is viable
/// for the head.
fn node_leads_to_viable_head<E: EthSpec>(
&self,
Expand Down
2 changes: 1 addition & 1 deletion validator_client/src/duties_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ async fn fill_in_selection_proofs<T: SlotClock + 'static, E: EthSpec>(
/// 2. We won't miss a block if the duties for the current slot happen to change with this poll.
///
/// This sounds great, but is it safe? Firstly, the additional notification will only contain block
/// producers that were not included in the first notification. This should be safety enough.
/// producers that were not included in the first notification. This should be safe enough.
/// However, we also have the slashing protection as a second line of defence. These two factors
/// provide an acceptable level of safety.
///
Expand Down
2 changes: 1 addition & 1 deletion validator_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ impl<T: EthSpec> ProductionValidatorClient<T> {

pub fn start_service(&mut self) -> Result<(), String> {
// We use `SLOTS_PER_EPOCH` as the capacity of the block notification channel, because
// we don't except notifications to be delayed by more than a single slot, let alone a
// we don't expect notifications to be delayed by more than a single slot, let alone a
// whole epoch!
let channel_capacity = T::slots_per_epoch() as usize;
let (block_service_tx, block_service_rx) = mpsc::channel(channel_capacity);
Expand Down

0 comments on commit e8a53ce

Please sign in to comment.