-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
change(serverv2/comet): use codec to parse gRPC requests #21105
Labels
C:server/v2
Issues related to server/v2
Comments
testinginprod
changed the title
change(serverv2/comet): use
change(serverv2/comet): use codec to parse gRPC requests
Jul 29, 2024
tac0turtle
added
C:server/v2
Issues related to server/v2
C:server/v2
and removed
needs-triage
Issue that needs to be triaged
C:server/v2
labels
Jul 30, 2024
I had a look at the PR that had the v2/server change (#21038) and wanted to ask if this would require re-adding the |
Hi @tac0turtle I had a look at gogoproto and wanted to check if using a codec would mean a change like: diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go
index b7a300b05f..c105a4f57b 100644
--- a/server/v2/cometbft/abci.go
+++ b/server/v2/cometbft/abci.go
@@ -10,6 +10,7 @@ import (
abci "github.com/cometbft/cometbft/abci/types"
abciproto "github.com/cometbft/cometbft/api/cometbft/abci/v1"
gogoproto "github.com/cosmos/gogoproto/proto"
+ gogocodec "github.com/cosmos/gogoproto/codec"
coreappmgr "cosmossdk.io/core/app"
"cosmossdk.io/core/comet"
@@ -192,7 +193,7 @@ func (c *Consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) (
makeGRPCRequest, isGRPC := c.grpcMethodsMap[req.Path]
if isGRPC {
protoRequest := makeGRPCRequest()
- err = gogoproto.Unmarshal(req.Data, protoRequest) // TODO: use codec
+ err = gogocodec.New(len(req.Data)).Unmarshal(req.Data, protoRequest)
if err != nil {
return nil, fmt.Errorf("unable to decode gRPC request with path %s from ABCI.Query: %w", req.Path, err)
} |
@testinginprod is this still needed? |
12 tasks
github-project-automation
bot
moved this from 👀 Waiting / In review
to 🥳 Done
in Cosmos-SDK
Nov 20, 2024
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We need to pass codec to comet to properly decode gRPC requests.
Originally posted by @tac0turtle in #21038 (comment)
The text was updated successfully, but these errors were encountered: