Skip to content

Commit

Permalink
Bot: Ignore (more) errors collecting activation info
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-at-planetariummusic committed Jan 29, 2024
1 parent eb98f62 commit a48f535
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions bot/src/stake_pool_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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
);
}
Expand Down

0 comments on commit a48f535

Please sign in to comment.