mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Update epoch processing to v0.2.0
This commit is contained in:
@@ -617,13 +617,15 @@ impl BeaconState {
|
||||
pub fn inactivity_penalty(
|
||||
&self,
|
||||
validator_index: usize,
|
||||
epochs_since_finality: u64,
|
||||
epochs_since_finality: Epoch,
|
||||
base_reward_quotient: u64,
|
||||
spec: &ChainSpec,
|
||||
) -> u64 {
|
||||
let effective_balance = self.get_effective_balance(validator_index, spec);
|
||||
self.base_reward(validator_index, base_reward_quotient, spec)
|
||||
+ effective_balance * epochs_since_finality / spec.inactivity_penalty_quotient / 2
|
||||
+ effective_balance * epochs_since_finality.as_u64()
|
||||
/ spec.inactivity_penalty_quotient
|
||||
/ 2
|
||||
}
|
||||
|
||||
/// Returns the distance between the first included attestation for some validator and this
|
||||
@@ -802,17 +804,6 @@ impl From<CommitteesError> for AttestationParticipantsError {
|
||||
|
||||
/*
|
||||
|
||||
impl From<CommitteesError> for SlotProcessingError {
|
||||
fn from(e: CommitteesError) -> SlotProcessingError {
|
||||
SlotProcessingError::CommitteesError(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EpochError> for SlotProcessingError {
|
||||
fn from(e: EpochError) -> SlotProcessingError {
|
||||
SlotProcessingError::EpochProcessingError(e)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
impl From<AttestationParticipantsError> for InclusionError {
|
||||
|
||||
@@ -56,7 +56,7 @@ impl ChainSpec {
|
||||
* Time parameters
|
||||
*/
|
||||
slot_duration: 6,
|
||||
min_attestation_inclusion_delay: Slot::new(4),
|
||||
min_attestation_inclusion_delay: 4,
|
||||
epoch_length,
|
||||
seed_lookahead: Epoch::new(1),
|
||||
entry_exit_delay: 4,
|
||||
|
||||
@@ -49,7 +49,7 @@ pub struct ChainSpec {
|
||||
* Time parameters
|
||||
*/
|
||||
pub slot_duration: u64,
|
||||
pub min_attestation_inclusion_delay: Slot,
|
||||
pub min_attestation_inclusion_delay: u64,
|
||||
pub epoch_length: u64,
|
||||
pub seed_lookahead: Epoch,
|
||||
pub entry_exit_delay: u64,
|
||||
|
||||
Reference in New Issue
Block a user