mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 21:17:17 +00:00
state_processing: remove spurious withdrawal credentials check
This commit is contained in:
parent
706f850c9e
commit
37c67117d3
@ -386,8 +386,6 @@ pub fn process_deposits<T: EthSpec>(
|
|||||||
|
|
||||||
// Get an `Option<u64>` where `u64` is the validator index if this deposit public key
|
// Get an `Option<u64>` where `u64` is the validator index if this deposit public key
|
||||||
// already exists in the beacon_state.
|
// already exists in the beacon_state.
|
||||||
//
|
|
||||||
// This function also verifies the withdrawal credentials.
|
|
||||||
let validator_index =
|
let validator_index =
|
||||||
get_existing_validator_index(state, deposit).map_err(|e| e.into_with_index(i))?;
|
get_existing_validator_index(state, deposit).map_err(|e| e.into_with_index(i))?;
|
||||||
|
|
||||||
|
@ -323,9 +323,6 @@ pub enum DepositInvalid {
|
|||||||
BadIndex { state: u64, deposit: u64 },
|
BadIndex { state: u64, deposit: u64 },
|
||||||
/// The signature (proof-of-possession) does not match the given pubkey.
|
/// The signature (proof-of-possession) does not match the given pubkey.
|
||||||
BadSignature,
|
BadSignature,
|
||||||
/// The withdrawal credentials for the depositing validator did not match the withdrawal
|
|
||||||
/// credentials of an existing validator with the same public key.
|
|
||||||
BadWithdrawalCredentials,
|
|
||||||
/// The specified `branch` and `index` did not form a valid proof that the deposit is included
|
/// The specified `branch` and `index` did not form a valid proof that the deposit is included
|
||||||
/// in the eth1 deposit root.
|
/// in the eth1 deposit root.
|
||||||
BadMerkleProof,
|
BadMerkleProof,
|
||||||
|
@ -52,19 +52,7 @@ pub fn get_existing_validator_index<T: EthSpec>(
|
|||||||
deposit: &Deposit,
|
deposit: &Deposit,
|
||||||
) -> Result<Option<u64>, Error> {
|
) -> Result<Option<u64>, Error> {
|
||||||
let validator_index = state.get_validator_index(&deposit.data.pubkey)?;
|
let validator_index = state.get_validator_index(&deposit.data.pubkey)?;
|
||||||
|
Ok(validator_index.map(|idx| idx as u64))
|
||||||
// NOTE: it seems that v0.6.1 doesn't require the withdrawal credentials to be checked
|
|
||||||
match validator_index {
|
|
||||||
None => Ok(None),
|
|
||||||
Some(index) => {
|
|
||||||
verify!(
|
|
||||||
deposit.data.withdrawal_credentials
|
|
||||||
== state.validator_registry[index].withdrawal_credentials,
|
|
||||||
Invalid::BadWithdrawalCredentials
|
|
||||||
);
|
|
||||||
Ok(Some(index as u64))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Verify that a deposit is included in the state's eth1 deposit root.
|
/// Verify that a deposit is included in the state's eth1 deposit root.
|
||||||
|
Loading…
Reference in New Issue
Block a user