Implement "Do not change creds type on consolidation"

This commit is contained in:
Michael Sproul
2024-12-20 17:57:51 +11:00
parent 282eefb91e
commit 52e602dca8
5 changed files with 7 additions and 12 deletions

View File

@@ -746,8 +746,8 @@ pub fn process_consolidation_request<E: EthSpec>(
}
let target_validator = state.get_validator(target_index)?;
// Verify the target has execution withdrawal credentials
if !target_validator.has_execution_withdrawal_credential(spec) {
// Verify the target has compounding withdrawal credentials
if !target_validator.has_compounding_withdrawal_credential(spec) {
return Ok(());
}
@@ -791,10 +791,5 @@ pub fn process_consolidation_request<E: EthSpec>(
target_index: target_index as u64,
})?;
let target_validator = state.get_validator(target_index)?;
// Churn any target excess active balance of target and raise its max
if target_validator.has_eth1_withdrawal_credential(spec) {
state.switch_to_compounding_validator(target_index, spec)?;
}
Ok(())
}