diff --git a/internal/services/delegation.go b/internal/services/delegation.go index 0800dd9..49bfcea 100644 --- a/internal/services/delegation.go +++ b/internal/services/delegation.go @@ -284,7 +284,7 @@ func (s *Service) processBTCDelegationUnbondedEarlyEvent( ) } - log.Info(). + log.Debug(). Str("staking_tx", unbondedEarlyEvent.StakingTxHash). Str("new_state", types.StateUnbonding.String()). Str("early_unbonding_start_height", unbondedEarlyEvent.StartHeight). diff --git a/internal/services/delegation_helpers.go b/internal/services/delegation_helpers.go index a45b305..1619197 100644 --- a/internal/services/delegation_helpers.go +++ b/internal/services/delegation_helpers.go @@ -37,7 +37,7 @@ func (s *Service) registerUnbondingSpendNotification( ) } - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("unbonding_tx", unbondingTx.TxHash().String()). Msg("registering early unbonding spend notification") @@ -88,7 +88,7 @@ func (s *Service) registerStakingSpendNotification( ) } - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Msg("registering staking spend notification") diff --git a/internal/services/expiry_checker.go b/internal/services/expiry_checker.go index 0b06333..c81c49f 100644 --- a/internal/services/expiry_checker.go +++ b/internal/services/expiry_checker.go @@ -44,7 +44,7 @@ func (s *Service) checkExpiry(ctx context.Context) *types.Error { ) } - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("current_state", delegation.State.String()). Msg("checking if delegation is expired") diff --git a/internal/services/watch_btc_events.go b/internal/services/watch_btc_events.go index 2ef02c4..85ab354 100644 --- a/internal/services/watch_btc_events.go +++ b/internal/services/watch_btc_events.go @@ -30,7 +30,7 @@ func (s *Service) watchForSpendStakingTx( // Get spending details select { case spendDetail := <-spendEvent.Spend: - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("spending_tx", spendDetail.SpendingTx.TxHash().String()). Msg("staking tx has been spent") @@ -68,7 +68,7 @@ func (s *Service) watchForSpendUnbondingTx( // Get spending details select { case spendDetail := <-spendEvent.Spend: - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("unbonding_tx", spendDetail.SpendingTx.TxHash().String()). Msg("unbonding tx has been spent") @@ -105,7 +105,7 @@ func (s *Service) watchForSpendSlashingChange( select { case spendDetail := <-spendEvent.Spend: - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("spending_tx", spendDetail.SpendingTx.TxHash().String()). Msg("slashing change output has been spent") @@ -170,7 +170,7 @@ func (s *Service) handleSpendingStakingTransaction( return fmt.Errorf("failed to validate unbonding tx: %w", err) } if isUnbonding { - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("unbonding_tx", spendingTx.TxHash().String()). Msg("staking tx has been spent through unbonding path") @@ -182,7 +182,7 @@ func (s *Service) handleSpendingStakingTransaction( withdrawalErr := s.validateWithdrawalTxFromStaking(spendingTx, spendingInputIdx, delegation, params) if withdrawalErr == nil { // It's a valid withdrawal, process it - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("withdrawal_tx", spendingTx.TxHash().String()). Msg("staking tx has been spent through withdrawal path") @@ -229,7 +229,7 @@ func (s *Service) handleSpendingUnbondingTransaction( withdrawalErr := s.validateWithdrawalTxFromUnbonding(spendingTx, delegation, spendingInputIdx, params) if withdrawalErr == nil { // It's a valid withdrawal, process it - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("unbonding_tx", spendingTx.TxHash().String()). Msg("unbonding tx has been spent through withdrawal path") @@ -280,7 +280,7 @@ func (s *Service) handleWithdrawal( } // Update to withdrawn state - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("state", types.StateWithdrawn.String()). Str("sub_state", subState.String()). @@ -301,7 +301,7 @@ func (s *Service) startWatchingSlashingChange( delegation *model.BTCDelegationDetails, subState types.DelegationSubState, ) error { - log.Info(). + log.Debug(). Str("staking_tx", delegation.StakingTxHashHex). Str("slashing_tx", slashingTx.TxHash().String()). Msg("watching for slashing change output") diff --git a/internal/types/state.go b/internal/types/state.go index 417c43c..bd61c82 100644 --- a/internal/types/state.go +++ b/internal/types/state.go @@ -66,8 +66,10 @@ func QualifiedStatesForWithdrawable() []DelegationState { type DelegationSubState string const ( - SubStateTimelock DelegationSubState = "TIMELOCK" - SubStateEarlyUnbonding DelegationSubState = "EARLY_UNBONDING" + SubStateTimelock DelegationSubState = "TIMELOCK" + SubStateEarlyUnbonding DelegationSubState = "EARLY_UNBONDING" + + // Used only for Withdrawable and Withdrawn parent states SubStateTimelockSlashing DelegationSubState = "TIMELOCK_SLASHING" SubStateEarlyUnbondingSlashing DelegationSubState = "EARLY_UNBONDING_SLASHING" )