Skip to content

Commit

Permalink
fix: avoid broadcasting tx through query (#15044)
Browse files Browse the repository at this point in the history
(cherry picked from commit c884e27)
  • Loading branch information
facundomedica authored and mergify[bot] committed Feb 16, 2023
1 parent 2e80d3b commit dd19da3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
telemetry.IncrCounter(1, "query", req.Path)
defer telemetry.MeasureSince(time.Now(), req.Path)

if req.Path == "/cosmos.tx.v1beta1.Service/BroadcastTx" {
return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace)
}

// handle gRPC routes first rather than calling splitPath because '/' characters
// are used as part of gRPC paths
if grpcHandler := app.grpcQueryRouter.Route(req.Path); grpcHandler != nil {
Expand Down

0 comments on commit dd19da3

Please sign in to comment.