diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 3fbf5173e7e3..00163412d93f 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -174,11 +174,6 @@ func (c *consensus[T]) Info(ctx context.Context, _ *abciproto.InfoRequest) (*abc // Query implements types.Application. // It is called by cometbft to query application state. func (c *consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) (resp *abciproto.QueryResponse, err error) { - resp, isGRPC, err := c.maybeRunGRPCQuery(ctx, req) - if isGRPC { - return resp, err - } - // when a client did not provide a query height, manually inject the latest // for modules queries, AppManager does it automatically if req.Height == 0 { @@ -189,6 +184,11 @@ func (c *consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) ( req.Height = int64(latestVersion) } + resp, isGRPC, err := c.maybeRunGRPCQuery(ctx, req) + if isGRPC { + return resp, err + } + // this error most probably means that we can't handle it with a proto message, so // it must be an app/p2p/store query path := splitABCIQueryPath(req.Path)