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

chore: remove grpc-web #20140

Merged
merged 6 commits into from
Apr 23, 2024
Merged

chore: remove grpc-web #20140

merged 6 commits into from
Apr 23, 2024

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Apr 22, 2024

Description

Closes: #10409, #13134

this pr removes grpc-web in favor of running it separately. This means users will need to run an envoy proxy. If accepted ill amend the documentation.

if you found this issue by searching please look into using envoy to get grpc-web working https://www.envoyproxy.io/docs/envoy/latest/start/start


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Updated CHANGELOG.md and UPGRADING.md with new proxy configurations.
  • Refactor
    • Removed embedded grpc-web proxy, transitioning to a standalone Envoy Proxy.
    • Eliminated old gRPC-web configurations and associated flags from the server setup.

Copy link
Contributor

coderabbitai bot commented Apr 22, 2024

Walkthrough

Walkthrough

The recent updates involve transitioning from an embedded grpc-web proxy to a standalone Envoy Proxy within the server module. This change necessitates adjustments in various configuration files, removing settings and flags associated with the old grpc-web server setup. Additionally, there are modifications to server initialization logic to accommodate this transition.

Changes

Files Change Summary
CHANGELOG.md, UPGRADING.md Removed embedded grpc-web proxy, transitioned to standalone Envoy Proxy.
server/api/server.go Removed grpc-web server configuration, adjusted grpc-gateway routes.
server/config/config.go, .../toml.go, .../v0.51-app.toml Removed GRPCWebConfig struct and related settings.
server/start.go, testutil/network/network.go, simapp/simd/cmd/testnet.go Removed flagGRPCWebEnable, affecting gRPC server setup and logic for grpc-web functionality.

Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between d7a54e8 and 67900f1.
Files ignored due to path filters (1)
  • go.mod is excluded by !**/*.mod
Files selected for processing (1)
  • simapp/simd/cmd/testnet.go (1 hunks)
Additional Context Used
Path-based Instructions (1)
simapp/simd/cmd/testnet.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (1)
simapp/simd/cmd/testnet.go (1)

Line range hint 1-1: Ensure that the removal of appConfig.GRPCWeb.Enable setting aligns with the new architecture using Envoy proxy.

This change should be verified to ensure that it does not unintentionally affect other parts of the application that might still rely on the GRPCWeb configuration.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

server/config/config.go Outdated Show resolved Hide resolved
@tac0turtle tac0turtle marked this pull request as ready for review April 22, 2024 14:16
@tac0turtle tac0turtle requested a review from a team as a code owner April 22, 2024 14:16
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Actionable comments outside the diff hunks (8)
UPGRADING.md (8)

Line range hint 4-4: Correct the spelling mistake in the introduction.

- This guide provides instructions for upgrading to specific versions of Cosmos SDK.
+ This guide provides instructions for upgrading to specific versions of the Cosmos SDK.

Line range hint 10-10: Fix the typographical error in "Cosmos SDK' SimApp".

- In this section we describe the changes made in Cosmos SDK' SimApp.
+ In this section, we describe the changes made in Cosmos SDK's SimApp.

Line range hint 15-15: Start the sentence with an uppercase letter for consistency.

- and address bech32 prefixes (address and validator address).
+ And address bech32 prefixes (address and validator address).

Line range hint 19-19: Add a space after the period for proper sentence separation.

- This means the address codecs and prefixes must be provided in the `client.Context` in the application client (usually `root.go`).
+ This means the address codecs and prefixes must be provided in the `client.Context` in the application client (usually `root.go`). 

Line range hint 45-45: Add a space after the period for proper sentence separation.

- It can be removed from your `app.go`.
+ It can be removed from your `app.go`. 

Line range hint 48-48: Add a space after the period for proper sentence separation.

- For depinject users, it isn't necessary anymore to supply a `map[string]module.AppModuleBasic` for customizing the app module basic instantiation.
+ For depinject users, it isn't necessary anymore to supply a `map[string]module.AppModuleBasic` for customizing the app module basic instantiation. 

Line range hint 50-50: Add a space after the period for proper sentence separation.

- For non depinject users, simply call `RegisterLegacyAminoCodec` and `RegisterInterfaces` on the module manager.
+ For non depinject users, simply call `RegisterLegacyAminoCodec` and `RegisterInterfaces` on the module manager. 

Line range hint 124-124: Correct the extra whitespace.

- Note, this is critical as it ensures the manager's state is written to file  such that when the node restarts, it can recover the state to provide replay protection.
+ Note, this is critical as it ensures the manager's state is written to file such that when the node restarts, it can recover the state to provide replay protection.

@@ -174,6 +174,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* Additionally, to reflect this change, the module manager does not take a codec either.
* (runtime) [#19747](https://github.com/cosmos/cosmos-sdk/pull/19747) `runtime.ValidatorAddressCodec` and `runtime.ConsensusAddressCodec` have been moved to `core`.
* (baseapp) [#19993](https://github.com/cosmos/cosmos-sdk/pull/19993) Indicate pruning with error code "not found" rather than "invalid request".
* (server) [#20140](https://github.com/cosmos/cosmos-sdk/pull/20140) Remove embedded grpc-web proxy in favor of standalone grpc-web proxy. [Envoy Proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start)
Copy link
Contributor

Choose a reason for hiding this comment

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

Adjust the indentation to maintain consistency with other list items.

- * (server) [#20140](https://github.com/cosmos/cosmos-sdk/pull/20140) Remove embedded grpc-web proxy in favor of standalone grpc-web proxy. [Envoy Proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start)
+ * (server) [#20140](https://github.com/cosmos/cosmos-sdk/pull/20140) Removed the embedded grpc-web proxy in favor of a standalone grpc-web proxy using [Envoy Proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start).

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.

Suggested change
* (server) [#20140](https://github.com/cosmos/cosmos-sdk/pull/20140) Remove embedded grpc-web proxy in favor of standalone grpc-web proxy. [Envoy Proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start)
* (server) [#20140](https://github.com/cosmos/cosmos-sdk/pull/20140) Removed the embedded grpc-web proxy in favor of a standalone grpc-web proxy using [Envoy Proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start).

@@ -61,6 +61,10 @@ For non depinject users, simply call `RegisterLegacyAminoCodec` and `RegisterInt

Additionally, thanks to the genesis simplification, as explained in [the genesis interface update](#genesis-interface), the module manager `InitGenesis` and `ExportGenesis` methods do not require the codec anymore.

##### GRPC-WEB

Grpc-web embedded client has been removed from the server. If you would like to use grpc-web, you can use the [envoy proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start).
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the spelling of "Grpc-web" to maintain consistency and professionalism in documentation.

- Grpc-web embedded client has been removed from the server.
+ GRPC-Web embedded client has been removed from the server.

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.

Suggested change
Grpc-web embedded client has been removed from the server. If you would like to use grpc-web, you can use the [envoy proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start).
GRPC-Web embedded client has been removed from the server. If you would like to use grpc-web, you can use the [envoy proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start).

@julienrbrt
Copy link
Member

I am not super familiar with grpc-web, but is the change for clients seamless (from our grpc-web impl to envoy?): https://github.com/search?q=org%3Acosmology-tech+grpc-web&type=code?

@tac0turtle
Copy link
Member Author

I am not super familiar with grpc-web, but is the change for clients seamless (from our grpc-web impl to envoy?): https://github.com/search?q=org%3Acosmology-tech+grpc-web&type=code?

there is a js client they can use that will work the same

@ipangpang
Copy link
Contributor

I looked at grpc-web yesterday and have been contemplating how to completely phase it out.

Based on my current understanding, to ensure consistency with the previous functionality, we need to make efforts in the following areas:

  • Determine if supporting grpc is necessary.
  • Determine if supporting websocket is necessary.

Based on the configuration from config.DefaultConfig(), it seems that both are currently required.

@github-actions github-actions bot added the C:Confix Issues and PR related to Confix label Apr 22, 2024
@tac0turtle
Copy link
Member Author

  • Determine if supporting grpc is necessary.
  • Determine if supporting websocket is necessary.

Hey thanks for the comment. Im not sure if you are part of a team, but mentioned in the issue description you can get grpc-web from the envoy proxy. Also grpc is necessary as its how the whole system works.

Copy link
Collaborator

@hieuvubk hieuvubk left a comment

Choose a reason for hiding this comment

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

LGTM

@julienrbrt julienrbrt added this pull request to the merge queue Apr 23, 2024
Merged via the queue into main with commit 8e60f3b Apr 23, 2024
80 checks passed
@julienrbrt julienrbrt deleted the marko/10409 branch April 23, 2024 06:51
ipangpang pushed a commit to ipangpang/cosmos-sdk that referenced this pull request Apr 24, 2024
meetrick pushed a commit to meetrick/cosmos-sdk that referenced this pull request Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove go.mod replace line for gin-gonic/gin
5 participants