Skip to content

Commit

Permalink
refactor(x/gov): remove gov vote and proposal based telemetry (#17910)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Sep 27, 2023
1 parent 1be29b7 commit 5e53fb2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Client Breaking Changes

* (x/distribution) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) Deprecate `CommunityPool` and `FundCommunityPool` rpc methods. Use x/protocolpool module's rpc methods instead.
* (x/gov) [#17910](https://github.com/cosmos/cosmos-sdk/pull/17910) remove telemetry for counting votes and proposals

## [v0.50.0-rc.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-rc.1) - 2023-09-25

Expand Down
30 changes: 0 additions & 30 deletions x/gov/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import (
"context"
"encoding/json"
"fmt"
"strconv"

"github.com/hashicorp/go-metrics"

"cosmossdk.io/errors"
"cosmossdk.io/math"

"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
Expand Down Expand Up @@ -99,8 +95,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos
"submit proposal",
)

defer telemetry.IncrCounter(1, govtypes.ModuleName, "proposal")

votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.Id, proposer, msg.GetInitialDeposit())
if err != nil {
return nil, err
Expand Down Expand Up @@ -192,14 +186,6 @@ func (k msgServer) Vote(ctx context.Context, msg *v1.MsgVote) (*v1.MsgVoteRespon
return nil, err
}

defer telemetry.IncrCounterWithLabels(
[]string{govtypes.ModuleName, "vote"},
1,
[]metrics.Label{
telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)),
},
)

return &v1.MsgVoteResponse{}, nil
}

Expand Down Expand Up @@ -244,14 +230,6 @@ func (k msgServer) VoteWeighted(ctx context.Context, msg *v1.MsgVoteWeighted) (*
return nil, err
}

defer telemetry.IncrCounterWithLabels(
[]string{govtypes.ModuleName, "vote"},
1,
[]metrics.Label{
telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)),
},
)

return &v1.MsgVoteWeightedResponse{}, nil
}

Expand All @@ -272,14 +250,6 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1.MsgDeposit) (*v1.MsgDe
return nil, err
}

defer telemetry.IncrCounterWithLabels(
[]string{govtypes.ModuleName, "deposit"},
1,
[]metrics.Label{
telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)),
},
)

if votingStarted {
ctx.EventManager().EmitEvent(
sdk.NewEvent(
Expand Down

0 comments on commit 5e53fb2

Please sign in to comment.