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

feat: add cosmwasm #118

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

feat: add cosmwasm #118

wants to merge 29 commits into from

Conversation

chalabi2
Copy link
Collaborator

@chalabi2 chalabi2 commented Feb 7, 2025

  • feat!: add cosmwasm
  • fix: fix determinism simulation test
  • fix: sim-full-app test
  • WIP: attempt to fix sim-import and sim-after simulation tests**
  • feat: add cosmwasm interchain test

Add cosmwasm to Manifest-ledger

Description

This PR adds the cosmwasm module to the manfiest ledger, adds cosmwasm scripts, updates simulations, add cosm wasm interchain test.

Testing

For testing locally:

  • run the test_node.sh script
  • run the upload_contract.sh script

Otherwise view the CI/Docker tests.

Breaking Changes (if applicable)

@fmorency

  • confirm simulations that are currently broken were broken before
  • confirm interchain tests for cosmwasm works

Checklist:

  • I have read and followed the CONTRIBUTING guidelines for this project.
  • I have added or updated tests and they pass.
  • I have added or updated documentation and it is accurate.
  • I have noted any breaking changes in this module or downstream modules.

Summary by CodeRabbit

  • New Features

    • Integrated support for CosmWasm smart contracts, enabling users to upload, instantiate, and execute contracts.
    • Enabled open default permissions for smart contract operations during chain initialization.
    • Extended command-line options to include WASM-specific configurations.
    • Added a new script for uploading contracts to the network.
    • Introduced a new test for the CosmWasm module within the interchain testing framework.
  • Documentation

    • Updated system requirements with new CPU instruction details for optimal WASM performance.
    • Revised the module guide to clearly outline new CosmWasm functionalities and provided a dedicated section for contract deployment instructions.
    • Enhanced README with details on the new upload contract script.
    • Updated simulation parameters to include new weights for contract management proposals.
    • Improved the Table of Contents in the module documentation for better navigation.
    • Updated genesis documentation to reflect new Go version requirements.

Copy link

coderabbitai bot commented Feb 7, 2025

Warning

Rate limit exceeded

@fmorency has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 992ccb6 and aa5c788.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • interchaintest/go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod (10 hunks)
  • interchaintest/go.mod (8 hunks)
  • network/manifest-1/set-genesis-params.sh (1 hunks)

Walkthrough

This pull request integrates enhanced CosmWasm support into the project. It updates CI/CD workflows and Makefile targets to run new CosmWasm end-to-end tests, enriches linting configurations, and revises documentation to include a new CosmWasm module and upload contract script. Application initialization, ante handling, and module management have been extended to incorporate WASM functionalities, while simulation tests and temporary resource management have been refined. Additionally, genesis configuration and CLI commands now accommodate public WASM access.

Changes

File(s) Summary
.github/workflows/e2e.yml, .github/workflows/build.yml, .github/workflows/codeql.yml, .github/workflows/release-bin.yaml, .github/workflows/simulation.yml, .github/workflows/test.yml Updated GO_VERSION from 1.22.11 to 1.23.6 in multiple workflow files.
Makefile Added CosmWasm test command ("ictest-cosmwasm") and updated the phony target.
interchaintest/cosmwasm_test.go Introduced a new test for CosmWasm functionality in the Interchain Test framework.
.golangci.yml Adjusted linter settings, increased timeout, and added new prefixes for CosmWasm-related linters.
MODULE.md, README.md Restructured the TOC and documentation to include a new COSM WASM Module; updated system requirements and added an "Upload Contract script" section.
app/ante.go, app/app.go Integrated CosmWasm support by adding new fields and decorators in the ante handler and by initializing a WasmKeeper in the application.
app/sim_test.go, app/test_helpers.go Improved simulation test setups by updating chain IDs and adding helper functions for unique temporary directories.
cmd/manifestd/cmd/root.go Enhanced CLI commands to support WASM configurations by introducing initWasmConfig and initWasmFlags.
go.mod, interchaintest/go.mod Added dependencies for CosmWasm (wasmd, wasmvm) and updated versions for existing modules.
network/manifest-1/set-genesis-params.sh, scripts/test_node.sh Updated genesis parameters to grant public ("Everybody") access for code upload and contract instantiation in WASM.
scripts/upload_contract.sh Introduced a new Bash script to facilitate the uploading and interaction with CosmWasm contracts.
Dockerfile Updated base image to golang:1.23-alpine and refined logic for downloading the WASM library.
simulation/sim_params.json Added new parameters for contract proposals to the simulation configuration.
app/upgrades.go, app/upgrades/next/upgrades.go, app/upgrades/types.go Expanded upgrade handling to include WASM-related configurations and parameters.
interchaintest/setup.go Registered WASM interfaces in the encoding configuration.
network/manifest-1/GENESIS.md, network/manifest-1/POST_GENESIS.md Updated prerequisites to require Go version 1.23+.

Sequence Diagram(s)

sequenceDiagram
    participant T as Tester
    participant CI as GitHub CI
    participant M as Makefile
    participant B as Blockchain Node
    participant W as WASM Module
    T->>CI: Trigger e2e tests (ictest-cosmwasm)
    CI->>M: Run Makefile target "ictest-cosmwasm"
    M->>B: Execute TestCosmWasm (upload, instantiate, execute)
    B->>W: Process contract via WASM Module
    W-->>B: Return execution result
    B-->>M: Report test results
    M-->>CI: Send outcome
    CI-->>T: Notify test result
Loading
sequenceDiagram
    participant C as CLI Command
    participant A as Application
    participant W as WasmKeeper
    participant H as Ante Handler
    C->>A: Initialize app (NewApp)
    A->>W: Create WasmKeeper instance
    A->>A: Read WASM config via appOpts
    A->>H: Configure ante handler with WASM decorators
    C->>A: Execute commands with WASM support
Loading

Possibly related PRs

  • chore(deps): bump #117: The changes in the main PR, which involve updating the GO_VERSION in multiple workflow files, are related to the changes in the retrieved PR that also update the GO_VERSION in similar workflow files, indicating a direct connection in the context of version management.
  • fix: upgrade fw & vuln #107: The changes in the main PR, particularly in the app/upgrades.go and app/upgrades/next/upgrades.go files, are related to the modifications in the app/upgrades.go and app/upgrades/next/upgrades.go files of the retrieved PR, as both involve updates to the upgrade handling logic and structure.
  • chore: bump to go 1.22.7 #96: The changes in the main PR, which involve updating the GO_VERSION environment variable to 1.23.6, are related to the retrieved PR that also updates the GO_VERSION but to 1.22.7, indicating both PRs are focused on modifying the Go version in workflow files.

Poem

I'm a bunny coding fast and bright,
Hopping through changes day and night.
CosmWasm blooms with tests anew,
In docs and scripts it shines right through.
With a twitch of my nose and a joyful leap,
I celebrate these changes in a boundless hop so deep!


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>, 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. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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: 4

🧹 Nitpick comments (10)
cmd/manifestd/cmd/root.go (1)

103-103: Check for potential error handling
Though initWasmConfig() doesn’t return an error, verifying that the returned config is valid before proceeding could improve resilience in case future changes introduce error conditions.

app/app.go (2)

652-672: Construct the WasmKeeper
The keeper is set up with relevant modules and a path for storing contracts (wasm/). Ensure that directory is secure and restricted in production environments. Also verify that the modules used for IBC and distribution queries are correct for your chain’s needs.


969-996: WASM configuration in ante handler
Reading the WASM config and inserting specialized decorators is a neat design. Consider graceful handling for misconfigured or missing WASM parameters to prevent unexpected panics in production.

interchaintest/cosmwasm_test.go (2)

67-67: Follow Go naming conventions for acronyms.

The variable name codeId should be codeID as per Go naming conventions where acronyms should be uppercase.

-codeId, err := chain.StoreContract(ctx, user.KeyName(), string(wasmBytes))
+codeID, err := chain.StoreContract(ctx, user.KeyName(), string(wasmBytes))
🧰 Tools
🪛 golangci-lint (1.62.2)

[warning] 67-67: var-naming: var codeId should be codeID

(revive)


17-17: Add test documentation.

Add a comment explaining the purpose and scope of this test function to improve maintainability.

+// TestCosmWasm verifies the functionality of CosmWasm smart contract operations
+// by uploading a contract, instantiating it, and performing basic interactions.
 func TestCosmWasm(t *testing.T) {
app/test_helpers.go (1)

361-369: Document the helper function.

Add documentation to explain the purpose and behavior of the makeTestDir function.

+// makeTestDir creates a unique temporary directory for testing purposes and ensures
+// its cleanup after the test completes. It returns the path to the created directory.
 func makeTestDir(t *testing.T) string {
app/sim_test.go (1)

245-245: Address blank identifier warnings.

Multiple blank identifiers in function calls make the code less maintainable and hide potentially useful values.

Consider naming the ignored values or documenting why they're ignored:

-newDB, _, _, _, err := simtestutil.SetupSimulation(...)
+newDB, dir, logger, skip, err := simtestutil.SetupSimulation(...)
+// dir, logger, and skip are unused in this context

Also applies to: 382-382

🧰 Tools
🪛 GitHub Check: build amd64 for linux

[failure] 245-245:
declaration has 3 blank identifiers (dogsled)

🪛 GitHub Actions: Build Manifest

[error] 245-245: declaration has 3 blank identifiers (dogsled)

scripts/upload_contract.sh (2)

7-7: Refactor HOME_DIR assignment to avoid masking return values (SC2155).
Using command substitution directly in the export statement may mask important return values. Consider declaring a temporary variable first. For example:

- export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.manifest"}")
+ HOME_DIR_DEFAULT="${HOME_DIR:-"~/.manifest"}"
+ export HOME_DIR=$(eval echo "$HOME_DIR_DEFAULT")
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 7-7: Declare and assign separately to avoid masking return values.

(SC2155)


11-11: Avoid alias pitfalls in non-interactive scripts (SC2139).
Aliases in scripts are expanded at definition time and may lead to unexpected behavior. A more robust pattern is to define a wrapper function that appends the required flag. For example:

- alias BINARY="$BINARY --home=$HOME_DIR"
+ function runBinary() {
+   $BINARY --home="$HOME_DIR" "$@"
+ }

Then replace calls to “$BINARY” with “runBinary”.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 11-11: This expands when defined, not when used. Consider escaping.

(SC2139)

MODULE.md (1)

255-316: New COSM WASM Module Documentation
The new COSM WASM Module section (lines 255–316) is detailed and covers contract deployment, administration, and execution commands. To comply with markdown style guidelines (MD026), consider removing trailing punctuation (e.g., the colons at the end of headings like "#### Contract Deployment:", "#### Contract Administration:", and "#### Contract Execution:").

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

263-263: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


269-269: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


276-276: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


284-284: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


294-294: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


306-306: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2837427 and befe1f9.

⛔ Files ignored due to path filters (1)
  • scripts/cw_template.wasm is excluded by !**/*.wasm
📒 Files selected for processing (15)
  • .github/workflows/e2e.yml (2 hunks)
  • .golangci.yml (1 hunks)
  • MODULE.md (3 hunks)
  • Makefile (1 hunks)
  • README.md (4 hunks)
  • app/ante.go (3 hunks)
  • app/app.go (14 hunks)
  • app/sim_test.go (13 hunks)
  • app/test_helpers.go (2 hunks)
  • cmd/manifestd/cmd/root.go (3 hunks)
  • go.mod (5 hunks)
  • interchaintest/cosmwasm_test.go (1 hunks)
  • network/manifest-1/set-genesis-params.sh (1 hunks)
  • scripts/test_node.sh (1 hunks)
  • scripts/upload_contract.sh (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Codecov
Makefile

[error] 140-140: The command 'make local-image' failed with exit code 2.

🪛 GitHub Actions: Simulation Tests
Makefile

[error] 301-301: Makefile:301: sim-after-import failed with exit code 2.

🪛 Shellcheck (0.10.0)
scripts/upload_contract.sh

[warning] 7-7: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 11-11: This expands when defined, not when used. Consider escaping.

(SC2139)

🪛 LanguageTool
MODULE.md

[duplication] ~7-~7: Possible typo: you repeated a word.
Context: ... of Contents - Manifest Module - Module Functionality ...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~12-~12: Possible typo: you repeated a word.
Context: ...okens-burn-coins) - Proof of Authority Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~21-~21: Possible typo: you repeated a word.
Context: ...move-validator-remove) - Token Factory Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~35-~35: Possible typo: you repeated a word.
Context: ...-metadata-modify-metadata) - COSM WASM Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)

🪛 markdownlint-cli2 (0.17.2)
MODULE.md

263-263: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


269-269: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


276-276: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


284-284: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


294-294: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


306-306: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

🪛 golangci-lint (1.62.2)
app/ante.go

20-20: 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/[email protected]/x/wasm/keeper/test_common.go:386:3: cannot use runtime.NewKVStoreService(keys[types.StoreKey]) (value of 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/[email protected]/x/wasm/keeper/test_common.go:400:3: cannot use availableCapabilities (variable of type []string) as string value in argument to NewKeeper)

(typecheck)

interchaintest/cosmwasm_test.go

118-118: File is not gofumpt-ed

(gofumpt)


[warning] 67-67: var-naming: var codeId should be codeID

(revive)

🪛 GitHub Check: build amd64 for linux
app/sim_test.go

[failure] 245-245:
declaration has 3 blank identifiers (dogsled)


[failure] 382-382:
declaration has 3 blank identifiers (dogsled)

🪛 GitHub Actions: Unit Tests
app/sim_test.go

[warning] 143-143: TestFullAppSimulation is skipped.


[warning] 190-190: TestAppImportExport is skipped.


[warning] 331-331: TestAppSimulationAfterImport is skipped.


[warning] 419-419: TestAppStateDeterminism is skipped.

🪛 GitHub Actions: Build Manifest
app/sim_test.go

[error] 245-245: declaration has 3 blank identifiers (dogsled)

🔇 Additional comments (29)
cmd/manifestd/cmd/root.go (3)

16-16: Add new imports for serverconfig, crisis, wasm, and wasmtypes
No issues found. This import set appears appropriate for WASM integration and crisis handling.

Also applies to: 23-23, 27-28


125-142: Validate zero gas price in production
Here, the MinGasPrices is set to "0stake," which may be acceptable for testing but can introduce spam or DOS risks in production. Ensure this configuration is intentional. Returning an interface{} for the config can reduce type safety. If possible, consider returning a concrete struct to prevent runtime casting errors.


144-146: Initialize WASM and crisis flags together
Adding both WASM and crisis module init flags is straightforward and consistent. Ensure no overlap with existing flags.

app/app.go (8)

141-143: New imports for CosmWasm
Importing wasm, wasmkeeper, and wasmtypes is consistent with the new WASM integration.


221-221: Grant burner permission to WASM module account
Granting WASM the burner permission allows contract code to burn tokens. Confirm this is intended, as it can be powerful.


277-277: Added WasmKeeper field
Introducing WasmKeeper in ManifestApp is a clean approach to integrate WASM functionality.


338-338: Add WASM store key
Adding wasmtypes.StoreKey ensures proper state isolation for storing WASM data.


386-400: Scoped keeper and skip-upgrades
Defining scopedWasmKeeper and reading skipUpgradeHeights align with standard patterns. The code for loading the wasm configuration is clear. No issues noted.


743-743: Added crisis, manifest, and wasm modules to ModuleManager
Integrating these modules is standard. Confirm that the order of insertion meets each module’s dependency requirements.

Also applies to: 745-746


748-775: Register WASM for lifecycle management
Appending wasm to the begin/end blocker and init-genesis sequences properly integrates it into the chain lifecycle. This is a key step in ensuring modules can interact with WASM code during every block phase.


925-925: Ante handler invocation
Calling setAnteHandler with additional WASM parameters is a proper approach for hooking in WASM capabilities at transaction level.

app/ante.go (3)

12-12: New imports for store, runtime, and WASM
These added imports accurately reflect the extended WASM-dependent features and store interactions.

Also applies to: 16-16, 20-21


37-38: Expanded HandlerOptions
Adding WasmConfig and StoreKey aligns with the new CosmWasm functionality. Ensure both fields remain non-nil to avoid runtime panics.


71-72: New WASM ante decorators
The LimitSimulationGasDecorator uses SimulationGasLimit, and CountTXDecorator relies on a KV store service. Confirm that WasmConfig is always defined, as referencing a nil config could cause errors.

.golangci.yml (1)

45-46: LGTM! Good addition of CosmWasm prefixes.

The addition of CosmWasm-related prefixes to the GCI sections is appropriate for the integration of the CosmWasm module.

scripts/upload_contract.sh (1)

1-32: Overall, the upload contract script is structured well.
The script reliably sets environment variables, adds the required key if missing, and follows the workflow for storing, instantiating, and querying the contract. Make sure that the sleep durations (lines 21, 25, 29) are aligned with the blockchain’s expected response times.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 7-7: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 11-11: This expands when defined, not when used. Consider escaping.

(SC2139)

.github/workflows/e2e.yml (1)

69-69: Integrating the CosmWasm test into the E2E workflow.
The addition of the "ictest-cosmwasm" command in the test matrix ensures that the new CosmWasm module is validated along with other tests. Confirm that a corresponding Makefile target exists and that all necessary dependencies are met.

network/manifest-1/set-genesis-params.sh (1)

75-78: CosmWasm Genesis Parameter Configuration.
The new lines configuring the WASM module—setting “code_upload_access” and “instantiate_default_permission” to "Everybody"—are clear and in line with the objective of enhancing contract accessibility. Please verify that these permission values conform with the blockchain’s expected configuration and security requirements.

README.md (2)

59-62: Clarify system requirements for CosmWasm compatibility.
The update specifying “Linux (x86_64 with SSSE3 support) or Linux (arm64 with NEON support)” adds important detail regarding processor instruction support. This helps users ensure their hardware is compatible with CosmWasm.


181-190: Addition of the Upload Contract Script section.
The new “Upload Contract script” section clearly explains the purpose and usage of the scripts/upload_contract.sh file. The provided usage example and linkage with existing environment variables (shared with test_node.sh) improve clarity. Consider including a brief troubleshooting note if the contract upload fails.

scripts/test_node.sh (1)

88-91: Consistent WASM configuration in test genesis updates.
The appended updates to the genesis parameters for the WASM module, setting both “code_upload_access” and “instantiate_default_permission” to "Everybody", are consistent with the other configuration files. This unified approach should facilitate smoother integration of CosmWasm functionalities.

go.mod (4)

36-36: CosmWasm Dependency Addition
The addition of "github.com/CosmWasm/wasmd v0.51.0" on line 36 is well aligned with the PR’s objective to integrate CosmWasm functionality. Please verify that version v0.51.0 is compatible with the rest of your modules and does not introduce unintended breaking changes.


68-68: WasmVM Dependency Inclusion
The inclusion of "github.com/CosmWasm/wasmvm/v2 v2.0.0" as an indirect dependency supports CosmWasm-related operations. Ensure that using an indirect dependency here is intentional and that this version is tested in your WASM contract execution scenarios.


103-103: Distribution Reference Dependency
The new indirect dependency "github.com/distribution/reference v0.5.0" added on line 103 appears to support container or image-related operations. Please double-check that it is truly required and that its version does not conflict with other dependencies.


175-175: OpenContainers Digest Dependency
"Github.com/opencontainers/go-digest v1.0.0" has been added as an indirect dependency (line 175). Verify that this addition meets the requirements for handling container digests and does not lead to compatibility issues.

Makefile (3)

123-125: New CosmWasm Test Target
The addition of the "ictest-cosmwasm" target (lines 123–125) is consistent with integrating CosmWasm tests into the CI workflow. Ensure that the "TestCosmWasm" test function is fully implemented and passes all necessary validations in your local and CI environments.


299-304: Review Simulation Target: sim-after-import
The "sim-after-import" target (lines 299–304) runs "TestAppSimulationAfterImport." Given that the CI pipeline reported an exit code 2 on line 301, please review the test parameters (SIM_COMMON_ARGS) and the test implementation to ensure that the simulation is configured correctly.

🧰 Tools
🪛 GitHub Actions: Simulation Tests

[error] 301-301: Makefile:301: sim-after-import failed with exit code 2.


132-141: Local Image Build Target Issue
The "local-image" target (lines 132–141) is used to clone and build the heighliner image, but the CI pipeline reported a failure (exit code 2). Please investigate whether the heighliner repository is accessible, the clone/build steps complete successfully, and the binary is installed correctly.

🧰 Tools
🪛 GitHub Actions: Codecov

[error] 140-140: The command 'make local-image' failed with exit code 2.

MODULE.md (1)

5-43: Updated Table of Contents
The revised TOC thoroughly reorganizes the modules and introduces the new COSM WASM Module. Please double-check that all links resolve correctly and review any potential duplicate wordings flagged by static analysis.

🧰 Tools
🪛 LanguageTool

[duplication] ~7-~7: Possible typo: you repeated a word.
Context: ... of Contents - Manifest Module - Module Functionality ...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~12-~12: Possible typo: you repeated a word.
Context: ...okens-burn-coins) - Proof of Authority Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~21-~21: Possible typo: you repeated a word.
Context: ...move-validator-remove) - Token Factory Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~35-~35: Possible typo: you repeated a word.
Context: ...-metadata-modify-metadata) - COSM WASM Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)

interchaintest/cosmwasm_test.go Outdated Show resolved Hide resolved
interchaintest/cosmwasm_test.go Outdated Show resolved Hide resolved
Comment on lines 62 to 64
wasmFile := "../contracts/cw_template.wasm"
wasmBytes, err := os.ReadFile(wasmFile)
require.NoError(t, err)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve contract file handling.

The contract file path is hardcoded and lacks existence validation, which could lead to unclear errors if the file is missing.

-wasmFile := "../contracts/cw_template.wasm"
+wasmFile := os.Getenv("TEST_CONTRACT_PATH")
+if wasmFile == "" {
+    wasmFile = "../contracts/cw_template.wasm"
+}
+
+// Verify contract file exists
+if _, err := os.Stat(wasmFile); os.IsNotExist(err) {
+    t.Fatalf("Contract file not found at %s", wasmFile)
+}
 wasmBytes, err := os.ReadFile(wasmFile)
📝 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
wasmFile := "../contracts/cw_template.wasm"
wasmBytes, err := os.ReadFile(wasmFile)
require.NoError(t, err)
wasmFile := os.Getenv("TEST_CONTRACT_PATH")
if wasmFile == "" {
wasmFile = "../contracts/cw_template.wasm"
}
// Verify contract file exists
if _, err := os.Stat(wasmFile); os.IsNotExist(err) {
t.Fatalf("Contract file not found at %s", wasmFile)
}
wasmBytes, err := os.ReadFile(wasmFile)
require.NoError(t, err)

app/sim_test.go Outdated
@@ -415,110 +419,54 @@
t.Skip("skipping application simulation")
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Document test skip conditions.

Multiple simulation tests are being skipped. Add documentation explaining the conditions under which these tests should run.


🏁 Script executed:

#!/bin/bash
# Find all skipped tests and their conditions
rg -A 1 "t\.Skip\(" app/sim_test.go

Length of output: 261


Action Required: Document Simulation Test Skip Conditions

The simulation tests in app/sim_test.go (e.g., lines showing "t.Skip("skipping application simulation")", "t.Skip("skipping application import/export simulation")", and "t.Skip("skipping application simulation after import")") are being skipped without any accompanying documentation detailing when or why these tests should be run. Please add clear documentation (e.g., conditions, environment settings, or dependency requirements) that explains the circumstances under which each skipped test should execute. This will enhance code maintainability and clarity for future maintainers.

🧰 Tools
🪛 GitHub Actions: Unit Tests

[warning] 419-419: TestAppStateDeterminism is skipped.

@chalabi2
Copy link
Collaborator Author

chalabi2 commented Feb 7, 2025

@fmorency most of these tests are passing locally, but the CI is bugging out about the libwasmvm download link

Copy link
Collaborator

@fmorency fmorency left a comment

Choose a reason for hiding this comment

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

Thanks!

  • make test is failing. The TestExportGenesis test fails with panic: Could not lock exclusive.lock. Is a different VM running in the same directory already?

  • make sim-import-export should pass

  • make sim-after-import should pass

  • make ictest-cosmwasm fails

README.md Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/sim_test.go Outdated Show resolved Hide resolved
app/sim_test.go Outdated Show resolved Hide resolved
app/sim_test.go Outdated Show resolved Hide resolved
app/sim_test.go Outdated Show resolved Hide resolved
sleep 2

echo "Querying contract info..."
$BINARY q wasm contract $addr
Copy link
Collaborator

Choose a reason for hiding this comment

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

EOF EOL

# Add CosmWasm configuration
update_genesis '.app_state["wasm"]["params"]["code_upload_access"]["permission"]="Everybody"'
update_genesis '.app_state["wasm"]["params"]["instantiate_default_permission"]="Everybody"'

# # add genesis accounts
# # TODO:
# manifestd genesis add-genesis-account manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct 1umfx --append
Copy link
Collaborator

Choose a reason for hiding this comment

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

EOF EOL

cmd/manifestd/cmd/root.go Show resolved Hide resolved
@fmorency
Copy link
Collaborator

fmorency commented Feb 7, 2025

@fmorency most of these tests are passing locally, but the CI is bugging out about the libwasmvm download link

Edit: I fixed it in 421a649

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

🧹 Nitpick comments (2)
app/app.go (2)

388-394: Consider using constants for upgrade heights.

The upgrade heights are currently hardcoded in the code. Consider moving them to a configuration file or constants for better maintainability.

-skipUpgradeHeights := map[int64]bool{}
-for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) {
-  skipUpgradeHeights[int64(h)] = true
-}
+const (
+  UpgradeHeight1 int64 = 1000000
+  UpgradeHeight2 int64 = 2000000
+)
+
+var defaultSkipUpgradeHeights = map[int64]bool{
+  UpgradeHeight1: true,
+  UpgradeHeight2: true,
+}
+
+skipUpgradeHeights := defaultSkipUpgradeHeights
+if heights := cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)); len(heights) > 0 {
+  skipUpgradeHeights = make(map[int64]bool)
+  for _, h := range heights {
+    skipUpgradeHeights[int64(h)] = true
+  }
+}

395-399: Add error details to panic message.

When reading the wasm config fails, include the error details in the panic message for better debugging.

-panic(fmt.Errorf("error while reading wasm config: %w", err))
+panic(fmt.Errorf("failed to read wasm config from %s: %v", appOpts.Get(flags.FlagHome), err))
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 421a649 and 0ef41a5.

📒 Files selected for processing (2)
  • app/app.go (16 hunks)
  • app/test_helpers.go (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/test_helpers.go
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-ibc)
🔇 Additional comments (8)
app/app.go (8)

138-140: LGTM! CosmWasm imports added correctly.

The required imports for the CosmWasm module are properly added.


221-221: LGTM! Module account permissions configured correctly.

The wasm module account is correctly configured with the Burner permission, which is the standard permission set for CosmWasm modules.


276-276: LGTM! WasmKeeper field added to ManifestApp.

The WasmKeeper field is correctly added to the ManifestApp struct.


337-337: LGTM! Store key added for wasm module.

The wasm module's store key is correctly added to the KVStoreKeys.


969-990: LGTM! Ante handler updated with wasm configuration.

The ante handler is correctly updated to include wasm configuration and store key.


385-386: LGTM! Capability scoping for wasm module.

The wasm module's capabilities are correctly scoped using the capability keeper.


745-775: Verify module ordering in genesis and block processing.

The wasm module is correctly added to the module manager and block processing order. However, verify that:

  1. The module is added at the end of InitGenesis as required for contract instantiation
  2. The module is added to both BeginBlockers and EndBlockers
✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Check module ordering in genesis
rg -A 10 'genesisModuleOrder.*:=.*\[' app/app.go

# Check module ordering in begin/end blockers
rg -A 10 'OrderBeginBlockers.*=.*append' app/app.go
rg -A 10 'OrderEndBlockers.*=.*append' app/app.go

Length of output: 1292


The wasm module ordering is correctly implemented.

  • The wasm module is properly appended to OrderBeginBlockers, OrderEndBlockers, and OrderInitGenesis, ensuring it is processed at the intended order and at the end of genesis for proper contract instantiation.

652-670: Verify WasmKeeper initialization parameters.

The WasmKeeper initialization looks correct but has some points to verify:

  1. The supported features list includes versions up to "cosmwasm_2_0"
  2. The wasm directory path is set to filepath.Join(homePath, "wasm")
✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Check if the wasm directory exists and is writable
test -d "wasm" || mkdir wasm
if [ ! -w "wasm" ]; then
  echo "Warning: wasm directory is not writable"
  exit 1
fi

# Check for any existing wasm contracts
find wasm -type f -name "*.wasm" | while read -r contract; do
  echo "Found contract: $contract"
done

Length of output: 103


I'm going to run an additional shell script that checks for "cosmwasm_2_0" in "app/app.go" to verify that the WasmKeeper is indeed configured with the expected supported features.


🏁 Script executed:

#!/bin/bash
# Check that the WasmKeeper initialization in app/app.go includes the "cosmwasm_2_0" feature.
rg "cosmwasm_2_0" -n app/app.go

Length of output: 162


WasmKeeper configuration verified

  • The supported features list correctly includes "cosmwasm_2_0".
  • The wasm directory path is indeed set using filepath.Join(homePath, "wasm").

Don't run wasm proposal in the simulator as it clashes with the POA
governance.
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: 0

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

529-540: Consider using test-scoped POA admin configuration.

Setting environment variables in tests can lead to test interference if tests run in parallel. Consider:

  1. Using a test-scoped configuration mechanism
  2. Cleaning up the environment variable in test cleanup
 func setPOAAdmin(config simulationtypes.Config) error {
     r := rand.New(rand.NewSource(config.Seed))
     params := simulation.RandomParams(r)
     accs := simulationtypes.RandomAccounts(r, params.NumKeys())
     poaAdminAddr := accs[0]
-    err := os.Setenv("POA_ADMIN_ADDRESS", poaAdminAddr.Address.String())
-    if err != nil {
-        return err
-    }
-    return nil
+    return setTestPOAAdmin(poaAdminAddr.Address.String())
 }

+// setTestPOAAdmin sets the POA admin address in a test-scoped configuration
+func setTestPOAAdmin(address string) error {
+    // TODO: Implement test-scoped configuration
+    return nil
+}
🧹 Nitpick comments (2)
simulation/sim_params.json (1)

9-16: New Simulation Parameters for Contract Proposals

The addition of the following keys:
• "weight_instantiate_contract_proposal"
• "weight_update_admin_proposal"
• "weight_execute_contract_proposal"
• "weight_clear_admin_proposal"
• "weight_migrate_contract_proposal"
• "weight_pin_codes_proposal"
• "weight_unpin_codes_proposal"
• "weight_update_instantiate_config_proposal"

enhances the simulation configuration for contract-related proposals in the CosmWasm module. They are all set to 0 by default, which appears to represent placeholder values. Please verify that these defaults are the intended initial weights and consider whether a consistent naming convention is desired. Notably, the earlier keys follow the "op_weight_" prefix, whereas these new parameters omit it—if this naming difference is intentional, a brief comment or documentation update might be useful for clarity.

app/sim_test.go (1)

435-435: Document the temporary reduction in simulation runs.

The comment indicates that the number of simulation runs was reduced from 5 to 3 for faster CI. Consider:

  1. Adding a configuration flag to control this value
  2. Documenting when to use the full number of runs
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f26ca43 and 4ccdf4a.

📒 Files selected for processing (2)
  • app/sim_test.go (9 hunks)
  • simulation/sim_params.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: e2e-tests (ictest-cosmwasm)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-tokenfactory)
  • GitHub Check: e2e-tests (ictest-poa)
  • GitHub Check: e2e-tests (ictest-ibc)
  • GitHub Check: tests
  • GitHub Check: build
🔇 Additional comments (2)
app/sim_test.go (2)

83-83: LGTM! Good use of temporary directories.

The change to use temporary directories for each test is a good practice as it ensures proper test isolation and automatic cleanup.

Also applies to: 100-100, 154-154, 217-217, 260-260, 344-344, 392-392, 453-453, 476-477


89-91: Document test skip conditions.

Multiple simulation tests are being skipped without clear documentation explaining:

  1. When these tests should run
  2. What conditions need to be met
  3. How to enable these tests

Also applies to: 143-145, 197-199, 333-335, 417-419

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ccdf4a and 4d49cd6.

📒 Files selected for processing (1)
  • app/ante.go (3 hunks)
🧰 Additional context used
🪛 golangci-lint (1.62.2)
app/ante.go

20-20: 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/[email protected]/x/wasm/keeper/test_common.go:386:3: cannot use runtime.NewKVStoreService(keys[types.StoreKey]) (value of 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/[email protected]/x/wasm/keeper/test_common.go:400:3: cannot use availableCapabilities (variable of type []string) as string value in argument to NewKeeper)

(typecheck)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: e2e-tests (ictest-cosmwasm)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-tokenfactory)
  • GitHub Check: e2e-tests (ictest-poa)
  • GitHub Check: e2e-tests (ictest-ibc)
  • GitHub Check: tests
  • GitHub Check: build
🔇 Additional comments (2)
app/ante.go (2)

20-21: Verify CosmWasm dependency versions.

The static analysis indicates potential compatibility issues with the CosmWasm dependencies. Let's verify the versions and compatibility.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Check CosmWasm dependency versions and compatibility

# Check go.mod for CosmWasm version
echo "CosmWasm version in go.mod:"
go list -m github.com/CosmWasm/wasmd

# Check for any dependency conflicts
go mod graph | grep CosmWasm

Length of output: 16002


CosmWasm Dependency Versions Verified Successfully

The go.mod file specifies CosmWasm/wasmd at v0.51.0, which aligns with the imports in app/ante.go. Although the dependency graph shows that one test module (interchaintest) references an earlier wasmd version (v0.42.1), this does not affect the runtime configuration of our ante handler. No compatibility issues impacting the core functionality were found.

🧰 Tools
🪛 golangci-lint (1.62.2)

20-20: 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/[email protected]/x/wasm/keeper/test_common.go:386:3: cannot use runtime.NewKVStoreService(keys[types.StoreKey]) (value of 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/[email protected]/x/wasm/keeper/test_common.go:400:3: cannot use availableCapabilities (variable of type []string) as string value in argument to NewKeeper)

(typecheck)


71-72: Verify decorator order and KVStoreService compatibility.

Two concerns need to be addressed:

  1. The placement of WASM decorators at the beginning of the chain needs verification. Typically, setup and basic validation decorators should run first.

  2. There's a potential compatibility issue with runtime.NewKVStoreService. The static analysis indicates that the returned KVStoreService might not implement the required interface.

Let's verify the CosmWasm decorator order in other projects:

Consider moving the WASM decorators after the basic setup and validation decorators to ensure proper transaction processing order.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Check CosmWasm decorator order in other projects

# Search for NewLimitSimulationGasDecorator usage
echo "Searching for NewLimitSimulationGasDecorator usage patterns:"
rg --type go "NewLimitSimulationGasDecorator.*anteDecorators" -A 10 -B 10

# Search for NewCountTXDecorator usage
echo "Searching for NewCountTXDecorator usage patterns:"
rg --type go "NewCountTXDecorator.*anteDecorators" -A 10 -B 10

Length of output: 380


🏁 Script executed:

#!/bin/bash
# New Script: Gather additional context on CosmWasm decorator usage and KVStoreService

# Search for any usage of NewLimitSimulationGasDecorator across the repository.
echo "Searching for any usage of wasmkeeper.NewLimitSimulationGasDecorator:"
rg --type go "wasmkeeper\.NewLimitSimulationGasDecorator" -A 5 -B 5

# Search for any usage of NewCountTXDecorator across the repository.
echo "Searching for any usage of wasmkeeper.NewCountTXDecorator:"
rg --type go "wasmkeeper\.NewCountTXDecorator" -A 5 -B 5

# Search for any usage of runtime.NewKVStoreService across the repository.
echo "Searching for any usage of runtime.NewKVStoreService:"
rg --type go "runtime\.NewKVStoreService" -A 5 -B 5

Length of output: 9257


Decorator order and KVStoreService integration verified.

• The new WASM decorators in app/ante.go are positioned after the context setup decorator and before subsequent validation and circuit breaker decorators, which follows the established pattern for proper transaction processing.
• The usage of runtime.NewKVStoreService in NewCountTXDecorator is consistent with its use elsewhere in the codebase (e.g., in app/app.go for various keepers), indicating that the returned service properly implements the required interfaces.

app/ante.go Outdated Show resolved Hide resolved
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/app.go (1)

1224-1237: Add wasm module parameter store subspace.

The wasm module's parameter store subspace is not registered in the initParamsKeeper function. This could cause issues with wasm module configuration.

Add the wasm subspace registration:

 paramsKeeper.Subspace(authtypes.ModuleName)
 paramsKeeper.Subspace(banktypes.ModuleName)
 paramsKeeper.Subspace(stakingtypes.ModuleName)
 paramsKeeper.Subspace(minttypes.ModuleName)
 paramsKeeper.Subspace(distrtypes.ModuleName)
 paramsKeeper.Subspace(slashingtypes.ModuleName)
 paramsKeeper.Subspace(govtypes.ModuleName)
 paramsKeeper.Subspace(crisistypes.ModuleName)
 paramsKeeper.Subspace(ibctransfertypes.ModuleName)
 paramsKeeper.Subspace(ibcexported.ModuleName)
 paramsKeeper.Subspace(icahosttypes.SubModuleName)
 paramsKeeper.Subspace(tokenfactorytypes.ModuleName)
 paramsKeeper.Subspace(manifesttypes.ModuleName)
 paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
+paramsKeeper.Subspace(wasmtypes.ModuleName)
🧹 Nitpick comments (1)
app/app.go (1)

277-277: LGTM! WasmKeeper is properly initialized with all required dependencies.

The keeper is correctly configured with all necessary dependencies and the supported features list is comprehensive. However, consider extracting the supported features list to a constant for better maintainability.

+const SupportedWasmFeatures = []string{
+  "iterator",
+  "staking",
+  "stargate",
+  "cosmwasm_1_1",
+  "cosmwasm_1_2",
+  "cosmwasm_1_3",
+  "cosmwasm_1_4",
+  "cosmwasm_2_0",
+}

 app.WasmKeeper = wasmkeeper.NewKeeper(
   appCodec,
   runtime.NewKVStoreService(keys[wasmtypes.StoreKey]),
   app.AccountKeeper,
   app.BankKeeper,
   app.StakingKeeper,
   distrkeeper.NewQuerier(app.DistrKeeper),
   app.IBCKeeper.ChannelKeeper,
   app.IBCKeeper.ChannelKeeper,
   app.IBCKeeper.PortKeeper,
   scopedWasmKeeper,
   app.TransferKeeper,
   app.MsgServiceRouter(),
   app.GRPCQueryRouter(),
   filepath.Join(homePath, "wasm"),
   wasmConfig,
-  []string{"iterator", "staking", "stargate", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0"},
+  SupportedWasmFeatures,
   GetPoAAdmin(),
 )

Also applies to: 653-671

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4d49cd6 and 3a1c93e.

📒 Files selected for processing (3)
  • app/app.go (16 hunks)
  • app/test_helpers.go (3 hunks)
  • cmd/manifestd/cmd/root.go (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/test_helpers.go
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: e2e-tests (ictest-cosmwasm)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-tokenfactory)
  • GitHub Check: e2e-tests (ictest-poa)
  • GitHub Check: e2e-tests (ictest-ibc)
  • GitHub Check: build amd64 for linux
  • GitHub Check: build amd64 for darwin
  • GitHub Check: tests
  • GitHub Check: Analyze
  • GitHub Check: build
🔇 Additional comments (9)
cmd/manifestd/cmd/root.go (5)

16-17: LGTM! Import changes look good.

The new imports are correctly organized and necessary for the WASM integration.

Also applies to: 23-26


104-108: LGTM! Configuration initialization looks good.

The change correctly integrates WASM configuration with the existing CometBFT configuration.


133-133: Verify minimum gas price configuration.

The minimum gas price is set to "0stake", but based on past review comments, this value might need to match the validator minimum gas price (e.g., "0.0011umfx").


126-143: LGTM! WASM configuration structure looks good.

The function correctly:

  • Embeds the server config
  • Adds WASM configuration
  • Combines templates

145-148: LGTM! Flag initialization looks good.

The function correctly adds initialization flags for both crisis and WASM modules.

app/app.go (4)

138-140: LGTM! CosmWasm imports and module permissions are correctly configured.

The CosmWasm module is properly imported and the module account is correctly configured with burner capability for contract management.

Also applies to: 222-222


338-338: LGTM! Store key and capability scoping are correctly configured.

The wasm module's store key is properly added and the capability keeper is correctly scoped for the wasm module.

Also applies to: 387-387


970-991: LGTM! Ante handler is properly configured with wasm support.

The ante handler is correctly updated to include wasm configuration, with proper error handling in place.


761-776: LGTM! Module ordering is correctly configured.

The wasm module is properly added to begin blockers, end blockers, and init genesis orderings. The placement after other modules is appropriate as wasm contracts might depend on other module functionalities.

Also applies to: 823-823, 842-842, 869-869

app/app.go Outdated Show resolved Hide resolved
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: 0

♻️ Duplicate comments (3)
interchaintest/cosmwasm_test.go (3)

64-64: 🛠️ Refactor suggestion

Improve contract file handling.

The contract file path is hardcoded and lacks existence validation, which could lead to unclear errors if the file is missing.


132-132: ⚠️ Potential issue

Fix incorrect assertion after increment operation.

The test expects the count to be 0 after incrementing it, which is logically incorrect. After incrementing, the count should be 1.


137-137: 🛠️ Refactor suggestion

Handle cleanup errors properly.

The error from ic.Close() is silently ignored, which could hide cleanup issues.

🧹 Nitpick comments (1)
interchaintest/cosmwasm_test.go (1)

59-59: Follow Go naming conventions for variables.

Variables should follow Go naming conventions for abbreviations:

  • codeId should be codeID
  • codeIdStr should be codeIDStr

Also applies to: 66-66

🧰 Tools
🪛 golangci-lint (1.62.2)

[warning] 59-59: var-naming: var codeId should be codeID

(revive)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1c93e and c24a5b9.

📒 Files selected for processing (2)
  • interchaintest/cosmwasm_test.go (1 hunks)
  • interchaintest/setup.go (2 hunks)
🧰 Additional context used
🪛 golangci-lint (1.62.2)
interchaintest/setup.go

9-9: File is not gofumpt-ed

(gofumpt)

interchaintest/cosmwasm_test.go

139-139: File is not gofumpt-ed

(gofumpt)


[warning] 59-59: var-naming: var codeId should be codeID

(revive)


[warning] 66-66: var-naming: var codeIdStr should be codeIDStr

(revive)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: e2e-tests (ictest-cosmwasm)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-tokenfactory)
  • GitHub Check: e2e-tests (ictest-poa)
  • GitHub Check: e2e-tests (ictest-ibc)
  • GitHub Check: tests
🔇 Additional comments (4)
interchaintest/setup.go (1)

9-9: LGTM!

The CosmWasm integration changes are correctly implemented:

  1. Import statement follows Go conventions
  2. Interface registration is properly placed with other module registrations

Also applies to: 97-97

🧰 Tools
🪛 golangci-lint (1.62.2)

9-9: File is not gofumpt-ed

(gofumpt)

interchaintest/cosmwasm_test.go (3)

16-57: LGTM!

The test setup follows best practices with proper chain configuration and user setup.


74-92: LGTM!

The contract instantiation is well-implemented with proper error handling and assertions.


94-107: LGTM!

The query implementation is correct with proper JSON handling and response parsing.

@chalabi2 chalabi2 changed the title feat: add cosmwasm and integrate tests feat: add cosmwasm Feb 9, 2025
Copy link

codecov bot commented Feb 9, 2025

Codecov Report

Attention: Patch coverage is 73.45133% with 30 lines in your changes missing coverage. Please review.

Project coverage is 75.06%. Comparing base (2837427) to head (aa5c788).

Files with missing lines Patch % Lines
app/upgrades/next/upgrades.go 20.00% 12 Missing ⚠️
app/test_helpers.go 20.00% 8 Missing ⚠️
app/app.go 87.50% 4 Missing and 3 partials ⚠️
cmd/manifestd/cmd/root.go 85.71% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
- Coverage   77.85%   75.06%   -2.79%     
==========================================
  Files          33       33              
  Lines        2190     2282      +92     
==========================================
+ Hits         1705     1713       +8     
- Misses        397      478      +81     
- Partials       88       91       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

MODULE.md Outdated Show resolved Hide resolved
app/ante.go Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@@ -72,6 +72,10 @@ update_genesis '.app_state["staking"]["params"]["bond_denom"]="upoa"'
update_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]'
update_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]="250000"'

# Add CosmWasm configuration
update_genesis '.app_state["wasm"]["params"]["code_upload_access"]["permission"]="Everybody"'
Copy link
Collaborator

Choose a reason for hiding this comment

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

for local test nodes, yes this makes sense. mainnet, no. This is how I set it up for the hub as well. reduces pain for local devex

@@ -85,6 +85,11 @@ from_scratch () {
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]'
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]=2000000'

# WASM Configuration
update_test_genesis '.app_state["wasm"]["params"]["code_upload_access"]["permission"]="Everybody"'
Copy link
Collaborator

Choose a reason for hiding this comment

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

other comment, yes this is good for test_node for local devex

Copy link
Collaborator

Choose a reason for hiding this comment

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

you should add a readme for where this file is, which commit it was used to build, and the machine that built it (i.e. x86/64 or m1 mac)

Copy link
Collaborator

Choose a reason for hiding this comment

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

making a note for the future: when upgrade test are added, this sort of logic should be run before and after the upgrade as well

https://github.com/CosmosContracts/juno/blob/main/interchaintest/chain_upgrade_test.go#L110

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

🧹 Nitpick comments (3)
interchaintest/cosmwasm_test.go (3)

17-59: Consider making chain configuration more flexible and documented.

The test setup uses hardcoded values for validators and full nodes. Consider making these configurable and adding documentation to explain the configuration choices.

+// Default chain configuration values
+const (
+    defaultValidators = 1
+    defaultFullNodes = 1
+)

 func TestCosmWasm(t *testing.T) {
     ctx := context.Background()
 
     cfg := LocalChainConfig
     cfg.Name = "manifest-2"
     cfg.WithCodeCoverage()
 
+    // Chain configuration with customizable validator and full node counts
+    validators := defaultValidators
+    fullNodes := defaultFullNodes
     chains, err := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
         {
             Name:          "manifest",
             Version:       "local",
             ChainName:     cfg.ChainID,
-            NumValidators: &vals,
-            NumFullNodes:  &fullNodes,
+            NumValidators: &validators,
+            NumFullNodes:  &fullNodes,
             ChainConfig:   cfg,
         },
     }).Chains(t.Name())

60-74: Follow Go naming conventions for variables.

Variables should follow Go naming conventions. Rename variables to use proper capitalization for abbreviations.

-var codeId uint64
-var codeIdStr string
+var codeID uint64
+var codeIDStr string
🧰 Tools
🪛 golangci-lint (1.62.2)

[warning] 61-61: var-naming: var codeId should be codeID

(revive)


[warning] 68-68: var-naming: var codeIdStr should be codeIDStr

(revive)


17-141: Consider structuring tests to support future upgrade scenarios.

As noted in the PR comments, this test should be structured to support future upgrade tests. Consider extracting common contract operations into helper functions that can be reused before and after upgrades.

Here's a script to find similar upgrade test patterns in the codebase:

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Search for upgrade test patterns in the codebase
rg -l "upgrade.*test" --type go

Length of output: 33


Action Required: Enhance Test Structure for Future Upgrades

Our initial search did not reveal any existing upgrade test patterns in the codebase. Based on the provided snippet, contract operations (upload, instantiation, querying, execution) are implemented inline without being factored into reusable helpers. In order to smoothly integrate future upgrade tests, consider refactoring these operations into common helper functions that can be invoked both before and after upgrade procedures.

  • File: interchaintest/cosmwasm_test.go
  • Recommendation: Extract repetitive contract operations (upload, instantiate, query, execute) into helper functions to facilitate testing upgrade scenarios when needed.
🧰 Tools
🪛 golangci-lint (1.62.2)

[warning] 61-61: var-naming: var codeId should be codeID

(revive)


[warning] 68-68: var-naming: var codeIdStr should be codeIDStr

(revive)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ceabf4 and 5b315f0.

📒 Files selected for processing (1)
  • interchaintest/cosmwasm_test.go (1 hunks)
🧰 Additional context used
🪛 golangci-lint (1.62.2)
interchaintest/cosmwasm_test.go

[warning] 61-61: var-naming: var codeId should be codeID

(revive)


[warning] 68-68: var-naming: var codeIdStr should be codeIDStr

(revive)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: e2e-tests (ictest-cosmwasm)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-tokenfactory)
  • GitHub Check: e2e-tests (ictest-poa)
  • GitHub Check: e2e-tests (ictest-ibc)
  • GitHub Check: tests
  • GitHub Check: build
🔇 Additional comments (6)
interchaintest/cosmwasm_test.go (6)

1-15: LGTM!

The package structure and imports are well-organized and appropriate for the test.


66-67: Improve contract file handling.

The contract file path is hardcoded and lacks existence validation, which could lead to unclear errors if the file is missing.


76-94: LGTM!

The contract instantiation test is well-implemented with proper error handling and verification.


96-109: LGTM!

The query test implementation is correct with proper response handling and verification.


111-135: Fix incorrect assertion after increment operation.

The test expects the count to be 0 after incrementing it, which is logically incorrect. After incrementing, the count should be 1.


137-141: Handle cleanup errors properly.

The error from ic.Close() is silently ignored, which could hide cleanup issues.

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

♻️ Duplicate comments (3)
app/ante.go (1)

36-37: Add validation for new CosmWasm fields.

The new fields WasmConfig and TxCounterStoreKey should be validated in the NewAnteHandler function to ensure they are properly initialized.

Add these validations after line 52:

 	if options.CircuitKeeper == nil {
 		return nil, errors.New("circuit keeper is required for ante builder")
 	}
+	if options.WasmConfig == nil {
+		return nil, errors.New("wasm config is required for ante builder")
+	}
+	if options.TxCounterStoreKey == nil {
+		return nil, errors.New("store key is required for ante builder")
+	}

Committable suggestion skipped: line range outside the PR's diff.

app/app.go (2)

746-758: Remove duplicate wasm module registration.

The wasm module is registered twice:

  1. In the module manager list at line 746
  2. Explicitly after the module manager initialization at lines 750-758

This is redundant and could potentially cause issues.

Remove the duplicate registration:

-// Add wasm module to the app module manager
-app.ModuleManager.Modules[wasmtypes.ModuleName] = wasm.NewAppModule(
-  appCodec,
-  &app.WasmKeeper,
-  app.StakingKeeper,
-  app.AccountKeeper,
-  app.BankKeeper,
-  app.MsgServiceRouter(),
-  app.GetSubspace(wasmtypes.ModuleName),
-)
📝 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.

		wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
	)

653-671: Review the WasmKeeper initialization path.

The WasmKeeper initialization uses a joined path for the WASM directory, which could be risky when using a custom WasmVM generation. Consider using only the homePath.

Apply this diff:

-	filepath.Join(homePath, "wasm"),
+	homePath,

Also, consider using the standard capabilities list from wasmd:

-	[]string{"iterator", "staking", "stargate", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0"},
+	strings.Join(wasmapp.AllCapabilities(), ","),

Add the import:

+	wasmapp "github.com/CosmWasm/wasmd/app"
📝 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.

// Make sure to add the following import at the top of the file:
import (
	// ... other imports
	"strings"

	wasmapp "github.com/CosmWasm/wasmd/app"
)

...

	app.WasmKeeper = wasmkeeper.NewKeeper(
		appCodec,
		runtime.NewKVStoreService(keys[wasmtypes.StoreKey]),
		app.AccountKeeper,
		app.BankKeeper,
		app.StakingKeeper,
		distrkeeper.NewQuerier(app.DistrKeeper),
		app.IBCKeeper.ChannelKeeper,
		app.IBCKeeper.ChannelKeeper,
		app.IBCKeeper.PortKeeper,
		scopedWasmKeeper,
		app.TransferKeeper,
		app.MsgServiceRouter(),
		app.GRPCQueryRouter(),
		homePath,
		wasmConfig,
		strings.Join(wasmapp.AllCapabilities(), ","),
		GetPoAAdmin(),
	)
🧹 Nitpick comments (4)
MODULE.md (4)

6-41: Revise Table of Contents Structure
The updated TOC now comprehensively covers all modules—including the new COSM WASM Module—and details their respective subsections and commands. Please verify that all anchor links (e.g., #cosm-wasm-module, #module-functionality-3) correctly link to the corresponding sections further down in the document. Additionally, note that static analysis flagged potential duplication issues (e.g., at lines ~7, ~12, ~21, and ~35) and markdownlint warnings regarding trailing punctuation in some headings (e.g., the colon at the end of "Mint and disburse native tokens (payout):"). Confirm whether these are intentional (perhaps to mimic command syntax) or if they should be revised for consistency.

🧰 Tools
🪛 LanguageTool

[duplication] ~7-~7: Possible typo: you repeated a word.
Context: ... of Contents - Manifest Module - Module Functionality ...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~12-~12: Possible typo: you repeated a word.
Context: ...okens-burn-coins) - Proof of Authority Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~21-~21: Possible typo: you repeated a word.
Context: ...move-validator-remove) - Token Factory Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~35-~35: Possible typo: you repeated a word.
Context: ...-metadata-modify-metadata) - COSM WASM Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


157-157: Confirm Token Factory Note
The note added under the Token Factory Module—"The module is designed for handling tokens created by the module itself"—provides helpful context. Ensure that its placement and phrasing align with the intended documentation flow.


225-225: Fix Typo in Note
There is a typographical error in the note: "createor" should be corrected to "creator". This improvement will enhance the professionalism and clarity of the documentation.


255-316: Add CosmWasm Module Documentation
The new COSM WASM Module section is well structured and aligns with the PR objectives for integrating CosmWasm features. It clearly delineates the functionalities into Contract Deployment, Administration, and Execution, and provides practical command examples for each. Please review the heading texts—such as "Contract Deployment:", "Contract Administration:", "Contract Execution:", "Upload Contract (upload-contract):", "Instantiate Contract (instantiate-contract):", and "Execute Contract (execute-contract):"—since markdownlint advises against trailing punctuation in headings. Adjust these if the trailing colons are not intentional for clarity.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

263-263: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


269-269: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


276-276: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


284-284: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


294-294: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


306-306: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5b315f0 and 08fab80.

📒 Files selected for processing (3)
  • MODULE.md (3 hunks)
  • app/ante.go (4 hunks)
  • app/app.go (17 hunks)
🧰 Additional context used
🪛 LanguageTool
MODULE.md

[duplication] ~7-~7: Possible typo: you repeated a word.
Context: ... of Contents - Manifest Module - Module Functionality ...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~12-~12: Possible typo: you repeated a word.
Context: ...okens-burn-coins) - Proof of Authority Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~21-~21: Possible typo: you repeated a word.
Context: ...move-validator-remove) - Token Factory Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)


[duplication] ~35-~35: Possible typo: you repeated a word.
Context: ...-metadata-modify-metadata) - COSM WASM Module - Module Functionality...

(ENGLISH_WORD_REPEAT_RULE)

🪛 markdownlint-cli2 (0.17.2)
MODULE.md

263-263: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


269-269: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


276-276: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


284-284: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


294-294: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


306-306: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

🪛 golangci-lint (1.62.2)
app/ante.go

19-19: 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/[email protected]/x/wasm/keeper/test_common.go:386:3: cannot use runtime.NewKVStoreService(keys[types.StoreKey]) (value of 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/[email protected]/x/wasm/keeper/test_common.go:400:3: cannot use availableCapabilities (variable of type []string) as string value in argument to NewKeeper)

(typecheck)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: e2e-tests (ictest-cosmwasm)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-tokenfactory)
  • GitHub Check: e2e-tests (ictest-poa)
  • GitHub Check: e2e-tests (ictest-ibc)
  • GitHub Check: build
🔇 Additional comments (3)
app/ante.go (1)

70-71: LGTM! The new decorators are properly integrated.

The addition of LimitSimulationGasDecorator and CountTXDecorator enhances the ante handler with CosmWasm-specific functionality:

  • Gas limiting during simulations
  • Transaction counting
app/app.go (2)

338-338: LGTM! Store key and capability setup is correct.

The CosmWasm store key is properly registered and the capability keeper is correctly scoped for the wasm module.

Also applies to: 387-387


761-776: LGTM! Module ordering is correct.

The wasm module is properly added to:

  • Begin blockers
  • End blockers
  • Init genesis

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

🧹 Nitpick comments (1)
Makefile (1)

123-125: Ensure New CosmWasm Test Target is Properly Integrated

The new target ictest-cosmwasm is correctly defined to run the CosmWasm end-to-end test with race detection and verbose output. One suggestion is to add this target to the .PHONY declaration to guarantee that Make interprets it as a command, not as a file. This would bring it in line with the other test targets and avoid potential issues.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 08fab80 and 992ccb6.

⛔ Files ignored due to path filters (3)
  • go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
  • interchaintest/go.sum is excluded by !**/*.sum
📒 Files selected for processing (18)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/codeql.yml (1 hunks)
  • .github/workflows/e2e.yml (3 hunks)
  • .github/workflows/release-bin.yaml (1 hunks)
  • .github/workflows/simulation.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • Dockerfile (2 hunks)
  • Makefile (2 hunks)
  • app/ante.go (4 hunks)
  • app/app.go (17 hunks)
  • app/upgrades/next/upgrades.go (3 hunks)
  • app/upgrades/types.go (1 hunks)
  • cmd/manifestd/cmd/root.go (3 hunks)
  • go.mod (10 hunks)
  • interchaintest/go.mod (8 hunks)
  • interchaintest/setup.go (2 hunks)
  • network/manifest-1/GENESIS.md (1 hunks)
  • network/manifest-1/POST_GENESIS.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • app/upgrades/types.go
  • interchaintest/setup.go
  • Dockerfile
  • .github/workflows/e2e.yml
  • interchaintest/go.mod
  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: e2e-tests (ictest-cosmwasm)
  • GitHub Check: e2e-tests (ictest-group-poa)
  • GitHub Check: e2e-tests (ictest-manifest)
  • GitHub Check: e2e-tests (ictest-tokenfactory)
  • GitHub Check: e2e-tests (ictest-poa)
  • GitHub Check: e2e-tests (ictest-ibc)
  • GitHub Check: build
🔇 Additional comments (19)
.github/workflows/test.yml (1)

12-13: Update GO_VERSION for Unit Tests Workflow
The GO_VERSION variable has been updated to 1.23.6, which aligns with the other workflows. This consistency helps ensure that unit tests are run in the same environment as the rest of the CI/CD pipeline.

.github/workflows/release-bin.yaml (1)

21-24: Update Go Setup Version in Release Workflow
The go-version parameter for the Go setup action is updated to 1.23.6 (line 23). This change is consistent with the other workflow files and should ensure that release binaries are built with the expected Go version.

🧰 Tools
🪛 actionlint (1.7.4)

21-21: the runner of "actions/setup-go@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

.github/workflows/simulation.yml (1)

12-13: Consistent Update of GO_VERSION in Simulation Tests
The environment variable GO_VERSION is now set to 1.23.6, ensuring that simulation tests run using the updated Go version. This update maintains consistency with the rest of the workflows.

.github/workflows/build.yml (1)

16-18: Update of GO_VERSION in Build Workflow
The GO_VERSION environment variable has been updated to 1.23.6 (line 17) and is correctly referenced in the Go setup step. This ensures that both build and tidy jobs use the updated Go version.

.github/workflows/codeql.yml (1)

16-18: Updated GO_VERSION for CodeQL Analysis
The environment variable update to 1.23.6 in the CodeQL workflow ensures that the analysis is performed with the same Go version as the rest of the CI/CD pipelines. This change is straightforward and consistent.

network/manifest-1/GENESIS.md (1)

32-33: Updated Go Version Prerequisite

The prerequisite line has been updated from go1.22+ to go1.23+, which is consistent with the changes in other parts of the project. This ensures that users have the correct Go version required for the new CosmWasm functionality and overall compatibility.

network/manifest-1/POST_GENESIS.md (1)

25-25: Aligned Prerequisite Specification

The update in the dependencies section from go1.22+ to go1.23+ aligns with the changes in GENESIS.md and the overall project requirements. This consistency across documentation clearly informs users of the minimum Go version needed.

app/upgrades/next/upgrades.go (2)

22-24: LGTM! CosmWasm module store added correctly.

The CosmWasm module store is properly added to the upgrade handler.


41-48: Verify the restrictive CosmWasm permissions.

The CosmWasm parameters are set with restrictive permissions:

  • AllowNobody for code upload: Only governance can upload code
  • AccessTypeAnyOfAddresses for contract instantiation: Only specified addresses can instantiate contracts

Please confirm if these restrictive permissions align with the project's security requirements.

app/ante.go (2)

36-38: LGTM! CosmWasm fields added to HandlerOptions.

The required CosmWasm fields are properly added to HandlerOptions.


71-74: LGTM! CosmWasm decorators added in correct order.

The CosmWasm decorators are added in the correct order:

  1. LimitSimulationGasDecorator: Limits gas during simulation
  2. CountTXDecorator: Counts transactions
  3. GasRegisterDecorator: Registers gas consumption
  4. TxContractsDecorator: Validates contract-related transactions
cmd/manifestd/cmd/root.go (3)

127-130: LGTM! CustomAppConfig properly includes WASM config.

The CustomAppConfig correctly embeds the server config and includes the WASM node config.


132-133: Review min gas prices configuration.

The min gas prices are set to "0stake". This might need to be adjusted based on your tokenomics and to prevent spam transactions.


145-148: LGTM! Module init flags added correctly.

Both crisis and wasm module init flags are properly added to the start command.

app/app.go (4)

222-222: LGTM! Wasm module permissions set correctly.

The wasm module is granted the burner permission, which is appropriate for contract-related operations.


655-674: LGTM! WasmKeeper initialized with all required dependencies.

The WasmKeeper is properly initialized with all necessary dependencies:

  • Account, Bank, and Staking keepers for basic operations
  • IBC-related keepers for cross-chain functionality
  • Message and query routers for contract execution
  • Proper configuration and capabilities

797-797: LGTM! Wasm module added to all required execution stages.

The wasm module is correctly added to:

  • BeginBlockers
  • EndBlockers
  • InitGenesis order

Also applies to: 816-816, 843-843


944-950: LGTM! Ante handler properly configured with WASM config.

The ante handler is correctly configured to read and use the WASM configuration.

Makefile (1)

222-224: GolangCI-Lint Version Update Verification

The update of golangci_version to v1.63.4 aligns with linter improvements and bug fixes. Please verify that this newer version does not introduce any conflicts with your custom lint rules or workflow, and that it continues to run smoothly within your CI/CD pipeline.

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.

3 participants