Switch to compounding when consolidating with source==target

This commit is contained in:
Pawan Dhananjay
2024-10-10 16:31:36 -07:00
parent 3d595e6c0f
commit 0a4e6be223
3 changed files with 69 additions and 25 deletions

View File

@@ -2166,12 +2166,10 @@ impl<E: EthSpec> BeaconState<E> {
.validators_mut()
.get_mut(validator_index)
.ok_or(Error::UnknownValidator(validator_index))?;
if validator.has_eth1_withdrawal_credential(spec) {
AsMut::<[u8; 32]>::as_mut(&mut validator.withdrawal_credentials)[0] =
spec.compounding_withdrawal_prefix_byte;
AsMut::<[u8; 32]>::as_mut(&mut validator.withdrawal_credentials)[0] =
spec.compounding_withdrawal_prefix_byte;
self.queue_excess_active_balance(validator_index, spec)?;
}
self.queue_excess_active_balance(validator_index, spec)?;
Ok(())
}