From a48f535f62a1dbb05b21a780c93b301fda7f8191 Mon Sep 17 00:00:00 2001 From: Alex Bundy Date: Mon, 29 Jan 2024 10:48:56 -0800 Subject: [PATCH] Bot: Ignore (more) errors collecting activation info --- bot/src/stake_pool_v0.rs | 58 +++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/bot/src/stake_pool_v0.rs b/bot/src/stake_pool_v0.rs index cdfcb1cf..872d9369 100644 --- a/bot/src/stake_pool_v0.rs +++ b/bot/src/stake_pool_v0.rs @@ -433,33 +433,35 @@ fn merge_transient_stake_accounts( validator_stake_actions.insert(*identity, action); } StakeActivationState::Active => { - let stake_activation = client - .get_stake_activation(stake_address, None) - .map_err(|err| { - format!( - "Unable to get activation information for stake account: {}: {}", - stake_address, err - ) - })?; - - if stake_activation.state == StakeActivationState::Active { - transactions.push(Transaction::new_with_payer( - &stake_instruction::merge( - &stake_address, - &transient_stake_address, - &authorized_staker.pubkey(), - ), - Some(&authorized_staker.pubkey()), - )); - debug!("Merging active transient stake for {}", identity); - } else { - let action = format!( - "stake account {} busy because not active, while transient account {} is active", - stake_address, - transient_stake_address - ); - warn!("Busy validator {}: {}", *identity, action); - validator_stake_actions.insert(*identity, action); + match client.get_stake_activation(stake_address, None) { + Ok(stake_activation) => { + if stake_activation.state == StakeActivationState::Active { + transactions.push(Transaction::new_with_payer( + &stake_instruction::merge( + &stake_address, + &transient_stake_address, + &authorized_staker.pubkey(), + ), + Some(&authorized_staker.pubkey()), + )); + debug!("Merging active transient stake for {}", identity); + } else { + let action = format!( + "stake account {} busy because not active, while transient account {} is active", + stake_address, + transient_stake_address + ); + warn!("Busy validator {}: {}", *identity, action); + validator_stake_actions.insert(*identity, action); + } + } + + Err(err) => { + warn!( + "merge_transient_stake_accounts(): Unable to get activation information for stake account: {}; vote address: {:?}; validator identity: {:?} {}", + stake_address, vote_address, identity, err + ); + } } } StakeActivationState::Inactive => { @@ -569,7 +571,7 @@ fn create_validator_stake_accounts( Err(err) => { // Just ignore these errors warn!( - "Unable to get activation information for stake account: {}; vote address: {:?}; validator identity: {:?} {}", + "create_validator_stake_accounts(): Unable to get activation information for stake account: {}; vote address: {:?}; validator identity: {:?} {}", stake_address, vote_address, identity, err ); }