mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 03:12:41 +00:00
* Consensus changes
* EF tests
* lcli
* common and watch
* account manager
* cargo
* fork choice
* promise cache
* beacon chain
* interop genesis
* http api
* lighthouse
* op pool
* beacon chain misc
* parallel state cache
* store
* fix issues in store
* IT COMPILES
* Remove some unnecessary module qualification
* Revert Arced pubkey optimization (#5536)
* Merge remote-tracking branch 'origin/unstable' into tree-states-memory
* Fix caching, rebasing and some tests
* Remove unused deps
* Merge remote-tracking branch 'origin/unstable' into tree-states-memory
* Small cleanups
* Revert shuffling cache/promise cache changes
* Fix state advance bugs
* Fix shuffling tests
* Remove some resolved FIXMEs
* Remove StateProcessingStrategy
* Optimise withdrawals calculation
* Don't reorg if state cache is missed
* Remove inconsistent state func
* Fix beta compiler
* Rebase early, rebase often
* Fix state caching behaviour
* Update to milhouse release
* Fix on-disk consensus context format
* Merge remote-tracking branch 'origin/unstable' into tree-states-memory
* Squashed commit of the following:
commit 3a16649023
Author: Michael Sproul <michael@sigmaprime.io>
Date: Thu Apr 18 14:26:09 2024 +1000
Fix on-disk consensus context format
* Keep indexed attestations, thanks Sean
* Merge branch 'on-disk-consensus-context' into tree-states-memory
* Merge branch 'unstable' into tree-states-memory
* Address half of Sean's review
* More simplifications from Sean's review
* Cache state after get_advanced_hot_state
37 lines
996 B
Rust
37 lines
996 B
Rust
use super::errors::EpochProcessingError;
|
|
use safe_arith::SafeArith;
|
|
use types::beacon_state::BeaconState;
|
|
use types::eth_spec::EthSpec;
|
|
use types::{List, Unsigned};
|
|
|
|
pub fn process_eth1_data_reset<E: EthSpec>(
|
|
state: &mut BeaconState<E>,
|
|
) -> Result<(), EpochProcessingError> {
|
|
if state
|
|
.slot()
|
|
.safe_add(1)?
|
|
.safe_rem(E::SlotsPerEth1VotingPeriod::to_u64())?
|
|
== 0
|
|
{
|
|
*state.eth1_data_votes_mut() = List::empty();
|
|
}
|
|
Ok(())
|
|
}
|
|
|
|
pub fn process_slashings_reset<E: EthSpec>(
|
|
state: &mut BeaconState<E>,
|
|
) -> Result<(), EpochProcessingError> {
|
|
let next_epoch = state.next_epoch()?;
|
|
state.set_slashings(next_epoch, 0)?;
|
|
Ok(())
|
|
}
|
|
|
|
pub fn process_randao_mixes_reset<E: EthSpec>(
|
|
state: &mut BeaconState<E>,
|
|
) -> Result<(), EpochProcessingError> {
|
|
let current_epoch = state.current_epoch();
|
|
let next_epoch = state.next_epoch()?;
|
|
state.set_randao_mix(next_epoch, *state.get_randao_mix(current_epoch)?)?;
|
|
Ok(())
|
|
}
|