merge upstream/unstable

This commit is contained in:
Mark Mackey
2022-12-28 14:43:25 -06:00
37 changed files with 112 additions and 122 deletions

View File

@@ -52,10 +52,10 @@ pub fn process_sync_aggregate<T: EthSpec>(
.zip(aggregate.sync_committee_bits.iter())
{
if participation_bit {
increase_balance(state, participant_index as usize, participant_reward)?;
increase_balance(state, participant_index, participant_reward)?;
increase_balance(state, proposer_index as usize, proposer_reward)?;
} else {
decrease_balance(state, participant_index as usize, participant_reward)?;
decrease_balance(state, participant_index, participant_reward)?;
}
}

View File

@@ -76,7 +76,7 @@ pub fn get_flag_index_deltas<T: EthSpec>(
let base_reward = get_base_reward(state, index, base_reward_per_increment, spec)?;
let mut delta = Delta::default();
if unslashed_participating_indices.contains(index as usize)? {
if unslashed_participating_indices.contains(index)? {
if !state.is_in_inactivity_leak(previous_epoch, spec) {
let reward_numerator = base_reward
.safe_mul(weight)?
@@ -89,8 +89,8 @@ pub fn get_flag_index_deltas<T: EthSpec>(
delta.penalize(base_reward.safe_mul(weight)?.safe_div(WEIGHT_DENOMINATOR)?)?;
}
deltas
.get_mut(index as usize)
.ok_or(Error::DeltaOutOfBounds(index as usize))?
.get_mut(index)
.ok_or(Error::DeltaOutOfBounds(index))?
.combine(delta)?;
}
Ok(())

View File

@@ -235,7 +235,7 @@ fn get_inclusion_delay_delta(
let max_attester_reward = base_reward.safe_sub(proposer_reward)?;
delta.reward(max_attester_reward.safe_div(inclusion_info.delay)?)?;
let proposer_index = inclusion_info.proposer_index as usize;
let proposer_index = inclusion_info.proposer_index;
Ok((delta, Some((proposer_index, proposer_delta))))
} else {
Ok((Delta::default(), None))