Gloas fork choice redux (#9025)

Co-Authored-By: hopinheimer <knmanas6@gmail.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>

Co-Authored-By: hopinheimer <48147533+hopinheimer@users.noreply.github.com>

Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Daniel Knopik <107140945+dknopik@users.noreply.github.com>
This commit is contained in:
Michael Sproul
2026-04-03 19:35:02 +11:00
committed by GitHub
parent 99f5a92b98
commit 65c2e01612
40 changed files with 4061 additions and 834 deletions

View File

@@ -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."
);
}