Skip to content

Commit

Permalink
fix: avoid broadcasting tx through query (cosmos#15044) (#418)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5b0f9cf)
  • Loading branch information
p0mvn authored and mergify[bot] committed Feb 22, 2023
1 parent 0907b75 commit 2183414
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 @@ -395,6 +395,10 @@ func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
req.Height = app.LastBlockHeight()
}

if req.Path == "/cosmos.tx.v1beta1.Service/BroadcastTx" {
return sdkerrors.QueryResultWithDebug(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 2183414

Please sign in to comment.