From e860ec5d60cb919c822cdbdec11eafabc3b9e7a8 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Wed, 27 Sep 2023 18:24:51 +0200 Subject: [PATCH 1/2] remove gov vote and proposal based telemetry --- x/gov/keeper/msg_server.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index cdc48a830398..bd624b61fc7d 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -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" @@ -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 @@ -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 } @@ -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 } @@ -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( From a485ccdcd5688d7410c57b8283e4d57fb30f1869 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Wed, 27 Sep 2023 20:17:09 +0200 Subject: [PATCH 2/2] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a805200b890..c39dbc5ee2d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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