@@ -3264,7 +3264,8 @@ fn do_test_optimistic_confirmation_violation_with_or_without_tower(with_tower: b
3264
3264
{
3265
3265
// Find latest vote in B, and wait for it to reach blockstore
3266
3266
let b_last_vote =
3267
- wait_for_last_vote_in_tower_to_land_in_ledger ( & val_b_ledger_path, & validator_b_pubkey) ;
3267
+ wait_for_last_vote_in_tower_to_land_in_ledger ( & val_b_ledger_path, & validator_b_pubkey)
3268
+ . unwrap ( ) ;
3268
3269
3269
3270
// Now we copy these blocks to A
3270
3271
let b_blockstore = open_blockstore ( & val_b_ledger_path) ;
@@ -3474,11 +3475,13 @@ fn test_fork_choice_refresh_old_votes() {
3474
3475
let lighter_fork_latest_vote = wait_for_last_vote_in_tower_to_land_in_ledger (
3475
3476
& lighter_fork_ledger_path,
3476
3477
& context. lighter_fork_validator_key ,
3477
- ) ;
3478
+ )
3479
+ . unwrap ( ) ;
3478
3480
let heaviest_fork_latest_vote = wait_for_last_vote_in_tower_to_land_in_ledger (
3479
3481
& heaviest_ledger_path,
3480
3482
& context. heaviest_validator_key ,
3481
- ) ;
3483
+ )
3484
+ . unwrap ( ) ;
3482
3485
3483
3486
// Open ledgers
3484
3487
let smallest_blockstore = open_blockstore ( & smallest_ledger_path) ;
@@ -4434,7 +4437,8 @@ fn test_slot_hash_expiry() {
4434
4437
let mut last_vote_on_a;
4435
4438
// Keep A running for a while longer so the majority fork has some decent size
4436
4439
loop {
4437
- last_vote_on_a = wait_for_last_vote_in_tower_to_land_in_ledger ( & a_ledger_path, & a_pubkey) ;
4440
+ last_vote_on_a =
4441
+ wait_for_last_vote_in_tower_to_land_in_ledger ( & a_ledger_path, & a_pubkey) . unwrap ( ) ;
4438
4442
if last_vote_on_a
4439
4443
>= common_ancestor_slot + 2 * ( solana_sdk:: slot_hashes:: get_entries ( ) as u64 )
4440
4444
{
@@ -4460,7 +4464,8 @@ fn test_slot_hash_expiry() {
4460
4464
info ! ( "Allowing B to fork" ) ;
4461
4465
loop {
4462
4466
let blockstore = open_blockstore ( & b_ledger_path) ;
4463
- let last_vote = wait_for_last_vote_in_tower_to_land_in_ledger ( & b_ledger_path, & b_pubkey) ;
4467
+ let last_vote =
4468
+ wait_for_last_vote_in_tower_to_land_in_ledger ( & b_ledger_path, & b_pubkey) . unwrap ( ) ;
4464
4469
let mut ancestors = AncestorIterator :: new ( last_vote, & blockstore) ;
4465
4470
if let Some ( index) = ancestors. position ( |x| x == common_ancestor_slot) {
4466
4471
if index > 7 {
@@ -4674,7 +4679,8 @@ fn test_duplicate_with_pruned_ancestor() {
4674
4679
last_minority_vote
4675
4680
) ;
4676
4681
let last_minority_vote =
4677
- wait_for_last_vote_in_tower_to_land_in_ledger ( & minority_ledger_path, & minority_pubkey) ;
4682
+ wait_for_last_vote_in_tower_to_land_in_ledger ( & minority_ledger_path, & minority_pubkey)
4683
+ . unwrap ( ) ;
4678
4684
let minority_validator_info = cluster. exit_node ( & minority_pubkey) ;
4679
4685
4680
4686
info ! ( "Truncating majority validator ledger to {fork_slot}" ) ;
@@ -4720,7 +4726,8 @@ fn test_duplicate_with_pruned_ancestor() {
4720
4726
}
4721
4727
4722
4728
let last_majority_vote =
4723
- wait_for_last_vote_in_tower_to_land_in_ledger ( & majority_ledger_path, & majority_pubkey) ;
4729
+ wait_for_last_vote_in_tower_to_land_in_ledger ( & majority_ledger_path, & majority_pubkey)
4730
+ . unwrap ( ) ;
4724
4731
info ! (
4725
4732
"Creating duplicate block built off of pruned branch for our node.
4726
4733
Last majority vote {last_majority_vote}, Last minority vote {last_minority_vote}"
@@ -5222,7 +5229,8 @@ fn test_duplicate_shreds_switch_failure() {
5222
5229
// The `target_switch_fork_validator_pubkey` fork is necessary in 2. to force the validator stall trying to switch
5223
5230
// vote on that other fork and prevent the validator from making a freebie vote from `A` and allowing consensus to continue.
5224
5231
5225
- // It's important we give the `duplicate_fork_validator1_pubkey` very few leader slots so that:
5232
+ // It's important we don't give the `duplicate_fork_validator1_pubkey` leader slots until a certain number
5233
+ // of slots have elapsed to ensure:
5226
5234
// 1. We have ample time to ensure he doesn't have a chance to make a block until after 2 when they see the block is duplicate.
5227
5235
// Otherwise, they'll build the block on top of the duplicate block, which will possibly include a vote for the duplicate block.
5228
5236
// We want to avoid this because this will make fork choice pick the duplicate block.
@@ -5417,11 +5425,11 @@ fn test_duplicate_shreds_switch_failure() {
5417
5425
5418
5426
info ! ( "Waiting for switch fork to make block past duplicate fork" ) ;
5419
5427
loop {
5420
- let last_vote = last_vote_in_tower (
5428
+ let last_vote = wait_for_last_vote_in_tower_to_land_in_ledger (
5421
5429
& target_switch_fork_validator_ledger_path,
5422
5430
& target_switch_fork_validator_pubkey,
5423
5431
) ;
5424
- if let Some ( ( latest_vote_slot, _hash ) ) = last_vote {
5432
+ if let Some ( latest_vote_slot) = last_vote {
5425
5433
if latest_vote_slot > dup_slot {
5426
5434
let blockstore = open_blockstore ( & target_switch_fork_validator_ledger_path) ;
5427
5435
let ancestor_slots: HashSet < Slot > =
0 commit comments