Skip to content

Commit

Permalink
test: add test for fcu during backfill (paradigmxyz#9712)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jul 22, 2024
1 parent 331c49c commit 86ddf4d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,4 +1322,27 @@ mod tests {
assert_eq!(expected_state, *actual_state_by_number);
}
}

#[tokio::test]
async fn test_engine_request_during_backfill() {
let TestHarness { mut tree, to_tree_tx, sf_action_rx, blocks, payload_command_rx } =
get_default_test_harness(PERSISTENCE_THRESHOLD);

// set backfill active
tree.is_backfill_active = true;

let (tx, rx) = oneshot::channel();
tree.on_engine_message(FromEngine::Request(BeaconEngineMessage::ForkchoiceUpdated {
state: ForkchoiceState {
head_block_hash: B256::random(),
safe_block_hash: B256::random(),
finalized_block_hash: B256::random(),
},
payload_attrs: None,
tx,
}));

let resp = rx.await.unwrap().unwrap().await.unwrap();
assert!(resp.payload_status.is_syncing());
}
}

0 comments on commit 86ddf4d

Please sign in to comment.