Skip to content

Commit

Permalink
Implement "Do not change creds type on consolidation"
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Dec 20, 2024
1 parent 282eefb commit 52e602d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
}

Expand Down Expand Up @@ -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(())
}
2 changes: 1 addition & 1 deletion consensus/types/presets/gnosis/electra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MAX_ATTESTER_SLASHINGS_ELECTRA: 1
# `uint64(2**3)` (= 8)
MAX_ATTESTATIONS_ELECTRA: 8
# `uint64(2**0)` (= 1)
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 1
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2

# Execution
# ---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion consensus/types/presets/mainnet/electra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MAX_ATTESTER_SLASHINGS_ELECTRA: 1
# `uint64(2**3)` (= 8)
MAX_ATTESTATIONS_ELECTRA: 8
# `uint64(2**0)` (= 1)
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 1
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2

# Execution
# ---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion consensus/types/presets/minimal/electra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MAX_ATTESTER_SLASHINGS_ELECTRA: 1
# `uint64(2**3)` (= 8)
MAX_ATTESTATIONS_ELECTRA: 8
# `uint64(2**0)` (= 1)
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 1
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2

# Execution
# ---------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions consensus/types/src/eth_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl EthSpec for MainnetEthSpec {
type PendingDepositsLimit = U134217728;
type PendingPartialWithdrawalsLimit = U134217728;
type PendingConsolidationsLimit = U262144;
type MaxConsolidationRequestsPerPayload = U1;
type MaxConsolidationRequestsPerPayload = U2;
type MaxDepositRequestsPerPayload = U8192;
type MaxAttesterSlashingsElectra = U1;
type MaxAttestationsElectra = U8;
Expand Down Expand Up @@ -568,7 +568,7 @@ impl EthSpec for GnosisEthSpec {
type PendingDepositsLimit = U134217728;
type PendingPartialWithdrawalsLimit = U134217728;
type PendingConsolidationsLimit = U262144;
type MaxConsolidationRequestsPerPayload = U1;
type MaxConsolidationRequestsPerPayload = U2;
type MaxDepositRequestsPerPayload = U8192;
type MaxAttesterSlashingsElectra = U1;
type MaxAttestationsElectra = U8;
Expand Down

0 comments on commit 52e602d

Please sign in to comment.