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

@@ -1350,7 +1350,7 @@ async fn recover_from_invalid_head_by_importing_blocks() {
"the fork block should become the head"
);
let manual_get_head = rig
let (manual_get_head, _) = rig
.harness
.chain
.canonical_head
@@ -1428,7 +1428,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;
@@ -1438,7 +1438,7 @@ async fn weights_after_resetting_optimistic_status() {
.canonical_head
.fork_choice_write_lock()
.proto_array_mut()
.set_all_blocks_to_optimistic::<E>(&rig.harness.chain.spec)
.set_all_blocks_to_optimistic::<E>()
.unwrap();
let new_weights = rig
@@ -1448,7 +1448,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);