mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
Merge branch 'p2p-electra' of https://github.com/sigp/lighthouse into ef-tests-electra
This commit is contained in:
@@ -439,7 +439,7 @@ impl Eth1GenesisService {
|
||||
None
|
||||
};
|
||||
|
||||
apply_deposit(&mut state, data, proof, spec)
|
||||
apply_deposit(&mut state, data, proof, true, spec)
|
||||
.map_err(|e| format!("Error whilst processing deposit: {:?}", e))
|
||||
})?;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
.map_err(BlockProcessingError::MerkleTreeError)?;
|
||||
state.eth1_data_mut().deposit_root = deposit_tree.root();
|
||||
let Deposit { proof, data } = deposit;
|
||||
apply_deposit(&mut state, data, Some(proof), spec)?;
|
||||
apply_deposit(&mut state, data, Some(proof), true, spec)?;
|
||||
}
|
||||
|
||||
process_activations(&mut state, spec)?;
|
||||
|
||||
@@ -417,7 +417,7 @@ pub fn process_deposits<E: EthSpec>(
|
||||
|
||||
// Update the state in series.
|
||||
for deposit in deposits {
|
||||
apply_deposit(state, deposit.data.clone(), None, spec)?;
|
||||
apply_deposit(state, deposit.data.clone(), None, true, spec)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -428,6 +428,7 @@ pub fn apply_deposit<E: EthSpec>(
|
||||
state: &mut BeaconState<E>,
|
||||
deposit_data: DepositData,
|
||||
proof: Option<FixedVector<Hash256, U33>>,
|
||||
increment_eth1_deposit_index: bool,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<(), BlockProcessingError> {
|
||||
let deposit_index = state.eth1_deposit_index() as usize;
|
||||
@@ -440,7 +441,9 @@ pub fn apply_deposit<E: EthSpec>(
|
||||
.map_err(|e| e.into_with_index(deposit_index))?;
|
||||
}
|
||||
|
||||
state.eth1_deposit_index_mut().safe_add_assign(1)?;
|
||||
if increment_eth1_deposit_index {
|
||||
state.eth1_deposit_index_mut().safe_add_assign(1)?;
|
||||
}
|
||||
|
||||
// Get an `Option<u64>` where `u64` is the validator index if this deposit public key
|
||||
// already exists in the beacon_state.
|
||||
@@ -641,7 +644,7 @@ pub fn process_deposit_receipts<E: EthSpec>(
|
||||
amount: receipt.amount,
|
||||
signature: receipt.signature.clone().into(),
|
||||
};
|
||||
apply_deposit(state, deposit_data, None, spec)?
|
||||
apply_deposit(state, deposit_data, None, false, spec)?
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user