Skip to content

no wasm in good cosmos chains#1

Open
faddat wants to merge 4 commits intomainfrom
faddat/remove-ibc-fee-wasm
Open

no wasm in good cosmos chains#1
faddat wants to merge 4 commits intomainfrom
faddat/remove-ibc-fee-wasm

Conversation

@faddat
Copy link

@faddat faddat commented Apr 1, 2025

  • since cosmwasm is an utter hell show, this removes it
  • remove capability keeper and other unused code
  • just a few more removals and the addition of ica before testnet
  • tidy and lint

Summary by CodeRabbit

  • Refactor

    • Removed legacy modules and integrations related to NFTs, oracles, rate limiting, and smart contract functionality to streamline core operations.
    • Simplified application configuration and initialization flows for improved maintainability.
  • Chores

    • Upgraded numerous dependencies—including core frameworks and tools—to the latest versions, enhancing overall performance and compatibility.
    • Revised configuration templates and genesis settings to remove obsolete sections, ensuring a cleaner deployment experience.

@coderabbitai
Copy link

coderabbitai bot commented Apr 1, 2025

Walkthrough

This update upgrades the IBC module from v8 to v10 and removes several dependencies and features. Specifically, references to NFT, Oracle, IBC Fee, Rate Limit, Capability, and CosmWasm integrations have been removed from the application code and configuration. The configuration system has been refactored with new initialization functions, and the genesis configuration has been simplified by deleting NFT and oracle sections. Additionally, various Go dependencies have been updated and unused parameters and functions eliminated to streamline the codebase.

Changes

File(s) Change Summary
app/ante.go, app/test_support.go Updated IBC imports from v8 to v10; modified import paths to reflect dependency upgrades.
app/app.go Removed keeper fields for NFT, Oracle, IBC Fee, Rate Limit, and Capability; updated method signatures (removed WASM options) and added initializeABCIExtensions.
app/encoding.go Removed wasmkeeper import and deleted corresponding options during app instantiation.
app/genesis.go, app/oracle.go Removed Oracle module functionality including genesis state generation; deleted the entire oracle file.
app/test_helpers.go Updated function calls by removing WasmOpts parameters and eliminated unused variables.
cmd/horsed/cmd/commands.go Removed wasmcli and wasmkeeper imports and eliminated WASM-related options from command initialization functions.
cmd/horsed/cmd/config.go, cmd/horsed/cmd/root.go Removed configurations related to CometBFT and Oracle; introduced new AppConfig type and initialization functions (initAppConfig and initCometBFTConfig).
go.mod Upgraded Go toolchain and various dependencies, including IBC (v8 → v10), CometBFT, Cosmos SDK, and others; removed dependency on cosmossdk.io/x/nft.
networks/horse/genesis.json, networks/horse/genesis.narwhal.json Deleted NFT and Oracle configuration sections to reflect the removal of these modules.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant RootCmd
    participant Config
    participant App
    User->>RootCmd: Execute command
    RootCmd->>Config: initAppConfig() / NewDefaultConfig()
    RootCmd->>Config: initCometBFTConfig()
    RootCmd->>App: Instantiate application (without WASM options)
    App->>App: Set up ante handler & call initializeABCIExtensions()
Loading

Poem

I’m a bunny coding in the night,
Hopping through changes, feeling light.
Modules trimmed like tufts of fur,
Configs refreshed with a joyful purr.
I nibble code with carrot delight,
Hooray for clean commits so bright!
🥕🐇 Happy hops to a code base just right!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Copy link

@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: 1

🔭 Outside diff range comments (1)
app/ante.go (1)

9-10: 💡 Verification agent

🧩 Analysis chain

Inconsistent CosmWasm removal.

While the PR objective is to remove CosmWasm ("no wasm in good cosmos chains"), there are still references to wasmkeeper and wasmTypes in this file, including in the HandlerOptions struct and the ante handler decorators. This suggests that the CosmWasm removal might not be complete.

Also applies to: 22-24, 64-67


🏁 Script executed:

#!/bin/bash
# Check if there are other files still referencing wasmkeeper or related imports
echo "Checking for other files referencing wasmkeeper..."
rg --type go "wasmkeeper|wasmTypes|wasmConfig" -A 3 -B 3

Length of output: 4400


Critical: Incomplete CosmWasm Removal

The PR’s objective is to eliminate CosmWasm integration entirely, yet multiple files still reference it. In particular, in app/ante.go the imports for wasmkeeper and wasmTypes (lines 9–10) continue to be used in the HandlerOptions struct and in the ante decorators. Additionally, our search shows that similar references exist in:

  • app/queries/queries.go: Usage of wasmkeeper persists in the registration of custom query plugins.
  • app/test_helpers.go: References to wasmkeeper remain during the test application setup.

Please update the PR to remove all CosmWasm dependencies (including related structs, functions, and decorators) across these files. This will fully align the changes with the objective of “no wasm in good cosmos chains.”

🧰 Tools
🪛 golangci-lint (1.64.8)

9-9: could not import github.com/CosmWasm/wasmd/x/wasm/keeper (-: # github.com/CosmWasm/wasmd/x/wasm/keeper
/tmp/go/.go-mod-cache/github.com/!cosm!wasm/wasmd@v0.53.0/x/wasm/keeper/test_common.go:386:3: cannot use runtime.NewKVStoreService(keys[types.StoreKey]) (value of interface type "cosmossdk.io/core/store".KVStoreService) as "cosmossdk.io/store/types".StoreKey value in argument to NewKeeper: "cosmossdk.io/core/store".KVStoreService does not implement "cosmossdk.io/store/types".StoreKey (missing method Name)
/tmp/go/.go-mod-cache/github.com/!cosm!wasm/wasmd@v0.53.0/x/wasm/keeper/test_common.go:400:3: cannot use availableCapabilities (variable of type []string) as string value in argument to NewKeeper)

(typecheck)

🧹 Nitpick comments (8)
cmd/horsed/cmd/config.go (1)

7-9: Added new AppConfig type that embeds the server config.

This simplifies the configuration structure by leveraging the server's default configuration as a base. Consider adding documentation that explains the purpose of this type and how it extends the server configuration.

 type AppConfig struct {
+	// AppConfig embeds the default server configuration and can be extended with
+	// application-specific configuration settings if needed.
 	serverconfig.Config
 }
app/test_helpers.go (2)

68-68: Ensure consistency with removed WASM parameters.
This removal streamlines the New function call by dropping opts. Double-check that any leftover WASM references in surrounding code have also been removed.


94-94: Drop unused WasmOpts in SetupOptions if no longer needed.
Although WASM parameters are removed here, WasmOpts is still present in SetupOptions (line 50). Consider removing it if it is no longer in use anywhere.

-type SetupOptions struct {
-    Logger   log.Logger
-    DB       *dbm.MemDB
-    AppOpts  servertypes.AppOptions
-    WasmOpts []wasmkeeper.Option
-}
+type SetupOptions struct {
+    Logger  log.Logger
+    DB      *dbm.MemDB
+    AppOpts servertypes.AppOptions
+}
cmd/horsed/cmd/commands.go (1)

10-10: Remove unused or unrelated imports.
The import on this line appears new or altered but is not obviously referenced. If it's unused, consider removing it for cleanliness.

app/app.go (4)

284-284: Review memory store usage.
Ensure that any modules or features using the newly declared memory store keys are properly finalized or removed if unnecessary.


401-401: Set circuit breaker.
This call ensures the newly introduced circuit breaker is active. Confirm that you have the correct fallback behavior if the breaker toggles.


702-702: Confirm the need for ABCI extension initialization.
app.initializeABCIExtensions() is newly introduced but empty. If this is a placeholder, clarify its responsibilities or remove it until ready.


992-995: Implement or remove stub function.
initializeABCIExtensions() is an empty placeholder. Consider implementing it or removing it to avoid confusion.

Would you like help drafting this implementation, or should I open a new issue to track it?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd1e9de and ccdd28d.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (13)
  • app/ante.go (1 hunks)
  • app/app.go (12 hunks)
  • app/encoding.go (1 hunks)
  • app/genesis.go (0 hunks)
  • app/oracle.go (0 hunks)
  • app/test_helpers.go (3 hunks)
  • app/test_support.go (1 hunks)
  • cmd/horsed/cmd/commands.go (1 hunks)
  • cmd/horsed/cmd/config.go (1 hunks)
  • cmd/horsed/cmd/root.go (2 hunks)
  • go.mod (14 hunks)
  • networks/horse/genesis.json (0 hunks)
  • networks/horse/genesis.narwhal.json (0 hunks)
💤 Files with no reviewable changes (4)
  • networks/horse/genesis.narwhal.json
  • networks/horse/genesis.json
  • app/genesis.go
  • app/oracle.go
🧰 Additional context used
🧬 Code Definitions (2)
cmd/horsed/cmd/root.go (2)
cmd/horsed/cmd/config.go (3)
  • AppConfig (7-9)
  • DefaultConfigTemplate (17-19)
  • NewDefaultConfig (11-15)
app/app.go (1)
  • New (233-724)
app/test_helpers.go (1)
app/app.go (1)
  • New (233-724)
🔇 Additional comments (34)
app/test_support.go (1)

8-8: IBC module has been upgraded from v8 to v10.

This change is part of a broader effort to upgrade the IBC module throughout the codebase. Ensure that your application is compatible with this newer version and that all IBC-related functionality remains intact.

app/ante.go (1)

13-14: IBC module has been upgraded from v8 to v10.

The imports for both ibcante and keeper have been updated to use v10 of the IBC module, which is consistent with changes in other files.

cmd/horsed/cmd/root.go (3)

23-26: Added new function to initialize app config.

This function encapsulates the application configuration initialization logic, improving modularity. It uses the newly defined AppConfig type from cmd/horsed/cmd/config.go.


28-31: Added new function to initialize CometBFT config.

This function encapsulates the CometBFT configuration initialization logic, improving modularity and code organization.


38-38: Simplified tempApp instantiation by removing wasmkeeper options.

This change aligns with the PR objective of removing CosmWasm from the project. The tempApp is now created without any WASM-specific options, which is consistent with the overall goal of removing CosmWasm dependencies.

cmd/horsed/cmd/config.go (2)

11-15: Added function to create a new default AppConfig.

This function creates a new AppConfig instance with default server configuration settings, which is a good practice for providing sensible defaults.


17-19:

Details

❓ Verification inconclusive

Simplified DefaultConfigTemplate function.

The function now directly returns the default configuration template from the server config package, removing any custom templates that might have been included before (such as WASM and Oracle templates according to the AI summary).


🏁 Script executed:

#!/bin/bash
# Check if there are any references to custom config templates that might have been removed
echo "Checking for references to custom config templates..."
rg "WasmTemplate|OracleTemplate" --type go

Length of output: 161


DefaultConfigTemplate Simplification – Confirm Custom Template Removal

The updated function now directly returns the default configuration template from the server config package, with any legacy custom templates (e.g., WASM and Oracle templates) removed. Our verification script did not find any references to "WasmTemplate" or "OracleTemplate" across the Go code, indicating that these custom templates have likely been removed. However, please manually verify that no other remnants exist before final approval.

  • File: cmd/horsed/cmd/config.go (Lines 17–19)
  • Code Snippet:
    func DefaultConfigTemplate() string {
        return serverconfig.DefaultConfigTemplate
    }
app/encoding.go (1)

17-17: Confirm removal of WASM options argument.
This line removes the previously used WASM options. Verify that no remaining code references these WASM options.

app/test_helpers.go (1)

265-265: Confirm initialization without WASM options.
This refactor removes the WASM-specific argument. Ensure that no calls to WASM functionality remain.

app/app.go (5)

104-109: Upgrade IBC dependencies to v10.
These lines confirm the transition to the latest IBC modules (v10). Verify that other IBC references (e.g., configuration, default settings, Dockerfiles) are also updated to match the new version.


154-155: Check module account permissions.
You're granting minter and burner permissions to both ibctransfertypes.ModuleName and tokenfactorytypes.ModuleName. Ensure this aligns with your business logic and that neither module inadvertently burns or mints tokens incorrectly.


203-204: Adding IBC keepers.
Adding IBCKeeper and a separate TransferKeeper is a good approach. Confirm that any leftover WASM keeper references have been fully removed.


277-280: Validate migrated store keys.
These lines confirm that store keys for IBC and Transfer are kept, while WASM keys are removed. Double-check that nothing references the old WASM store keys.


736-737: Maintain minimal dependencies in ante handler.
Passing IBCKeeper into the ante handler is valid if you need IBC checks in transaction processing. Confirm no leftover WASM references are included.

go.mod (20)

3-5: Updated Go Version and Toolchain
The go directive has been updated to 1.23.6 and the toolchain is now set to go1.24.1. Please verify that this new toolchain and patch version are compatible with your existing build, CI configuration, and deployment pipelines.


32-33: CosmWasm Dependencies Presence
Despite the PR’s intent to remove CosmWasm integrations, the dependencies github.com/CosmWasm/wasmd and github.com/CosmWasm/wasmvm/v2 are still present in the go.mod file. Please confirm if these should be removed to fully align with the PR objectives or retained for transitional purposes.


35-41: Core Module Dependency Updates
The core dependencies have been version bumped as follows:

  • github.com/cometbft/cometbft updated to v0.38.15
  • github.com/cosmos/cosmos-sdk updated to v0.50.13
  • github.com/cosmos/ibc-go/v10 updated to v10.1.0
    These changes are significant and may include breaking changes. Please ensure that thorough integration and regression testing are performed to validate compatibility with the rest of the blockchain application.

55-59: Google and X Tooling Updates
The following dependencies have been updated:

  • golang.org/x/tools → v0.29.0
  • google.golang.org/genproto/googleapis/api → v0.0.0-20241015192408-796eee8c2d53
  • google.golang.org/grpc → v1.69.0
  • google.golang.org/protobuf → v1.36.5
    Please check that these updates do not introduce new deprecation warnings or compatibility issues with your current implementation.

74-74: Cloud Compute Metadata Dependency Update
The dependency cloud.google.com/go/compute/metadata has been updated to v0.5.2. Verify that cloud metadata fetching and related functionalities work correctly with this new version.


84-84: DataDog Dependency Update
github.com/DataDog/datadog-go has been updated to v4.8.3+incompatible. Please ensure that this version aligns with your monitoring and logging integrations, and confirm that there are no breaking changes in its API usage.


92-93: Minor Dependency Updates
The dependencies for:

  • github.com/bgentry/speakeasy → updated to v0.2.0
  • github.com/bits-and-blooms/bitset → updated to v1.17.0
    have been updated. It is advisable to run functional tests to confirm that these upgrades do not adversely affect any area of your application that relies on them.

102-102: CockroachDB FIFO Dependency Bump
The module github.com/cockroachdb/fifo has been updated to a newer version. Please validate that the FIFO queue semantics remain intact and that any dependent components function as expected under this update.


130-131: Cryptography and Timer Dependency Updates
Updates have been applied to:

  • github.com/decred/dcrd/dcrec/secp256k1/v4v4.3.0
  • github.com/desertbit/timerv1.0.1
    These changes are critical for cryptographic operations and timer functionality respectively. Ensure that all related processes—including security checks and time-based operations—are rigorously tested after these upgrades.

144-144: Ethereum Go-Ethereum Dependency Update
github.com/ethereum/go-ethereum is updated to v1.15.5. Confirm that any Ethereum-related utilities or integrations that your project might be using continue to work as expected.


149-149: Sentry Dependency Update
The update of github.com/getsentry/sentry-go to v0.28.1 may affect error monitoring and logging configurations. Please verify that Sentry integration within the application functions correctly with this new version.


235-235: Petermattis Goid Dependency Update
github.com/petermattis/goid has been updated. Verify that this change does not negatively impact any functionality relying on accurate goroutine or execution context tracking.


270-270: BoltDB Dependency Update (Alpha Release)
go.etcd.io/bbolt is now at v1.4.0-alpha.1. Since this is an alpha release, please be cautious and perform comprehensive testing to detect any instabilities or regressions before deploying in production environments.


278-280: OpenTelemetry Dependency Updates
The OpenTelemetry modules – go.opentelemetry.io/otel, otel/metric, and otel/trace – are updated to v1.31.0. Make sure that these telemetry updates integrate fully with your monitoring setup and that data collection remains accurate.


286-286: Go Crypto Dependency Update
golang.org/x/crypto has been updated to v0.32.0. Confirm that all cryptographic routines continue to operate securely and that there are no unexpected deprecations or API changes impacting security-related code.


288-290: Module, Net, and OAuth2 Dependency Updates
The following updates have been applied:

  • golang.org/x/modv0.22.0
  • golang.org/x/netv0.34.0
  • golang.org/x/oauth2v0.23.0
    Given the widespread usage of these modules, please verify that module resolution, network operations, and OAuth2 functionalities are not adversely affected.

292-293: System and Terminal Dependency Updates
golang.org/x/sys and golang.org/x/term have been updated. It is important to confirm that any system-level interactions or terminal I/O operations behave correctly after these changes.


295-295: Time Dependency Update
golang.org/x/time is now updated to v0.9.0. Verify that any scheduling or time-based functionality continues to perform as expected.


298-298: Google Genproto RPC Dependency Update
The module google.golang.org/genproto/googleapis/rpc has been updated to a new version. Please ensure that service definitions and gRPC interactions remain compatible following this update.


303-303: Websocket Dependency Update
nhooyr.io/websocket is updated to v1.8.11. Confirm that websocket-related functionalities throughout the application continue to operate as expected.

Comment on lines +691 to 701
// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetPreBlocker(app.PreBlocker)
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)

app.MarketMapKeeper.SetHooks(app.OracleKeeper.Hooks())
// set denom resolver to test variant.
// app.FeeMarketKeeper.SetDenomResolver(&ante.DenomResolverImpl{
// StakingKeeper: &app.StakingKeeper,
// })

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid repeating initialization logic.
These lines appear to replicate the BaseApp initialization steps (SetInitChainer, etc.) that are already done earlier. If duplication is unintentional, remove or consolidate them.

-// initialize BaseApp
-app.SetInitChainer(app.InitChainer)
-app.SetPreBlocker(app.PreBlocker)
-app.SetBeginBlocker(app.BeginBlocker)
-app.SetEndBlocker(app.EndBlocker)
+// Initialization of BaseApp is already set above. Remove duplicate calls if unnecessary.
📝 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
// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetPreBlocker(app.PreBlocker)
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)
app.MarketMapKeeper.SetHooks(app.OracleKeeper.Hooks())
// set denom resolver to test variant.
// app.FeeMarketKeeper.SetDenomResolver(&ante.DenomResolverImpl{
// StakingKeeper: &app.StakingKeeper,
// })
// Initialization of BaseApp is already set above. Remove duplicate calls if unnecessary.
// set denom resolver to test variant.
// app.FeeMarketKeeper.SetDenomResolver(&ante.DenomResolverImpl{
// StakingKeeper: &app.StakingKeeper,
// })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant