Skip to content

Commit

Permalink
Logs for rebalance debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ebatsell committed Jun 25, 2024
1 parent 235c003 commit 7fa0f34
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions programs/steward/src/state/steward_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,12 @@ impl StewardState {
.checked_add(stake_rent)
.ok_or(StewardError::ArithmeticError)?;

msg!("Reserve lamports before adjustment: {}", reserve_lamports);
msg!(
"Stake pool lamports before adjustment: {}",
stake_pool_lamports
);

// Maximum increase amount is the total lamports in the reserve stake account minus 2 * stake_rent, which accounts for reserve rent + transient rent
// Saturating_sub because reserve stake may be less than 2 * stake_rent, but needs more than 2 * stake_rent to be able to delegate
let reserve_lamports = reserve_lamports.saturating_sub(
Expand Down Expand Up @@ -909,6 +915,15 @@ impl StewardState {
RebalanceType::None
};

msg!("Reserve lamports after adjustment: {}", reserve_lamports);
msg!(
"Stake pool lamports after adjustment: {}",
stake_pool_lamports
);
msg!("Rebalance Type: {:?}", rebalance);
msg!("Current Lamports: {}", current_lamports);
msg!("Target Lamports: {}", target_lamports);

// Update internal state based on rebalance
match rebalance {
RebalanceType::Decrease(DecreaseComponents {
Expand Down

0 comments on commit 7fa0f34

Please sign in to comment.