mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-26 09:13:41 +00:00
implement scoring mechanisms and plumbing
This commit is contained in:
@@ -1498,7 +1498,7 @@ async fn weights_after_resetting_optimistic_status() {
|
||||
.fork_choice_read_lock()
|
||||
.proto_array()
|
||||
.iter_nodes(&head.head_block_root())
|
||||
.map(|node| (node.root, node.weight))
|
||||
.map(|node| (node.root(), node.weight()))
|
||||
.collect::<HashMap<_, _>>();
|
||||
|
||||
rig.invalidate_manually(roots[1]).await;
|
||||
@@ -1518,7 +1518,7 @@ async fn weights_after_resetting_optimistic_status() {
|
||||
.fork_choice_read_lock()
|
||||
.proto_array()
|
||||
.iter_nodes(&head.head_block_root())
|
||||
.map(|node| (node.root, node.weight))
|
||||
.map(|node| (node.root(), node.weight()))
|
||||
.collect::<HashMap<_, _>>();
|
||||
|
||||
assert_eq!(original_weights, new_weights);
|
||||
|
||||
@@ -590,7 +590,10 @@ async fn unaggregated_attestations_added_to_fork_choice_some_none() {
|
||||
|
||||
if slot <= num_blocks_produced && slot != 0 {
|
||||
assert_eq!(
|
||||
latest_message.unwrap().1,
|
||||
latest_message
|
||||
.expect("latest message should be present")
|
||||
.slot
|
||||
.epoch(MinimalEthSpec::slots_per_epoch()),
|
||||
slot.epoch(MinimalEthSpec::slots_per_epoch()),
|
||||
"Latest message epoch for {} should be equal to epoch {}.",
|
||||
validator,
|
||||
@@ -700,10 +703,12 @@ async fn unaggregated_attestations_added_to_fork_choice_all_updated() {
|
||||
let validator_slots: Vec<(&usize, Slot)> = validators.iter().zip(slots).collect();
|
||||
|
||||
for (validator, slot) in validator_slots {
|
||||
let latest_message = fork_choice.latest_message(*validator);
|
||||
let latest_message = fork_choice
|
||||
.latest_message(*validator)
|
||||
.expect("latest message should be present");
|
||||
|
||||
assert_eq!(
|
||||
latest_message.unwrap().1,
|
||||
latest_message.slot.epoch(MinimalEthSpec::slots_per_epoch()),
|
||||
slot.epoch(MinimalEthSpec::slots_per_epoch()),
|
||||
"Latest message slot should be equal to attester duty."
|
||||
);
|
||||
@@ -714,8 +719,7 @@ async fn unaggregated_attestations_added_to_fork_choice_all_updated() {
|
||||
.expect("Should get block root at slot");
|
||||
|
||||
assert_eq!(
|
||||
latest_message.unwrap().0,
|
||||
*block_root,
|
||||
latest_message.root, *block_root,
|
||||
"Latest message block root should be equal to block at slot."
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user