Skip to content
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

fix: default comet port #23343

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/v2/cometbft/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func (c *consensus[T]) maybeHandleExternalServices(ctx context.Context, req *abc

// Handle tx service
if strings.HasPrefix(req.Path, "/cosmos.tx.v1beta1.Service") {
rpcClient, _ := client.NewClientFromNode(c.cfg.AppTomlConfig.Address)
rpcClient, _ := client.NewClientFromNode(c.cfg.ConfigTomlConfig.RPC.ListenAddress)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Handle potential errors from NewClientFromNode.

The error from NewClientFromNode is being ignored which could lead to nil pointer dereferences if the client creation fails.

Apply this diff to handle the error:

-		rpcClient, _ := client.NewClientFromNode(c.cfg.ConfigTomlConfig.RPC.ListenAddress)
+		rpcClient, err := client.NewClientFromNode(c.cfg.ConfigTomlConfig.RPC.ListenAddress)
+		if err != nil {
+			return nil, fmt.Errorf("failed to create RPC client: %w", err)
+		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rpcClient, _ := client.NewClientFromNode(c.cfg.ConfigTomlConfig.RPC.ListenAddress)
rpcClient, err := client.NewClientFromNode(c.cfg.ConfigTomlConfig.RPC.ListenAddress)
if err != nil {
return nil, fmt.Errorf("failed to create RPC client: %w", err)
}


txConfig := authtx.NewTxConfig(
c.appCodecs.AppCodec,
Expand Down
Loading