Skip to content

Commit 4780349

Browse files
committed
Use milhouse pop_front
1 parent ea38409 commit 4780349

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

consensus/state_processing/src/per_block_processing.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,9 @@ pub fn process_withdrawals<E: EthSpec, Payload: AbstractExecPayload<E>>(
644644

645645
// Update pending partial withdrawals [New in Electra:EIP7251]
646646
if let Some(processed_partial_withdrawals_count) = processed_partial_withdrawals_count {
647-
// TODO(electra): Use efficient pop_front after milhouse release https://github.com/sigp/milhouse/pull/38
648-
let new_partial_withdrawals = state
649-
.pending_partial_withdrawals()?
650-
.iter_from(processed_partial_withdrawals_count)?
651-
.cloned()
652-
.collect::<Vec<_>>();
653-
*state.pending_partial_withdrawals_mut()? = List::new(new_partial_withdrawals)?;
647+
state
648+
.pending_partial_withdrawals_mut()?
649+
.pop_front(processed_partial_withdrawals_count)?;
654650
}
655651

656652
// Update the next withdrawal index if this block contained withdrawals

consensus/state_processing/src/per_epoch_processing/single_pass.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,13 +1075,9 @@ fn process_pending_consolidations<E: EthSpec>(
10751075
next_pending_consolidation.safe_add_assign(1)?;
10761076
}
10771077

1078-
let new_pending_consolidations = List::try_from_iter(
1079-
state
1080-
.pending_consolidations()?
1081-
.iter_from(next_pending_consolidation)?
1082-
.cloned(),
1083-
)?;
1084-
*state.pending_consolidations_mut()? = new_pending_consolidations;
1078+
state
1079+
.pending_consolidations_mut()?
1080+
.pop_front(next_pending_consolidation)?;
10851081

10861082
// the spec tests require we don't perform effective balance updates when testing pending_consolidations
10871083
if !perform_effective_balance_updates {

0 commit comments

Comments
 (0)