mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
More tree fields, fix bugs
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
use crate::EpochProcessingError;
|
||||
use core::result::Result;
|
||||
use core::result::Result::Ok;
|
||||
use types::beacon_state::BeaconState;
|
||||
use types::eth_spec::EthSpec;
|
||||
use types::participation_flags::ParticipationFlags;
|
||||
use types::VariableList;
|
||||
use types::VList;
|
||||
|
||||
pub fn process_participation_flag_updates<T: EthSpec>(
|
||||
state: &mut BeaconState<T>,
|
||||
) -> Result<(), EpochProcessingError> {
|
||||
*state.previous_epoch_participation_mut()? =
|
||||
std::mem::take(state.current_epoch_participation_mut()?);
|
||||
*state.current_epoch_participation_mut()? = VariableList::new(vec![
|
||||
ParticipationFlags::default(
|
||||
);
|
||||
*state.current_epoch_participation_mut()? = VList::new(vec![
|
||||
ParticipationFlags::default();
|
||||
state.validators().len()
|
||||
])?;
|
||||
Ok(())
|
||||
|
||||
@@ -16,7 +16,7 @@ pub fn process_historical_roots_update<T: EthSpec>(
|
||||
.safe_rem(T::SlotsPerHistoricalRoot::to_u64().safe_div(T::slots_per_epoch())?)?
|
||||
== 0
|
||||
{
|
||||
let historical_batch = state.historical_batch();
|
||||
let historical_batch = state.historical_batch()?;
|
||||
state
|
||||
.historical_roots_mut()
|
||||
.push(historical_batch.tree_hash_root())?;
|
||||
|
||||
Reference in New Issue
Block a user