mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Merge branch 'block-processing-electra' of https://github.com/sigp/lighthouse into electra-epoch-proc
This commit is contained in:
@@ -439,7 +439,7 @@ impl Eth1GenesisService {
|
|||||||
None
|
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))
|
.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)?;
|
.map_err(BlockProcessingError::MerkleTreeError)?;
|
||||||
state.eth1_data_mut().deposit_root = deposit_tree.root();
|
state.eth1_data_mut().deposit_root = deposit_tree.root();
|
||||||
let Deposit { proof, data } = deposit;
|
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)?;
|
process_activations(&mut state, spec)?;
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ pub fn process_deposits<E: EthSpec>(
|
|||||||
|
|
||||||
// Update the state in series.
|
// Update the state in series.
|
||||||
for deposit in deposits {
|
for deposit in deposits {
|
||||||
apply_deposit(state, deposit.data.clone(), None, spec)?;
|
apply_deposit(state, deposit.data.clone(), None, true, spec)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -428,6 +428,7 @@ pub fn apply_deposit<E: EthSpec>(
|
|||||||
state: &mut BeaconState<E>,
|
state: &mut BeaconState<E>,
|
||||||
deposit_data: DepositData,
|
deposit_data: DepositData,
|
||||||
proof: Option<FixedVector<Hash256, U33>>,
|
proof: Option<FixedVector<Hash256, U33>>,
|
||||||
|
increment_eth1_deposit_index: bool,
|
||||||
spec: &ChainSpec,
|
spec: &ChainSpec,
|
||||||
) -> Result<(), BlockProcessingError> {
|
) -> Result<(), BlockProcessingError> {
|
||||||
let deposit_index = state.eth1_deposit_index() as usize;
|
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))?;
|
.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
|
// 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.
|
||||||
@@ -641,7 +644,7 @@ pub fn process_deposit_receipts<E: EthSpec>(
|
|||||||
amount: receipt.amount,
|
amount: receipt.amount,
|
||||||
signature: receipt.signature.clone().into(),
|
signature: receipt.signature.clone().into(),
|
||||||
};
|
};
|
||||||
apply_deposit(state, deposit_data, None, spec)?
|
apply_deposit(state, deposit_data, None, false, spec)?
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user