mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 13:54:44 +00:00
## Issue Addressed #4512 Which issue # does this PR address? ## Proposed Changes Add inactivity calculation for Altair Please list or describe the changes introduced by this PR. Add inactivity calculation for Altair ## Additional Info Please provide any additional information. For example, future considerations or information useful for reviewers. Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -2350,6 +2350,29 @@ where
|
||||
.await
|
||||
}
|
||||
|
||||
/// Uses `Self::extend_chain` to `num_slots` blocks.
|
||||
///
|
||||
/// Utilizes:
|
||||
///
|
||||
/// - BlockStrategy::OnCanonicalHead,
|
||||
/// - AttestationStrategy::SomeValidators(validators),
|
||||
pub async fn extend_slots_some_validators(
|
||||
&self,
|
||||
num_slots: usize,
|
||||
validators: Vec<usize>,
|
||||
) -> Hash256 {
|
||||
if self.chain.slot().unwrap() == self.chain.canonical_head.cached_head().head_slot() {
|
||||
self.advance_slot();
|
||||
}
|
||||
|
||||
self.extend_chain(
|
||||
num_slots,
|
||||
BlockStrategy::OnCanonicalHead,
|
||||
AttestationStrategy::SomeValidators(validators),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Extend the `BeaconChain` with some blocks and attestations. Returns the root of the
|
||||
/// last-produced block (the head of the chain).
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user