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

remove old provwasm bindings #2119

Merged
merged 5 commits into from
Aug 16, 2024
Merged

Conversation

kwtalley
Copy link
Contributor

@kwtalley kwtalley commented Aug 9, 2024

Description

This PR removes the old pre 2.0 ProvWasm custom bindings. These older bindings provided the initial wasm support, however, they were very limited in functionality and mostly are inoperable at this time.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Summary by CodeRabbit

  • New Features

    • Introduced a "Client Breaking" section in the changelog detailing significant changes to the client interface.
    • Streamlined integration with CosmWasm by simplifying the instantiation of WasmKeeper.
  • Bug Fixes

    • Removed outdated provwasm bindings affecting user implementations.
  • Refactor

    • Simplified the QueryPlugins function by eliminating the registry parameter for a more standardized querying mechanism.

@kwtalley kwtalley added the wasm label Aug 9, 2024
@kwtalley kwtalley self-assigned this Aug 9, 2024
@kwtalley kwtalley requested a review from a team as a code owner August 9, 2024 19:09
Copy link
Contributor

coderabbitai bot commented Aug 9, 2024

Walkthrough

The recent changes streamline the application's interaction with CosmWasm by removing outdated provwasm bindings and simplifying function signatures. Notably, the removal of deprecated bindings represents a significant breaking change, necessitating user adaptations. Additionally, updates to query handling promote a more standardized approach, enhancing efficiency and reducing complexity throughout the codebase.

Changes

Files Change Summary
CHANGELOG.md Introduced "Client Breaking" section detailing the removal of old provwasm bindings, indicating a major change in the client interface.
app/app.go Eliminated CosmWasm encoder and querier registrations, streamlining the instantiation of WasmKeeper and simplifying management of encoders and queriers.
internal/provwasm/query_plugins.go Revised QueryPlugins function by removing the registry parameter, simplifying the signature and eliminating custom plugin functionality, leading to a more standardized querying mechanism.

Poem

In a meadow bright and fair,
Changes flutter through the air.
With fewer bindings, oh so neat,
Queries dance on nimble feet.
A hop, a jump, to new delight,
Streamlined paths gleam in the light! 🐇✨


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

CodeRabbit Configuration 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.

@kwtalley kwtalley force-pushed the kwtalley/remove-deprecated-bindings branch from f9bb3cb to 80b08a5 Compare August 9, 2024 19:17
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 50dc3d8 and 80b08a5.

Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • app/app.go (4 hunks)
  • internal/provwasm/query_plugins.go (3 hunks)
Additional comments not posted (5)
internal/provwasm/query_plugins.go (3)

Line range hint 58-75:
No changes to StargateQuerier.

The function remains unchanged and appears to handle queries correctly with appropriate error handling. No issues found.


Line range hint 77-94:
No changes to GrpcQuerier.

The function remains unchanged and appears to handle queries correctly with appropriate error handling. No issues found.


Line range hint 48-56:
Simplification of QueryPlugins function.

The removal of the registry parameter simplifies the function signature, focusing on standardized querying mechanisms. However, this change might impact any existing functionality that relied on custom queriers. Ensure that this change aligns with the overall architectural goals and does not inadvertently remove necessary functionality.

app/app.go (1)

651-651: Simplification of WasmKeeper initialization.

The removal of encoderRegistry and querierRegistry simplifies the instantiation of WasmKeeper. This change suggests a shift in managing encoders and queriers, potentially impacting how the application interacts with CosmWasm features. Verify that this aligns with the intended architectural changes and does not affect required functionalities.

Verification successful

Simplification of WasmKeeper initialization verified.

The removal of encoderRegistry and querierRegistry does not adversely affect the current usage of WasmKeeper in the codebase. The initialization and interactions with WasmKeeper remain consistent with the intended architectural changes. No issues found with the simplification.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `encoderRegistry` and `querierRegistry` in `WasmKeeper` initialization.

# Test: Search for any usage of `WasmKeeper` initialization in the codebase to ensure compatibility.
rg --type go -A 5 $'WasmKeeper'

Length of output: 5473

CHANGELOG.md (1)

41-43: Changelog entry looks good.

The entry for the removal of old provwasm bindings is clear and follows the standard format for documenting breaking changes. It includes a link to the related pull request for additional context.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 80b08a5 and 74d530e.

Files selected for processing (1)
  • internal/provwasm/query_plugins.go (3 hunks)
Additional comments not posted (4)
internal/provwasm/query_plugins.go (4)

Line range hint 56-75:
LGTM! Effective handling of Stargate queries.

The function effectively dispatches whitelisted Stargate queries and handles errors. The conversion to JSON is beneficial for client-side processing.


Line range hint 77-95:
LGTM! Efficient handling of gRPC queries.

The function efficiently dispatches whitelisted gRPC queries and manages errors. It ensures only authorized queries are processed.


Line range hint 97-112:
LGTM! Robust conversion from proto to JSON.

The function effectively converts proto messages to JSON, ensuring data integrity and facilitating client-side processing. The use of protoResponseType.Reset() is a good practice.


Line range hint 45-54:
Verify impact of removing the registry parameter.

The removal of the registry parameter and custom plugins simplifies the function. Ensure that this change does not negatively impact other parts of the codebase that might rely on custom query handling.

iramiller
iramiller previously approved these changes Aug 14, 2024
Taztingo
Taztingo previously approved these changes Aug 14, 2024
@kwtalley kwtalley dismissed stale reviews from Taztingo and iramiller via 684ceab August 15, 2024 19:24
@kwtalley kwtalley force-pushed the kwtalley/remove-deprecated-bindings branch from 74d530e to 684ceab Compare August 15, 2024 19:24
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 74d530e and 684ceab.

Files selected for processing (3)
  • .changelog/unreleased/client-breaking/2119-remove-deprecated-bindings.md (1 hunks)
  • app/app.go (4 hunks)
  • internal/provwasm/query_plugins.go (3 hunks)
Files skipped from review due to trivial changes (1)
  • .changelog/unreleased/client-breaking/2119-remove-deprecated-bindings.md
Files skipped from review as they are similar to previous changes (1)
  • app/app.go
Additional comments not posted (1)
internal/provwasm/query_plugins.go (1)

Line range hint 45-54:
Simplification of QueryPlugins function.

The removal of the registry parameter simplifies the function signature and aligns with the goal of standardizing query handling. However, this change reduces flexibility by removing support for custom queries. Ensure that all necessary custom queries are accommodated elsewhere or are no longer needed.

Verification successful

Simplification of QueryPlugins function is verified.

The removal of the registry parameter and the customPlugins function in QueryPlugins does not affect any dependencies related to custom query handling. The function is used in app/app.go with wasmkeeper.WithQueryPlugins, and no other dependencies were found. This change aligns with the goal of simplifying and standardizing query handling.

  • app/app.go: Usage with wasmkeeper.WithQueryPlugins.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing custom query handling.

# Test: Search for the usage of the `QueryPlugins` function. Expect: No dependencies on custom query handling.
rg --type go -A 5 $'QueryPlugins'

Length of output: 1258

@SpicyLemon SpicyLemon merged commit 59a696c into main Aug 16, 2024
33 checks passed
@SpicyLemon SpicyLemon deleted the kwtalley/remove-deprecated-bindings branch August 16, 2024 15:43
@SpicyLemon SpicyLemon added this to the v1.19.0 milestone Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

4 participants