mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 06:14:38 +00:00
Merge remote-tracking branch 'sigp/unstable' into peerdas-devnet-7
This commit is contained in:
@@ -9,6 +9,7 @@ use beacon_chain::{
|
||||
BeaconChain, ChainConfig, NotifyExecutionLayer, StateSkipConfig, WhenSlotSkipped,
|
||||
};
|
||||
use operation_pool::PersistedOperationPool;
|
||||
use state_processing::EpochProcessingError;
|
||||
use state_processing::{per_slot_processing, per_slot_processing::Error as SlotProcessingError};
|
||||
use std::sync::LazyLock;
|
||||
use types::{
|
||||
@@ -67,11 +68,23 @@ fn massive_skips() {
|
||||
};
|
||||
|
||||
assert!(state.slot() > 1, "the state should skip at least one slot");
|
||||
assert_eq!(
|
||||
error,
|
||||
SlotProcessingError::BeaconStateError(BeaconStateError::InsufficientValidators),
|
||||
"should return error indicating that validators have been slashed out"
|
||||
)
|
||||
|
||||
if state.fork_name_unchecked().fulu_enabled() {
|
||||
// post-fulu this is done in per_epoch_processing
|
||||
assert_eq!(
|
||||
error,
|
||||
SlotProcessingError::EpochProcessingError(EpochProcessingError::BeaconStateError(
|
||||
BeaconStateError::InsufficientValidators
|
||||
)),
|
||||
"should return error indicating that validators have been slashed out"
|
||||
)
|
||||
} else {
|
||||
assert_eq!(
|
||||
error,
|
||||
SlotProcessingError::BeaconStateError(BeaconStateError::InsufficientValidators),
|
||||
"should return error indicating that validators have been slashed out"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
@@ -81,7 +81,7 @@ async fn missed_blocks_across_epochs() {
|
||||
epoch,
|
||||
decision_root,
|
||||
state
|
||||
.get_beacon_proposer_indices(&harness.chain.spec)
|
||||
.get_beacon_proposer_indices(epoch, &harness.chain.spec)
|
||||
.unwrap(),
|
||||
state.fork(),
|
||||
)
|
||||
@@ -147,7 +147,9 @@ async fn missed_blocks_basic() {
|
||||
let mut slot_in_epoch = slot % slots_per_epoch;
|
||||
let mut prev_slot = Slot::new(idx - 1);
|
||||
let mut duplicate_block_root = *_state.block_roots().get(idx as usize).unwrap();
|
||||
let mut validator_indexes = _state.get_beacon_proposer_indices(&harness1.spec).unwrap();
|
||||
let mut validator_indexes = _state
|
||||
.get_beacon_proposer_indices(epoch, &harness1.spec)
|
||||
.unwrap();
|
||||
let mut missed_block_proposer = validator_indexes[slot_in_epoch.as_usize()];
|
||||
let mut proposer_shuffling_decision_root = _state
|
||||
.proposer_shuffling_decision_root(duplicate_block_root)
|
||||
@@ -219,7 +221,9 @@ async fn missed_blocks_basic() {
|
||||
prev_slot = Slot::new(idx - 1);
|
||||
slot_in_epoch = slot % slots_per_epoch;
|
||||
duplicate_block_root = *_state2.block_roots().get(idx as usize).unwrap();
|
||||
validator_indexes = _state2.get_beacon_proposer_indices(&harness2.spec).unwrap();
|
||||
validator_indexes = _state2
|
||||
.get_beacon_proposer_indices(epoch, &harness2.spec)
|
||||
.unwrap();
|
||||
missed_block_proposer = validator_indexes[slot_in_epoch.as_usize()];
|
||||
|
||||
let beacon_proposer_cache = harness2
|
||||
@@ -317,7 +321,9 @@ async fn missed_blocks_basic() {
|
||||
slot_in_epoch = slot % slots_per_epoch;
|
||||
prev_slot = Slot::new(idx - 1);
|
||||
duplicate_block_root = *_state3.block_roots().get(idx as usize).unwrap();
|
||||
validator_indexes = _state3.get_beacon_proposer_indices(&harness3.spec).unwrap();
|
||||
validator_indexes = _state3
|
||||
.get_beacon_proposer_indices(epoch, &harness3.spec)
|
||||
.unwrap();
|
||||
missed_block_proposer = validator_indexes[slot_in_epoch.as_usize()];
|
||||
proposer_shuffling_decision_root = _state3
|
||||
.proposer_shuffling_decision_root_at_epoch(epoch, duplicate_block_root)
|
||||
|
||||
Reference in New Issue
Block a user