mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
Use milhouse pop_front
This commit is contained in:
@@ -644,13 +644,9 @@ pub fn process_withdrawals<E: EthSpec, Payload: AbstractExecPayload<E>>(
|
|||||||
|
|
||||||
// Update pending partial withdrawals [New in Electra:EIP7251]
|
// Update pending partial withdrawals [New in Electra:EIP7251]
|
||||||
if let Some(processed_partial_withdrawals_count) = processed_partial_withdrawals_count {
|
if let Some(processed_partial_withdrawals_count) = processed_partial_withdrawals_count {
|
||||||
// TODO(electra): Use efficient pop_front after milhouse release https://github.com/sigp/milhouse/pull/38
|
state
|
||||||
let new_partial_withdrawals = state
|
.pending_partial_withdrawals_mut()?
|
||||||
.pending_partial_withdrawals()?
|
.pop_front(processed_partial_withdrawals_count)?;
|
||||||
.iter_from(processed_partial_withdrawals_count)?
|
|
||||||
.cloned()
|
|
||||||
.collect::<Vec<_>>();
|
|
||||||
*state.pending_partial_withdrawals_mut()? = List::new(new_partial_withdrawals)?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the next withdrawal index if this block contained withdrawals
|
// Update the next withdrawal index if this block contained withdrawals
|
||||||
|
|||||||
@@ -1075,13 +1075,9 @@ fn process_pending_consolidations<E: EthSpec>(
|
|||||||
next_pending_consolidation.safe_add_assign(1)?;
|
next_pending_consolidation.safe_add_assign(1)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let new_pending_consolidations = List::try_from_iter(
|
|
||||||
state
|
state
|
||||||
.pending_consolidations()?
|
.pending_consolidations_mut()?
|
||||||
.iter_from(next_pending_consolidation)?
|
.pop_front(next_pending_consolidation)?;
|
||||||
.cloned(),
|
|
||||||
)?;
|
|
||||||
*state.pending_consolidations_mut()? = new_pending_consolidations;
|
|
||||||
|
|
||||||
// the spec tests require we don't perform effective balance updates when testing pending_consolidations
|
// the spec tests require we don't perform effective balance updates when testing pending_consolidations
|
||||||
if !perform_effective_balance_updates {
|
if !perform_effective_balance_updates {
|
||||||
|
|||||||
Reference in New Issue
Block a user