mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 21:17:17 +00:00
Ensure per_epoch trans. happens before per_slot.
This commit is contained in:
parent
c1b3d1b63e
commit
02a962d35d
@ -16,6 +16,10 @@ impl BeaconState {
|
||||
previous_block_root: Hash256,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<(), Error> {
|
||||
if (self.slot + 1) % spec.epoch_length == 0 {
|
||||
self.per_epoch_processing(spec)?;
|
||||
}
|
||||
|
||||
self.slot += 1;
|
||||
|
||||
let block_proposer = self.get_beacon_proposer_index(self.slot, spec)?;
|
||||
@ -32,10 +36,6 @@ impl BeaconState {
|
||||
let root = merkle_root(&self.latest_block_roots[..]);
|
||||
self.batched_block_roots.push(root);
|
||||
}
|
||||
|
||||
if self.slot % spec.epoch_length == 0 {
|
||||
self.per_epoch_processing(spec)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user