Skip to content

Commit

Permalink
rename some sluggish to jailed
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Sep 11, 2024
1 parent fe7bac6 commit 5b46ebb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion proto/babylon/finality/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ message Params {
// vote before being judged as missing their voting turn on the given block
int64 finality_sig_timeout = 2;
// min_signed_per_window defines the minimum number of blocks that a finality provider is required to sign
// within the sliding window to avoid being detected as sluggish
// within the sliding window to avoid being jailed
bytes min_signed_per_window = 3 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
Expand Down
4 changes: 2 additions & 2 deletions x/finality/keeper/liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// HandleLiveness handles liveness of each active finality provider for a given height
// including identifying sluggish finality providers and applying punishment (TBD)
// including jailing sluggish finality providers and applying punishment (TBD)
func (k Keeper) HandleLiveness(ctx context.Context, height int64) {
// get all the active finality providers for the height
fpSet := k.BTCStakingKeeper.GetVotingPowerTable(ctx, uint64(height))
Expand Down Expand Up @@ -196,7 +196,7 @@ func (k Keeper) jailSluggishFinalityProvider(ctx context.Context, fpBtcPk *types
return fmt.Errorf("failed to emit sluggish finality provider detected event: %w", err)
}

finalitytypes.IncrementSluggishFinalityProviderCounter()
finalitytypes.IncrementJailedFinalityProviderCounter()

return nil
}
18 changes: 9 additions & 9 deletions x/finality/types/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const (

/* Metrics for monitoring finality provider liveness */

// MetricsKeySluggishFinalityProviderCounter is the number of finality providers
// that are being labeled as sluggish
MetricsKeySluggishFinalityProviderCounter = "sluggish_finality_provider_counter"
// MetricsKeyJailedFinalityProviderCounter is the number of finality providers
// that are being labeled as jailed
MetricsKeyJailedFinalityProviderCounter = "jailed_finality_provider_counter"
)

// RecordLastHeight records the last height. It is triggered upon `IndexBlock`
Expand All @@ -51,10 +51,10 @@ func RecordLastFinalizedHeight(height uint64) {
)
}

// IncrementSluggishFinalityProviderCounter increments the counter for the sluggish
// IncrementJailedFinalityProviderCounter increments the counter for the jailed
// finality providers
func IncrementSluggishFinalityProviderCounter() {
keys := []string{MetricsKeySluggishFinalityProviderCounter}
func IncrementJailedFinalityProviderCounter() {
keys := []string{MetricsKeyJailedFinalityProviderCounter}
labels := []metrics.Label{telemetry.NewLabel(telemetry.MetricLabelNameModule, ModuleName)}
telemetry.IncrCounterWithLabels(
keys,
Expand All @@ -63,10 +63,10 @@ func IncrementSluggishFinalityProviderCounter() {
)
}

// DecrementSluggishFinalityProviderCounter increments the counter for the sluggish
// DecrementJailedFinalityProviderCounter decrements the counter for the jailed
// finality providers
func DecrementSluggishFinalityProviderCounter() {
keys := []string{MetricsKeySluggishFinalityProviderCounter}
func DecrementJailedFinalityProviderCounter() {
keys := []string{MetricsKeyJailedFinalityProviderCounter}
labels := []metrics.Label{telemetry.NewLabel(telemetry.MetricLabelNameModule, ModuleName)}
telemetry.IncrCounterWithLabels(
keys,
Expand Down

0 comments on commit 5b46ebb

Please sign in to comment.