mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +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]
|
||||
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
|
||||
let new_partial_withdrawals = state
|
||||
.pending_partial_withdrawals()?
|
||||
.iter_from(processed_partial_withdrawals_count)?
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
*state.pending_partial_withdrawals_mut()? = List::new(new_partial_withdrawals)?;
|
||||
state
|
||||
.pending_partial_withdrawals_mut()?
|
||||
.pop_front(processed_partial_withdrawals_count)?;
|
||||
}
|
||||
|
||||
// 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)?;
|
||||
}
|
||||
|
||||
let new_pending_consolidations = List::try_from_iter(
|
||||
state
|
||||
.pending_consolidations()?
|
||||
.iter_from(next_pending_consolidation)?
|
||||
.cloned(),
|
||||
)?;
|
||||
*state.pending_consolidations_mut()? = new_pending_consolidations;
|
||||
state
|
||||
.pending_consolidations_mut()?
|
||||
.pop_front(next_pending_consolidation)?;
|
||||
|
||||
// the spec tests require we don't perform effective balance updates when testing pending_consolidations
|
||||
if !perform_effective_balance_updates {
|
||||
|
||||
Reference in New Issue
Block a user