Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(x/gov): remove gov vote and proposal based telemetry (backport #17910) #17916

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (baseapp) [#17769](https://github.com/cosmos/cosmos-sdk/pull/17769) Ensure we respect block size constraints in the `DefaultProposalHandler`'s `PrepareProposal` handler when a nil or no-op mempool is used. We provide a `TxSelector` type to assist in making transaction selection generalized. We also fix a comparison bug in tx selection when `req.maxTxBytes` is reached.
* (config) [#17649](https://github.com/cosmos/cosmos-sdk/pull/17649) Fix `mempool.max-txs` configuration is invalid in `app.config`.
* (mempool) [#17668](https://github.com/cosmos/cosmos-sdk/pull/17668) Fix `PriorityNonceIterator.Next()` nil pointer ref for min priority at the end of iteration.
* (x/auth) [#17902](https://github.com/cosmos/cosmos-sdk/pull/17902) Remove tip posthandler
* (x/auth) [#17902](https://github.com/cosmos/cosmos-sdk/pull/17902) Remove tip posthandler.

### Client Breaking Changes

* (x/gov) [#17910](https://github.com/cosmos/cosmos-sdk/pull/17910) Remove telemetry for counting votes and proposals. It was incorrectly counting votes. Use alternatives, such as state streaming.

## [v0.47.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.5) - 2023-09-01

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 @@ -3,12 +3,8 @@ package keeper
import (
"context"
"fmt"
"strconv"

"cosmossdk.io/errors"
"github.com/armon/go-metrics"

"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
Expand Down Expand Up @@ -63,8 +59,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 @@ -122,14 +116,6 @@ func (k msgServer) Vote(goCtx context.Context, msg *v1.MsgVote) (*v1.MsgVoteResp
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 All @@ -145,14 +131,6 @@ func (k msgServer) VoteWeighted(goCtx 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 @@ -168,14 +146,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
Loading