diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 33f931edd0..cbcf387168 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -250,12 +250,13 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq return nil, false, err } + path := strings.TrimPrefix(req.Path, "/") + pathFullName := protoreflect.FullName(strings.ReplaceAll(path, "/", ".")) + // in order to check if it's a gRPC query we ensure that there's a descriptor // for the path, if such descriptor exists, and it is a method descriptor // then we assume this is a gRPC query. - fullName := protoreflect.FullName(strings.ReplaceAll(req.Path, "/", ".")) - - desc, err := registry.FindDescriptorByName(fullName) + desc, err := registry.FindDescriptorByName(pathFullName) if err != nil { return nil, false, err } @@ -267,7 +268,7 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq handler, found := c.queryHandlersMap[string(md.Input().FullName())] if !found { - return nil, true, fmt.Errorf("no query handler found for %s", fullName) + return nil, true, fmt.Errorf("no query handler found for %s", req.Path) } protoRequest := handler.MakeMsg() err = gogoproto.Unmarshal(req.Data, protoRequest) // TODO: use codec diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index e4a16513d2..7b0e5d5000 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -21,7 +21,7 @@ require ( cosmossdk.io/core v1.0.0-alpha.4 cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 cosmossdk.io/log v1.4.1 - cosmossdk.io/server/v2 v2.0.0-20241003101412-c5889a418ae2 // main + cosmossdk.io/server/v2 v2.0.0-20241003112707-72f771638528 // main cosmossdk.io/server/v2/appmanager v0.0.0-20241003101412-c5889a418ae2 // main cosmossdk.io/server/v2/stf v0.0.0-20241003101412-c5889a418ae2 // main cosmossdk.io/store/v2 v2.0.0-20240916221850-7856d226038c // main diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 712dcc2423..fee0040b5c 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -24,8 +24,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/server/v2 v2.0.0-20241003101412-c5889a418ae2 h1:Q5J+36LlGK3c3xtl/k8/LeLgtpPwx9L2lFbhSRYYGPg= -cosmossdk.io/server/v2 v2.0.0-20241003101412-c5889a418ae2/go.mod h1:zXQpdRRGLQjq17VxHiieHjA0xcU2ydgjR82XOgA6Cdc= +cosmossdk.io/server/v2 v2.0.0-20241003112707-72f771638528 h1:6Ht6Yg36nsbtOjdxj+fvUk5o35Nkg9vA9WQC+oNs+sI= +cosmossdk.io/server/v2 v2.0.0-20241003112707-72f771638528/go.mod h1:zXQpdRRGLQjq17VxHiieHjA0xcU2ydgjR82XOgA6Cdc= cosmossdk.io/server/v2/appmanager v0.0.0-20241003101412-c5889a418ae2 h1:8GOXwsEQbRtpQ/bzUEly4FCOqhBhgxFFDzBGkrPjBUs= cosmossdk.io/server/v2/appmanager v0.0.0-20241003101412-c5889a418ae2/go.mod h1:/xDfniqVtn5nraiHkNJ4e6rYU0e83YAGsSjwmUA6H8k= cosmossdk.io/server/v2/stf v0.0.0-20241003101412-c5889a418ae2 h1:G1kMEqy4OAO/BZD9ZJa2rVVxsYSPHzKrictiOAGPuoY= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 24362d95d0..00827394c8 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -11,7 +11,7 @@ require ( cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/runtime/v2 v2.0.0-20241003101412-c5889a418ae2 // main - cosmossdk.io/server/v2 v2.0.0-20241003101412-c5889a418ae2 // main + cosmossdk.io/server/v2 v2.0.0-20241003112707-72f771638528 // main cosmossdk.io/server/v2/cometbft v0.0.0-00010101000000-000000000000 cosmossdk.io/store/v2 v2.0.0-20240916221850-7856d226038c // main cosmossdk.io/tools/confix v0.0.0-00010101000000-000000000000 diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 124c34d073..840d32f91b 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -214,8 +214,8 @@ cosmossdk.io/runtime/v2 v2.0.0-20241003101412-c5889a418ae2 h1:/KMBWc+mflXNv6HOka cosmossdk.io/runtime/v2 v2.0.0-20241003101412-c5889a418ae2/go.mod h1:o9I/8aO/VF6RQU1OdaAE3sMhBD10vl2GEnSrYOLwYVk= cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/server/v2 v2.0.0-20241003101412-c5889a418ae2 h1:Q5J+36LlGK3c3xtl/k8/LeLgtpPwx9L2lFbhSRYYGPg= -cosmossdk.io/server/v2 v2.0.0-20241003101412-c5889a418ae2/go.mod h1:zXQpdRRGLQjq17VxHiieHjA0xcU2ydgjR82XOgA6Cdc= +cosmossdk.io/server/v2 v2.0.0-20241003112707-72f771638528 h1:6Ht6Yg36nsbtOjdxj+fvUk5o35Nkg9vA9WQC+oNs+sI= +cosmossdk.io/server/v2 v2.0.0-20241003112707-72f771638528/go.mod h1:zXQpdRRGLQjq17VxHiieHjA0xcU2ydgjR82XOgA6Cdc= cosmossdk.io/server/v2/appmanager v0.0.0-20241003101412-c5889a418ae2 h1:8GOXwsEQbRtpQ/bzUEly4FCOqhBhgxFFDzBGkrPjBUs= cosmossdk.io/server/v2/appmanager v0.0.0-20241003101412-c5889a418ae2/go.mod h1:/xDfniqVtn5nraiHkNJ4e6rYU0e83YAGsSjwmUA6H8k= cosmossdk.io/server/v2/stf v0.0.0-20241003101412-c5889a418ae2 h1:G1kMEqy4OAO/BZD9ZJa2rVVxsYSPHzKrictiOAGPuoY=