Skip to content

Conversation

@jvr0x
Copy link
Contributor

@jvr0x jvr0x commented Jun 27, 2025

This PR adds a workflow to test cosmwasm actions on chain (dukong) using the wasm-testing repo.

Summary by CodeRabbit

  • Chores
    • Added a new automated workflow to test CosmWasm smart contracts on a local blockchain instance during code pushes, pull requests, and manual triggers.
    • Workflow uploads test results and logs for review after each run.
  • New Features
    • Introduced end-to-end tests for CosmWasm smart contracts covering deployment, execution, and interaction with token factory modules.
    • Enabled ERC20 token integration for newly created denoms, including event emission with Ethereum token address.
  • Bug Fixes & Improvements
    • Updated blockchain node configuration for faster block times and streamlined proposal handling.
    • Enhanced CLI commands for token factory with gas management and improved address handling.
  • Documentation
    • Expanded development documentation with detailed instructions for running end-to-end tests and linting.

@coderabbitai
Copy link

coderabbitai bot commented Jun 27, 2025

"""

Walkthrough

A new GitHub Actions workflow named "Test CosmWasm on chain" has been added. It sets up a local Mantra blockchain node, configures the environment, runs CosmWasm contract tests using scripts from a separate repository, and uploads test artifacts and logs. The workflow is triggered on pushes, pull requests, and manual dispatches.

Changes

File(s) Change Summary
.github/workflows/test-cosmwasm-onchain.yml Added new workflow for automated testing of CosmWasm contracts on a local Mantra blockchain node
Dockerfile, Makefile Downgraded CosmWasm wasmvm module version from v3 to v2 for libwasmvm version resolution
README.md Expanded Development section with detailed Testing and Linter instructions
app/app.go Added Erc20Keeper integration to TokenFactoryKeeper and WasmKeeper constructors; removed placeholder nil argument
app/queries/queries.go, x/tokenfactory/keeper/before_send.go, x/tokenfactory/types/before_send.go Changed CosmWasm wasmvm import from v3 to v2
cmd/mantrachaind/cmd/commands.go Added imports; changed mempool to no-op; added crisis module init flags; set proposal handlers in baseapp options
cmd/mantrachaind/cmd/root.go Replaced app.NoOpEvmAppOptions with app.EvmAppOptions in NewRootCmd
go.mod Upgraded/downgraded multiple dependencies including CosmWasm wasmd (to v0.60.1) and wasmvm (to v2.2.4)
tests/connect/connect_integration_test.go Updated oracle sidecar image version; added feemarket genesis params; added coinDecimals to ChainConfig
tests/e2e/chain.go Registered wasm and tokenfactory interfaces in encoding config
tests/e2e/e2e_cosmwasm_test.go Added new end-to-end tests for CosmWasm contracts: query params, store code, instantiate, execute simple and tokenfactory interaction
tests/e2e/e2e_exec_test.go Added helper methods to execute wasm store, instantiate, and execute tx commands; updated executeTxCommand to return tx hash
tests/e2e/e2e_setup_test.go Added testOnSingleNode flag; conditional setup and teardown of chain B and relayer based on this flag
tests/e2e/e2e_test.go Added runWasmTest constant; added CanTestOnSingleNode method; extended TestTokenfactory; added TestWasm test suite
tests/e2e/e2e_tokenfactory_test.go Refactored address handling; added helper functions; added tests for denom admin and metadata setting; added gas flags
tests/e2e/query.go Added safer error handling in queryTx; added queryTxEvents and multiple tokenfactory and wasm query functions
x/tokenfactory/keeper/createdenom.go Integrated ERC20 token creation and dynamic precompiles enabling during denom creation; set denom metadata name
x/tokenfactory/keeper/keeper.go Added erc20Keeper field to Keeper struct; updated NewKeeper constructor to accept erc20Keeper
x/tokenfactory/keeper/msg_server.go Added new_token_eth_addr attribute with ERC20 contract address to denom creation event
x/tokenfactory/types/events.go Added constant AttributeNewTokenEthAddr for new token ERC20 address event attribute
x/tokenfactory/types/expected_keepers.go Added ERC20Keeper interface with SetToken and EnableDynamicPrecompiles methods; added related imports

Poem

🐇 Hopping through code with a twitch of my nose,
New tests and new tokens in neat little rows.
Wasm contracts now dance with ERC20 flair,
Chains spin and nodes hum with meticulous care.
From genesis to queries, the warren expands,
With every new change, we leap with our hands! 🥕✨
"""

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/cosmwasm-tests

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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch 3 times, most recently from bc5da0d to 3fa0aeb Compare June 27, 2025 15:33
run: |
cd wasm-testing
./scripts/test_ci.sh \
-r "http://localhost:26657" \

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
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: 5

🧹 Nitpick comments (3)
.github/workflows/test-cosmwasm-onchain.yml (3)

119-124: CORS and API flags are enabled with unsafe settings

This is fine for CI, but double-check no production workflows re-use this file or these overrides will leak an open API with permissive CORS.


170-177: Graceful shutdown: ensure PID env exists before kill

If the node fails to start, MANTRACHAIND_PID will be empty and kill will exit non-zero (even with || true the message can be misleading). Consider skipping when unset.


178-188: Artifact upload may fail when directory is absent

If tests exit early, wasm-testing/artifacts/ may not exist and the upload step aborts the job. Add if-no-files-found: ignore.

        with:
           name: test-results-${{ github.run_number }}
           path: |
             wasm-testing/artifacts/
             wasm-testing/*.log
             ${{ runner.temp }}/mantrachaind.log
+          if-no-files-found: ignore
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 710f220 and cf8d8df.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

57-57: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


68-68: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


76-76: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


196-196: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


209-209: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 136-136: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 145-145: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 163-163: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: integration_tests (all)
  • GitHub Check: govulncheck_job
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: build
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: lint
  • GitHub Check: test
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: Analyze (go)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

Comment on lines 196 to 327
path: |
wasm-testing/artifacts/
~/.cache/
${{ runner.temp }}/mantrachaind.log
${{ runner.home }}/.mantrachaind/config/
retention-days: 14
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

${{ runner.home }} is invalid – use $HOME

runner context doesn’t expose home; the step will fail path expansion. Replace with the POSIX $HOME env var or hard-coded path used earlier.

-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/.mantrachaind/config/

Also applies to: 208-211

🧰 Tools
🪛 actionlint (1.7.7)

196-196: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml around lines 196 to 201 and also
lines 208 to 211, the path uses the invalid expression `${{ runner.home }}`
which is not available in the runner context and will cause path expansion to
fail. Replace `${{ runner.home }}` with the POSIX environment variable `$HOME`
to correctly reference the user's home directory in the path entries.

Comment on lines +35 to +37
with:
go-version: 1.23

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use a released Go version – 1.23 will break the build

actions/setup-go will fail because Go 1.23 has not been released yet.
Pin to the latest stable line (or stable) instead.

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          # Use the latest stable Go toolchain
+          go-version: 'stable'
📝 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
with:
go-version: 1.23
- uses: actions/setup-go@v5
with:
# Use the latest stable Go toolchain
go-version: 'stable'
🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml around lines 35 to 37, the Go
version is set to 1.23, which is not yet released and causes the build to fail.
Change the go-version value from 1.23 to a released stable version such as
'1.22' or use 'stable' to ensure compatibility and successful setup by
actions/setup-go.

Comment on lines +68 to +87
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Migrate caches to actions/cache@v4

Both cache steps still reference v3, which is flagged for the same Node 12 issue.

-      - name: Cache cargo registry
-        uses: actions/cache@v3
+      - name: Cache cargo registry
+        uses: actions/cache@v4
...
-      - name: Cache cargo index
-        uses: actions/cache@v3
+      - name: Cache cargo index
+        uses: actions/cache@v4
📝 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
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
🧰 Tools
🪛 actionlint (1.7.7)

68-68: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


76-76: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml between lines 68 and 82, update
both cache steps to use actions/cache@v4 instead of v3 to avoid the Node 12
compatibility issue. Change the uses field from actions/cache@v3 to
actions/cache@v4 for both cargo registry and cargo index cache steps.

Comment on lines +57 to +67
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update actions-rs/toolchain – current tag still runs on Node 12

actionlint flags this because actions-rs/toolchain@v1 hasn’t been re-built for Node 20.
Pin to the latest patch tag (≥ v1.0.7) or SHA.

-      - name: Install Rust
-        uses: actions-rs/toolchain@v1
+      - name: Install Rust
+        # Node-20 compatible release
+        uses: actions-rs/[email protected]
📝 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
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install Rust
# Node-20 compatible release
uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
components: rustfmt, clippy
🧰 Tools
🪛 actionlint (1.7.7)

57-57: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml around lines 57 to 62, the usage
of actions-rs/toolchain@v1 is outdated and runs on Node 12, causing actionlint
warnings. Update the action reference to use the latest patch version tag at or
above v1.0.7 or use a specific commit SHA to ensure compatibility with Node 20.

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch from cf8d8df to e582a83 Compare July 2, 2025 12:21
# Wait for node to start with better error handling
echo "Waiting for node to start..."
for i in {1..60}; do
if curl -s http://localhost:26657/status > /dev/null 2>&1; then

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
if curl -s http://localhost:26657/status > /dev/null 2>&1; then
echo "Node is running!"
echo "Node status:"
curl -s http://localhost:26657/status | jq '.result.sync_info'

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
done
# Final verification
if ! curl -s http://localhost:26657/status > /dev/null 2>&1; then

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
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: 2

♻️ Duplicate comments (3)
.github/workflows/test-cosmwasm-onchain.yml (3)

61-66: Out-of-date actions-rs/toolchain@v1 still drags Node 12
Pin to ≥ v1.0.7 (or SHA) to silence actionlint & future-proof the workflow.
Example:

-        uses: actions-rs/toolchain@v1
+        uses: actions-rs/[email protected]

71-86: Cache steps still use actions/cache@v3
v3 is deprecated for Node 12 – migrate both caches to v4.

-        uses: actions/cache@v3
+        uses: actions/cache@v4

Apply to both registry and index blocks.


34-36: Go 1.23 is still unreleased – the job will fail
actions/setup-go cannot provision 1.23, so the build will break exactly at this step.
Reuse the earlier fix:

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          go-version: 'stable'   # or pin to 1.22.x
🧹 Nitpick comments (1)
.github/workflows/test-cosmwasm-onchain.yml (1)

178-187: Hard-coded seed phrase checked into CI

Leaving the BIP-39 seed in plaintext may be acceptable for ephemeral CI, but double-check it is not reused elsewhere. If possible, load it from an encrypted secret to avoid accidental leakage.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between cf8d8df and e582a83.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

61-61: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


72-72: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


80-80: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


205-205: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


217-217: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


230-230: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 143-143: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 146-146: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 162-162: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 184-184: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: integration_tests (all)
  • GitHub Check: test
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: Analyze (go)
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: govulncheck_job
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

Comment on lines 135 to 172
mantrachaind start --home $HOME/.mantrachaind --log_level info > $HOME/mantrachaind.log 2>&1 &
MANTRACHAIND_PID=$!
echo "MANTRACHAIND_PID=$MANTRACHAIND_PID" >> $GITHUB_ENV
echo "Started mantrachaind with PID: $MANTRACHAIND_PID"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Log file is written to $HOME but later uploaded from ${{ runner.home }}
The mismatch means artifacts won’t contain the node log. Stick to one path (recommend $HOME as you already use it):

-          mantrachaind start --home $HOME/.mantrachaind --log_level info > $HOME/mantrachaind.log 2>&1 &
+          mantrachaind start --home $HOME/.mantrachaind --log_level info > $HOME/mantrachaind.log 2>&1 &

(no change here – just noting for the artifact fix below)

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

🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml around lines 135 to 138, the
mantrachaind log file is written to $HOME but later uploaded from ${{
runner.home }}, causing a path mismatch and missing logs in artifacts. To fix
this, ensure the log file path used for writing and uploading artifacts is
consistent by using $HOME in both places.

Comment on lines +200 to +338
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ github.run_number }}
path: |
wasm-testing/artifacts/
wasm-testing/*.log
${{ runner.home }}/mantrachaind.log
retention-days: 7

# Upload logs on failure
- name: Upload logs on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: failure-logs-${{ github.run_number }}
path: |
wasm-testing/artifacts/
~/.cache/
${{ runner.home }}/mantrachaind.log
${{ runner.home }}/.mantrachaind/config/
retention-days: 14

# Upload node logs
- name: Upload node logs
uses: actions/upload-artifact@v4
if: always()
with:
name: node-logs-${{ github.run_number }}
path: |
${{ runner.home }}/.mantrachaind/config/
${{ runner.home }}/mantrachaind.log
retention-days: 7
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

${{ runner.home }} is invalid – artifact upload will explode

runner.home is not available in the context. Use $HOME (or ${{ runner.temp }}) consistently.

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log
@@
-            ${{ runner.home }}/mantrachaind.log
-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/mantrachaind.log
+            $HOME/.mantrachaind/config/
@@
-            ${{ runner.home }}/.mantrachaind/config/
-            ${{ runner.home }}/mantrachaind.log
+            $HOME/.mantrachaind/config/
+            $HOME/mantrachaind.log

This fix must be applied to all three artifact steps.

📝 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
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ github.run_number }}
path: |
wasm-testing/artifacts/
wasm-testing/*.log
${{ runner.home }}/mantrachaind.log
retention-days: 7
# Upload logs on failure
- name: Upload logs on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: failure-logs-${{ github.run_number }}
path: |
wasm-testing/artifacts/
~/.cache/
${{ runner.home }}/mantrachaind.log
${{ runner.home }}/.mantrachaind/config/
retention-days: 14
# Upload node logs
- name: Upload node logs
uses: actions/upload-artifact@v4
if: always()
with:
name: node-logs-${{ github.run_number }}
path: |
${{ runner.home }}/.mantrachaind/config/
${{ runner.home }}/mantrachaind.log
retention-days: 7
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ github.run_number }}
path: |
wasm-testing/artifacts/
wasm-testing/*.log
$HOME/mantrachaind.log
retention-days: 7
# Upload logs on failure
- name: Upload logs on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: failure-logs-${{ github.run_number }}
path: |
wasm-testing/artifacts/
~/.cache/
$HOME/mantrachaind.log
$HOME/.mantrachaind/config/
retention-days: 14
# Upload node logs
- name: Upload node logs
uses: actions/upload-artifact@v4
if: always()
with:
name: node-logs-${{ github.run_number }}
path: |
$HOME/.mantrachaind/config/
$HOME/mantrachaind.log
retention-days: 7
🧰 Tools
🪛 actionlint (1.7.7)

205-205: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


217-217: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


230-230: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml between lines 200 and 233, the
artifact upload steps incorrectly use the non-existent variable `${{ runner.home
}}` which causes failures. Replace all instances of `${{ runner.home }}` with
the correct environment variable `$HOME` to ensure the paths resolve properly.
Apply this change consistently in all three artifact upload steps to fix the
issue.

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch from e582a83 to 44c9f7a Compare July 2, 2025 13:15
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 (4)
.github/workflows/test-cosmwasm-onchain.yml (4)

34-36: Pin to a released Go version – 1.23 will break the build

actions/setup-go cannot install an unreleased toolchain. Use stable or the latest minor (1.22.x) to keep the workflow green.

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          # Use the latest stable Go toolchain
+          go-version: 'stable'

67-71: Update actions-rs/toolchain – current tag still runs on Node 12

actionlint warns because actions-rs/toolchain@v1 is built on the deprecated Node 12 runtime. Pin to a Node-20–compatible release.

-      - name: Install Rust
-        uses: actions-rs/toolchain@v1
+      - name: Install Rust
+        uses: actions-rs/[email protected]

77-91: Migrate caches to actions/cache@v4

Both cache steps still use v3, triggering Node-12 deprecation warnings.

-      - name: Cache cargo registry
-        uses: actions/cache@v3
+      - name: Cache cargo registry
+        uses: actions/cache@v4
@@
-      - name: Cache cargo index
-        uses: actions/cache@v3
+      - name: Cache cargo index
+        uses: actions/cache@v4

210-239: ${{ runner.home }} is not a valid context – artifacts won’t upload

runner.home does not exist; use $HOME or ${{ runner.temp }} instead. Apply the change to all three artifact steps.

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log
@@
-            ${{ runner.home }}/mantrachaind.log
-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/mantrachaind.log
+            $HOME/.mantrachaind/config/
@@
-            ${{ runner.home }}/.mantrachaind/config/
-            ${{ runner.home }}/mantrachaind.log
+            $HOME/.mantrachaind/config/
+            $HOME/mantrachaind.log
🧹 Nitpick comments (2)
.github/workflows/test-cosmwasm-onchain.yml (2)

110-113: Hard-coded "uom" breaks configurability – use $DENOM

Keep genesis edits data-driven so future denom changes require no code touch.

-          sed -i 's/"bond_denom": "stake"/"bond_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
-          sed -i 's/"mint_denom": "stake"/"mint_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
+          sed -i "s/\"bond_denom\": \"stake\"/\"bond_denom\": \"${DENOM}\"/g" $HOME/.mantrachaind/config/genesis.json
+          sed -i "s/\"mint_denom\": \"stake\"/\"mint_denom\": \"${DENOM}\"/g" $HOME/.mantrachaind/config/genesis.json

44-47: Trailing whitespace & pipe-to-bash installer

Line 47 contains trailing spaces flagged by YAMLlint, and piping remote scripts to bash can be brittle. Consider using an apt package or a pinned release binary instead.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between e582a83 and 44c9f7a.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

67-67: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


78-78: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


86-86: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


211-211: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


223-223: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


236-236: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 149-149: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 152-152: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 168-168: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 190-190: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

🪛 YAMLlint (1.37.1)
.github/workflows/test-cosmwasm-onchain.yml

[error] 47-47: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: integration_tests (all)
  • GitHub Check: test
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: test
  • GitHub Check: build
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: lint
  • GitHub Check: Analyze (go)
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: govulncheck_job
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: test
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch from 44c9f7a to 1f003c8 Compare July 2, 2025 13:33
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 (4)
.github/workflows/test-cosmwasm-onchain.yml (4)

34-37: Pin to a released Go version – 1.23 does not exist

The job will fail because Go 1.23 hasn’t been released yet.
Use the latest stable toolchain or an existing minor version.

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          # Use the latest stable Go toolchain
+          go-version: 'stable'

66-71: Update actions-rs/toolchain to a Node-20 compatible tag

actions-rs/toolchain@v1 still ships Node 12 and is flagged by actionlint.
Bump to the latest patch (v1.0.7+) or pin a SHA.

-      - name: Install Rust
-        uses: actions-rs/toolchain@v1
+      - name: Install Rust
+        # Node-20 compatible release
+        uses: actions-rs/[email protected]

76-92: Migrate cache steps to actions/cache@v4

v3 actions run on the retired Node 12 runtime and will soon be removed.

-      - name: Cache cargo registry
-        uses: actions/cache@v3
+      - name: Cache cargo registry
+        uses: actions/cache@v4
...
-      - name: Cache cargo index
-        uses: actions/cache@v3
+      - name: Cache cargo index
+        uses: actions/cache@v4

208-241: ${{ runner.home }} is invalid – artifact paths will break

The runner context exposes temp, tool_cache, etc., but not home.
Use $HOME (or ${{ runner.temp }}) consistently – the upload will currently fail.

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log
@@
-            ${{ runner.home }}/mantrachaind.log
-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/mantrachaind.log
+            $HOME/.mantrachaind/config/
@@
-            ${{ runner.home }}/.mantrachaind/config/
-            ${{ runner.home }}/mantrachaind.log
+            $HOME/.mantrachaind/config/
+            $HOME/mantrachaind.log
🧹 Nitpick comments (1)
.github/workflows/test-cosmwasm-onchain.yml (1)

111-130: Avoid hard-coding the denomination – reuse the DENOM env var

Keeping "uom" inline makes future chain-param changes error-prone.
Template with env.DENOM instead.

-          sed -i 's/"bond_denom": "stake"/"bond_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
-          sed -i 's/"mint_denom": "stake"/"mint_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
+          sed -i "s/\"bond_denom\": \"stake\"/\"bond_denom\": \"${{ env.DENOM }}\"/g" \
+            $HOME/.mantrachaind/config/genesis.json
+          sed -i "s/\"mint_denom\": \"stake\"/\"mint_denom\": \"${{ env.DENOM }}\"/g" \
+            $HOME/.mantrachaind/config/genesis.json
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 44c9f7a and 1f003c8.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

67-67: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


78-78: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


86-86: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


213-213: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


225-225: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


238-238: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 149-149: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 152-152: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 168-168: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 192-192: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: integration_tests (all)
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: govulncheck_job
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: Analyze (go)
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: test
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch 2 times, most recently from 6b13b7c to 0308954 Compare July 2, 2025 14:39
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

♻️ Duplicate comments (4)
.github/workflows/test-cosmwasm-onchain.yml (4)

34-36: Unreleased Go version will break setup-go
Go 1.23 isn’t out yet; the action will fail to download it. Pin to stable or a released version (e.g. 1.22).

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          go-version: 'stable'   # or an explicit released version

62-67: actions-rs/toolchain@v1 still runs on Node 12
Upgrade to ≥ v1.0.7 (or pin a SHA) to avoid runtime deprecation issues.

-      - name: Install Rust
-        uses: actions-rs/toolchain@v1
+      - name: Install Rust
+        uses: actions-rs/[email protected]

72-87: Cache steps should migrate to actions/cache@v4
v3 is flagged for the Node 12 retirement and will soon stop working.
Update both cache steps accordingly.


208-239: ${{ runner.home }} is undefined – artifact uploads will fail
Replace every occurrence of ${{ runner.home }} with $HOME (or ${{ runner.temp }}).

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log
@@
-            ${{ runner.home }}/mantrachaind.log
-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/mantrachaind.log
+            $HOME/.mantrachaind/config/
@@
-            ${{ runner.home }}/.mantrachaind/config/
-            ${{ runner.home }}/mantrachaind.log
+            $HOME/.mantrachaind/config/
+            $HOME/mantrachaind.log
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6b13b7c and 0308954.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

62-62: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


73-73: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


81-81: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


211-211: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


223-223: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


236-236: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 144-144: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 147-147: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 163-163: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 190-190: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Analyze (go)
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: integration_tests (all)
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: test
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: lint
  • GitHub Check: govulncheck_job
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: build
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

Comment on lines +39 to +42
- name: Install just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Piping remote script into bash is a supply-chain risk
Fetching install.sh over HTTPS and executing it blindly can compromise the runner if the endpoint is hijacked. Prefer a pinned checksum or a verified release binary:

-      - name: Install just
-        run: |
-          curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
+      - name: Install just
+        run: |
+          curl -sL https://github.com/casey/just/releases/download/1.25.0/just-1.25.0-x86_64-unknown-linux-musl.tar.gz -o /tmp/just.tar.gz \
+          && echo "08b35b...  /tmp/just.tar.gz" | sha256sum -c - \
+          && tar -xzf /tmp/just.tar.gz -C /usr/local/bin just

(Adapt the version & checksum to your needs.)

📝 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
- name: Install just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
- name: Install just
run: |
curl -sL https://github.com/casey/just/releases/download/1.25.0/just-1.25.0-x86_64-unknown-linux-musl.tar.gz -o /tmp/just.tar.gz \
&& echo "08b35b... /tmp/just.tar.gz" | sha256sum -c - \
&& tar -xzf /tmp/just.tar.gz -C /usr/local/bin just
🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml around lines 39 to 42, the
current step pipes a remote install script directly into bash, which is a
supply-chain risk. To fix this, download the install.sh script first, verify its
checksum against a known good value, and only then execute it. Alternatively,
use a pinned version of the just binary or a verified release binary instead of
running the script blindly from the internet.

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch from 0308954 to 4888f09 Compare July 2, 2025 14:48
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 (5)
.github/workflows/test-cosmwasm-onchain.yml (5)

34-37: Pin to a released Go version (1.23 is still unreleased)
actions/setup-go cannot install a non-existent release – the job will fail as soon as it tries to fetch 1.23.

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          # Latest stable toolchain
+          go-version: 'stable'

39-42: Avoid piping a remote script directly into bash – pin & verify instead
Blindly executing install.sh is a supply-chain risk. Download, checksum-verify and run, or fetch a pinned release tarball as suggested earlier.


62-67: actions-rs/toolchain@v1 still ships a Node 12 runtime
Use a Node-20-ready tag (≥ v1.0.7) or SHA to silence the Action lint error.


72-87: Migrate both cache steps to actions/cache@v4
v3 is deprecated for the same Node 12 reason – CI will warn or fail soon.


208-242: ${{ runner.home }} is invalid – all three artifact uploads will break

Replace every occurrence with $HOME (or ${{ runner.temp }}) to ensure the paths resolve:

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log
@@
-            ${{ runner.home }}/mantrachaind.log
-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/mantrachaind.log
+            $HOME/.mantrachaind/config/
@@
-            ${{ runner.home }}/.mantrachaind/config/
-            ${{ runner.home }}/mantrachaind.log
+            $HOME/.mantrachaind/config/
+            $HOME/mantrachaind.log
🧹 Nitpick comments (1)
.github/workflows/test-cosmwasm-onchain.yml (1)

105-108: Hard-coding "uom" reduces reusability – parameterise with $DENOM
A single env variable already defines the denomination; keep all sed replacements in sync with it:

-          sed -i 's/"bond_denom": "stake"/"bond_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
-          sed -i 's/"mint_denom": "stake"/"mint_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
+          sed -i "s/\"bond_denom\": \"stake\"/\"bond_denom\": \"${DENOM}\"/g" $HOME/.mantrachaind/config/genesis.json
+          sed -i "s/\"mint_denom\": \"stake\"/\"mint_denom\": \"${DENOM}\"/g"  $HOME/.mantrachaind/config/genesis.json
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 0308954 and 4888f09.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

62-62: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


73-73: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


81-81: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


214-214: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


226-226: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


239-239: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 144-144: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 147-147: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 163-163: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 193-193: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: govulncheck_job
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: test
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: lint
  • GitHub Check: integration_tests (all)
  • GitHub Check: test
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: Analyze (go)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch 2 times, most recently from c417395 to 02a887a Compare July 2, 2025 15:01
# Add debugging before running the test
echo "=== Checking node status before running tests ==="
curl -s http://localhost:26657/status | jq '.result.sync_info'

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
echo "=== Checking node status before running tests ==="
curl -s http://localhost:26657/status | jq '.result.sync_info'
echo "=== Checking node mempool ==="
curl -s http://localhost:26657/num_unconfirmed_txs || echo "Mempool query failed"

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
sleep 3
echo "=== Node status after test transaction ==="
curl -s http://localhost:26657/status | jq '.result.sync_info'

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch 2 times, most recently from 31a9f4e to 75f13dc Compare July 2, 2025 15:58
# Debug node status before running tests
echo "=== NODE STATUS DEBUG ==="
curl -s http://localhost:26657/status | jq '.result.sync_info' || echo "Status check failed"

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
echo "=== NODE STATUS DEBUG ==="
curl -s http://localhost:26657/status | jq '.result.sync_info' || echo "Status check failed"
echo "=== MEMPOOL STATUS ==="
curl -s http://localhost:26657/num_unconfirmed_txs || echo "Mempool check failed"

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
echo "Test transaction hash: $TEST_TX_HASH"
sleep 3
echo "Checking test transaction status..."
mantrachaind q tx --type=hash $TEST_TX_HASH --node "http://localhost:26657" -o json 2>&1 || echo "Test transaction not found"

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
sleep 3
echo "=== NODE STATUS AFTER TEST ==="
curl -s http://localhost:26657/status | jq '.result.sync_info' || echo "Status check failed"

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
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

♻️ Duplicate comments (4)
.github/workflows/test-cosmwasm-onchain.yml (4)

60-66: actions-rs/toolchain@v1 still runs on Node 12

Actionlint flags this. Switch to a Node-20 compatible tag (≥ v1.0.7) or a commit SHA.

-        uses: actions-rs/toolchain@v1
+        # Node-20 compatible release
+        uses: actions-rs/[email protected]

72-87: Upgrade caches to actions/cache@v4

v3 actions are deprecated (Node 12). Replace both cache steps with v4.

-      - name: Cache cargo registry
-        uses: actions/cache@v3
+      - name: Cache cargo registry
+        uses: actions/cache@v4
...
-      - name: Cache cargo index
-        uses: actions/cache@v3
+      - name: Cache cargo index
+        uses: actions/cache@v4

34-36: Pin to a released Go toolchain – 1.23 does not exist

actions/setup-go will fail because Go 1.23 hasn’t been released. Use stable (or a concrete released version such as 1.22) to keep the workflow green.

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          # Use the latest stable Go toolchain
+          go-version: 'stable'

39-42: Piping remote install script into bash is a supply-chain hazard

Blindly executing install.sh from the internet exposes the runner to script hijacking. Download + verify (checksum / GPG) or fetch a pinned release tarball instead.

-      - name: Install just
-        run: |
-          curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
+      - name: Install just
+        run: |
+          curl -sL https://github.com/casey/just/releases/download/1.25.0/just-1.25.0-x86_64-unknown-linux-musl.tar.gz -o /tmp/just.tar.gz
+          echo "08b35b...  /tmp/just.tar.gz" | sha256sum -c -
+          tar -xzf /tmp/just.tar.gz -C /usr/local/bin just
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 02a887a and 75f13dc.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

62-62: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


73-73: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


81-81: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


302-302: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


314-314: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


327-327: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 163-163: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 166-166: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 182-182: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 204-204: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 206-206: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 215-215: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 228-228: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 242-242: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 244-244: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 256-256: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 273-273: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 278-278: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 281-281: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: integration_tests (all)
  • GitHub Check: govulncheck_job
  • GitHub Check: test
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: test
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: lint
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: Analyze (go)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

Comment on lines +301 to +314
name: test-results-${{ github.run_number }}
path: |
wasm-testing/artifacts/
wasm-testing/*.log
${{ runner.home }}/mantrachaind.log
retention-days: 7
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

runner.home is not a valid context – artifact upload will fail

runner.home does not exist; use $HOME (or ${{ runner.temp }}) consistently. The same issue appears in all three artifact steps.

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log
@@
-            ${{ runner.home }}/mantrachaind.log
-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/mantrachaind.log
+            $HOME/.mantrachaind/config/
@@
-            ${{ runner.home }}/.mantrachaind/config/
-            ${{ runner.home }}/mantrachaind.log
+            $HOME/.mantrachaind/config/
+            $HOME/mantrachaind.log

Also applies to: 315-319, 327-330

🧰 Tools
🪛 actionlint (1.7.7)

302-302: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml around lines 301 to 306, the
artifact upload uses an invalid context `runner.home` which causes failure.
Replace all instances of `${{ runner.home }}` with a valid environment variable
like `$HOME` or `${{ runner.temp }}` consistently in these steps. Also apply the
same fix to lines 315-319 and 327-330 where the same issue occurs.

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch from 75f13dc to 37792b3 Compare July 8, 2025 09:01
$(mantrachaind keys show test-key --keyring-backend test -a --home $HOME/.mantrachaind) \
1uom \
--chain-id mantra-testnet-1 \
--node http://localhost:26657 \

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
$WALLET_ADDR \
1uom \
--chain-id "${{ env.CHAIN_ID }}" \
--node "http://localhost:26657" \

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note test

Do not leave debug code in production
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 (5)
.github/workflows/test-cosmwasm-onchain.yml (5)

34-36: Go 1.23 hasn’t been released – step will break
actions/setup-go can’t install a non-existent version, the workflow stops before any tests run. Stick to stable or the latest released tag (currently 1.22).

-      - uses: actions/setup-go@v5
-        with:
-          go-version: 1.23
+      - uses: actions/setup-go@v5
+        with:
+          go-version: 'stable'

38-42: Piping an unpinned remote script is a supply-chain risk
Blindly executing install.sh makes the runner vulnerable to MITM or repo compromise. Download, verify checksum, or use a pinned release binary.


60-67: actions-rs/toolchain@v1 still runs on Node 12
Update to ≥ v1.0.7 or SHA, otherwise GitHub will deprecate the action soon and actionlint already flags it.


72-87: Cache steps are on actions/cache@v3 (Node 12) – upgrade to v4
Both cache jobs will emit deprecation warnings and may stop working.


291-324: ${{ runner.home }} is invalid – artifact upload will fail
runner.home doesn’t exist in the context; paths won’t resolve and artifacts are lost. Use $HOME (or ${{ runner.temp }}) consistently.

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log
@@
-            ${{ runner.home }}/mantrachaind.log
-            ${{ runner.home }}/.mantrachaind/config/
+            $HOME/mantrachaind.log
+            $HOME/.mantrachaind/config/
@@
-            ${{ runner.home }}/.mantrachaind/config/
-            ${{ runner.home }}/mantrachaind.log
+            $HOME/.mantrachaind/config/
+            $HOME/mantrachaind.log
🧹 Nitpick comments (1)
.github/workflows/test-cosmwasm-onchain.yml (1)

51-58: Pin the wasm-testing checkout for reproducible CI
Using ref: main means every push to the external repo can suddenly break this workflow. Check out a commit SHA or a version tag instead.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 75f13dc and 37792b3.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

62-62: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


73-73: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


81-81: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


296-296: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


308-308: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


321-321: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 163-163: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 166-166: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 182-182: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 198-198: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 200-200: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 209-209: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 222-222: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 236-236: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 238-238: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 250-250: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 267-267: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 272-272: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 275-275: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: Analyze (go)
  • GitHub Check: test
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: govulncheck_job
  • GitHub Check: test
  • GitHub Check: integration_tests (all)
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: build
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
  • GitHub Check: build
🔇 Additional comments (1)
.github/workflows/test-cosmwasm-onchain.yml (1)

280-289: MANTRACHAIND_PID may be empty in this step
The variable is exported via $GITHUB_ENV, but Bash won’t substitute an empty string in [ ! -z "$MANTRACHAIND_PID" ]—the kill guard could silently skip. Consider an explicit default or pgrep.

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch from 37792b3 to 738783a Compare July 8, 2025 09:19
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

♻️ Duplicate comments (5)
.github/workflows/test-cosmwasm-onchain.yml (5)

34-36: Go 1.23 isn’t released – workflow will fail
actions/setup-go can’t install an unreleased toolchain. Pin to stable or the latest minor (1.22.x).


39-41: Piping remote script into bash is still a supply-chain risk
Fetch → verify checksum → execute, or download a pinned binary instead.


61-67: actions-rs/toolchain@v1 runs on Node 12 – upgrade to ≥ v1.0.7
GitHub is deprecating Node 12 runners; this step will eventually break.


72-87: Migrate cache steps to actions/cache@v4
v3 still pulls the Node 12 image and is flagged by actionlint.


168-173: runner.home is not a valid context – artifacts will not upload
Replace all occurrences with $HOME (or ${{ runner.temp }}) to match the path used when writing the log.

-            ${{ runner.home }}/mantrachaind.log
+            $HOME/mantrachaind.log

Also fix the two other artifact blocks.

Also applies to: 305-338

🧹 Nitpick comments (1)
.github/workflows/test-cosmwasm-onchain.yml (1)

118-147: Trailing whitespace – YAML-lint fails
Lines 118, 137, 144 and 147 contain stray spaces; strip them to keep CI green.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 37792b3 and 738783a.

📒 Files selected for processing (1)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

62-62: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


73-73: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


81-81: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


310-310: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


322-322: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


335-335: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 177-177: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 180-180: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 196-196: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 212-212: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 214-214: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 223-223: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 236-236: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 250-250: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 252-252: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 264-264: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 281-281: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 286-286: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 289-289: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

🪛 YAMLlint (1.37.1)
.github/workflows/test-cosmwasm-onchain.yml

[error] 118-118: trailing spaces

(trailing-spaces)


[error] 137-137: trailing spaces

(trailing-spaces)


[error] 144-144: trailing spaces

(trailing-spaces)


[error] 147-147: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: connect-test (1.23.x, ubuntu-latest)
  • GitHub Check: Build - Linux x86_64
  • GitHub Check: test-cosmwasm-on-chain
  • GitHub Check: Build - MacOS x86_64 and aarch64
  • GitHub Check: test
  • GitHub Check: Build - Linux aarch64
  • GitHub Check: Analyze (go)
  • GitHub Check: integration_tests (all)
  • GitHub Check: govulncheck_job
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: build
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary

Comment on lines +104 to +108
# Update staking denomination in genesis before creating gentx
sed -i 's/"bond_denom": "stake"/"bond_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
sed -i 's/"mint_denom": "stake"/"mint_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Duplicate genesis edits – keep a single source of truth
bond_denom is patched twice (sed then jq). Re-applying the same mutation clutters the script and risks future drift.

-# Update staking denomination in genesis before creating gentx
-sed -i 's/"bond_denom": "stake"/"bond_denom": "uom"/g' $HOME/.mantrachaind/config/genesis.json
-...
-# Ensure proper staking parameters
-jq '.app_state.staking.params.bond_denom = "uom"' $HOME/.mantrachaind/config/genesis.json > …
+# Ensure proper staking parameters (single edit)
+jq '.app_state.staking.params.bond_denom = "uom"' \
+  $HOME/.mantrachaind/config/genesis.json > $HOME/.mantrachaind/config/genesis_tmp.json \
+  && mv $HOME/.mantrachaind/config/genesis_tmp.json $HOME/.mantrachaind/config/genesis.json

Also applies to: 148-150

🤖 Prompt for AI Agents
In .github/workflows/test-cosmwasm-onchain.yml around lines 104 to 108 and also
lines 148 to 150, the genesis file is edited twice for the same fields using
both sed and jq, causing duplication and potential inconsistencies. Remove the
redundant sed commands that update bond_denom and mint_denom, and keep only one
method (preferably jq for JSON safety) to update these fields to maintain a
single source of truth and avoid script clutter.

@jvr0x jvr0x force-pushed the ci/cosmwasm-tests branch from 738783a to efb8423 Compare July 8, 2025 09:50
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 8, 2025

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

♻️ Duplicate comments (8)
.github/workflows/test-cosmwasm-onchain.yml (6)

35-37: Use a released Go version – 1.23 will break the build


39-42: Piping remote script into bash is a supply-chain risk


62-67: Update actions-rs/toolchain – current tag still runs on Node 12


73-87: Migrate caches to actions/cache@v4


104-108: Duplicate genesis edits – keep a single source of truth

Also applies to: 148-150


305-338: ${{ runner.home }} is invalid – artifact upload will fail

tests/e2e/e2e_tokenfactory_test.go (2)

135-151: Good test coverage for verifying default denom admin.

The test correctly verifies that the creator becomes the default admin of a newly created denom. The HTTP URL issue on line 143 has already been flagged in previous reviews.


153-258: Comprehensive metadata testing with thorough verification.

Excellent test implementation that:

  • Tests the complete metadata setting workflow
  • Performs detailed field-by-field verification
  • Includes helpful debug logging

The HTTP URL issue on line 179 has already been flagged in previous reviews.

🧹 Nitpick comments (5)
README.md (2)

61-77: LGTM - Comprehensive e2e testing documentation

The enhanced e2e testing instructions provide clear guidance for both first-time setup and subsequent test runs, which will improve the developer experience.

Consider addressing the minor formatting issues:

-#### To run unit tests:
+#### To run unit tests

-#### To run e2e tests:
+#### To run e2e tests

-For the first time, run the following command to build image and run e2e tests:
+For the first time, run the following command to build the image and run e2e tests:

78-89: LGTM - Useful linter documentation

The linter section with Docker commands using the same version as CI/CD ensures consistency in the development workflow.

Consider addressing the minor grammar issue:

-> Use same golangci-lint version as used in CI/CD pipeline to ensure consistency.
+> Use the same golangci-lint version as used in the CI/CD pipeline to ensure consistency.
.github/workflows/test-cosmwasm-onchain.yml (1)

118-118: Remove trailing spaces

YAMLlint detected trailing spaces on these lines. While not critical, they should be removed for code cleanliness.

-          sed -i 's/"expedited_voting_period": "86400s"/"expedited_voting_period": "10s"/g' $HOME/.mantrachaind/config/genesis.json
-          
+          sed -i 's/"expedited_voting_period": "86400s"/"expedited_voting_period": "10s"/g' $HOME/.mantrachaind/config/genesis.json
+

Apply similar fixes to lines 137, 144, and 147.

Also applies to: 137-137, 144-144, 147-147

tests/e2e/e2e_cosmwasm_test.go (2)

15-18: Consider using test suite fields instead of global variables

Global variables for test state can cause issues with parallel test execution. Consider adding these as fields to the IntegrationTestSuite struct.

-var (
-	deployedWasmCodeId      uint64 = 0
-	deployedContractAddress string
-)
+// Add to IntegrationTestSuite struct:
+// deployedWasmCodeId      uint64
+// deployedContractAddress string

164-164: Fix typo in function name

The function name has a typo: "Simply" should be "Simple".

-func (s *IntegrationTestSuite) testExecuteContractWithSimplyMessage() {
+func (s *IntegrationTestSuite) testExecuteContractWithSimpleMessage() {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 738783a and efb8423.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • tests/e2e/test_data/rwa_oracle.wasm is excluded by !**/*.wasm
📒 Files selected for processing (24)
  • .github/workflows/test-cosmwasm-onchain.yml (1 hunks)
  • Dockerfile (1 hunks)
  • Makefile (1 hunks)
  • README.md (2 hunks)
  • app/app.go (2 hunks)
  • app/queries/queries.go (1 hunks)
  • cmd/mantrachaind/cmd/commands.go (5 hunks)
  • cmd/mantrachaind/cmd/root.go (1 hunks)
  • go.mod (9 hunks)
  • tests/connect/connect_integration_test.go (3 hunks)
  • tests/e2e/chain.go (2 hunks)
  • tests/e2e/e2e_cosmwasm_test.go (1 hunks)
  • tests/e2e/e2e_exec_test.go (3 hunks)
  • tests/e2e/e2e_setup_test.go (4 hunks)
  • tests/e2e/e2e_test.go (4 hunks)
  • tests/e2e/e2e_tokenfactory_test.go (12 hunks)
  • tests/e2e/query.go (5 hunks)
  • x/tokenfactory/keeper/before_send.go (1 hunks)
  • x/tokenfactory/keeper/createdenom.go (3 hunks)
  • x/tokenfactory/keeper/keeper.go (3 hunks)
  • x/tokenfactory/keeper/msg_server.go (2 hunks)
  • x/tokenfactory/types/before_send.go (1 hunks)
  • x/tokenfactory/types/events.go (1 hunks)
  • x/tokenfactory/types/expected_keepers.go (2 hunks)
✅ Files skipped from review due to trivial changes (8)
  • x/tokenfactory/keeper/before_send.go
  • x/tokenfactory/types/events.go
  • tests/e2e/chain.go
  • app/queries/queries.go
  • Makefile
  • x/tokenfactory/types/before_send.go
  • x/tokenfactory/keeper/keeper.go
  • go.mod
🧰 Additional context used
🧬 Code Graph Analysis (7)
cmd/mantrachaind/cmd/root.go (1)
app/config.go (1)
  • EvmAppOptions (38-61)
x/tokenfactory/keeper/msg_server.go (2)
x/tokenfactory/types/msgs.go (1)
  • TypeMsgCreateDenom (13-13)
x/tokenfactory/types/events.go (3)
  • AttributeCreator (6-6)
  • AttributeNewTokenDenom (8-8)
  • AttributeNewTokenEthAddr (9-9)
cmd/mantrachaind/cmd/commands.go (1)
app/app.go (1)
  • DefaultNodeHome (205-205)
tests/e2e/e2e_test.go (1)
tests/e2e/e2e_setup_test.go (1)
  • IntegrationTestSuite (93-106)
tests/e2e/e2e_exec_test.go (1)
tests/e2e/e2e_setup_test.go (1)
  • IntegrationTestSuite (93-106)
tests/e2e/e2e_cosmwasm_test.go (1)
tests/e2e/e2e_setup_test.go (1)
  • IntegrationTestSuite (93-106)
tests/e2e/e2e_tokenfactory_test.go (1)
tests/e2e/e2e_setup_test.go (1)
  • IntegrationTestSuite (93-106)
🪛 actionlint (1.7.7)
.github/workflows/test-cosmwasm-onchain.yml

62-62: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


73-73: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


81-81: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


310-310: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


322-322: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)


335-335: property "home" is not defined in object type {arch: string; debug: string; environment: string; name: string; os: string; temp: string; tool_cache: string}

(expression)

🪛 GitHub Check: devskim
.github/workflows/test-cosmwasm-onchain.yml

[notice] 177-177: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 180-180: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 196-196: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 212-212: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 214-214: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 223-223: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 236-236: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 250-250: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 252-252: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 264-264: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 281-281: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 286-286: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production


[notice] 289-289: Accessing localhost could indicate debug code, or could hinder scaling.
Do not leave debug code in production

tests/e2e/e2e_cosmwasm_test.go

[warning] 22-22: An HTTP-based URL without TLS was detected.
Insecure URL


[warning] 33-33: An HTTP-based URL without TLS was detected.
Insecure URL


[warning] 105-105: An HTTP-based URL without TLS was detected.
Insecure URL


[warning] 168-168: An HTTP-based URL without TLS was detected.
Insecure URL


[warning] 212-212: An HTTP-based URL without TLS was detected.
Insecure URL

tests/e2e/e2e_tokenfactory_test.go

[warning] 143-143: An HTTP-based URL without TLS was detected.
Insecure URL


[warning] 148-148: An HTTP-based URL without TLS was detected.
Insecure URL


[warning] 179-179: An HTTP-based URL without TLS was detected.
Insecure URL

🪛 YAMLlint (1.37.1)
.github/workflows/test-cosmwasm-onchain.yml

[error] 118-118: trailing spaces

(trailing-spaces)


[error] 137-137: trailing spaces

(trailing-spaces)


[error] 144-144: trailing spaces

(trailing-spaces)


[error] 147-147: trailing spaces

(trailing-spaces)

🪛 LanguageTool
README.md

[grammar] ~61-~61: Use proper spacing conventions.
Context: ... ### Testing #### To run unit tests: bash make test-unit #### To run e2e tests: For the first time, r...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~66-~66: Use proper spacing conventions.
Context: ...ke test-unit ``` #### To run e2e tests: For the first time, run the following co...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~68-~68: Use articles correctly.
Context: ...ime, run the following command to build image and run e2e tests: ```shell make test-e...

(QB_NEW_EN_OTHER_ERROR_IDS_000004)


[grammar] ~68-~68: Use proper spacing conventions.
Context: ...ommand to build image and run e2e tests: ```shell make test-e2e ```` If you already have the image built, you...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~73-~73: Use proper spacing conventions.
Context: ...ilt, you can run the e2e tests directly: shell cd test/e2e && go test -v -timeout 30m ### Linter > Use same golangci-lint version ...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~79-~79: Use articles correctly.
Context: ...t -v -timeout 30m ``` ### Linter > Use same golangci-lint version as used in CI/CD ...

(QB_NEW_EN_OTHER_ERROR_IDS_000004)


[grammar] ~79-~79: Use articles correctly.
Context: ...e same golangci-lint version as used in CI/CD pipeline to ensure consistency. #### L...

(QB_NEW_EN_OTHER_ERROR_IDS_000004)


[grammar] ~79-~79: Use proper spacing conventions.
Context: ...in CI/CD pipeline to ensure consistency. #### Lint check ```shell docker run -t --rm -...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~81-~81: Use proper spacing conventions.
Context: ... to ensure consistency. #### Lint check shell docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.64.8 golangci-lint run #### Lint fix ```shell docker run -t --rm -v ...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~86-~86: Use proper spacing conventions.
Context: ...4.8 golangci-lint run #### Lint fixshell docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.64.8 golangci-lint run --fix ``` ## Architecture Mantrachain follows the Co...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~118-~118: Use proper spacing conventions.
Context: ...ctories and files within the repository.

(QB_NEW_EN_OTHER_ERROR_IDS_000007)

🪛 markdownlint-cli2 (0.17.2)
README.md

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

(MD026, no-trailing-punctuation)


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

(MD026, no-trailing-punctuation)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🔇 Additional comments (35)
Dockerfile (1)

27-27: LGTM – Wasmvm v2 Downgrade Consistency Verified

Verified that all references to github.com/CosmWasm/wasmvm/v3 have been removed and replaced with v2 across the codebase:

• No remaining wasmvm/v3 references
go.mod pins github.com/CosmWasm/wasmvm/v2 v2.2.4
Makefile uses go list -m github.com/CosmWasm/wasmvm/v2

No further changes needed.

cmd/mantrachaind/cmd/root.go (1)

38-38: No type mismatch: app.EvmAppOptions correctly implements EVMOptionsFn

The New constructor in app/app.go expects a uint64 chain ID followed by an EVMOptionsFn (defined as func(uint64) error), so passing

app.MANTRAChainID,
app.EvmAppOptions,

is exactly the intended usage. The separate call

if err := app.EvmAppOptions(app.MANTRAChainID); err != nil {
    panic(err)
}

in cmd/mantrachaind/cmd/root.go simply applies the actual EVM configuration at startup (with subsequent calls becoming no-ops due to the internal sealed guard). No changes are required here.

x/tokenfactory/keeper/msg_server.go (3)

5-5: LGTM - Appropriate imports for ERC20 integration

The new imports for SHA-256 hashing and Ethereum address handling are necessary for the ERC20 integration functionality being added.

Also applies to: 11-11


38-40: LGTM - Deterministic Ethereum address generation

The implementation correctly generates a deterministic Ethereum address from the denom string using SHA-256 hashing. This approach ensures that the same denom will always produce the same Ethereum address, which is crucial for consistency.

Note: The BytesToAddress function uses the first 20 bytes of the 32-byte SHA-256 hash, which is the standard approach for Ethereum address generation.


46-46: LGTM - Proper event emission for ERC20 address

The Ethereum address is correctly added to the event attributes using the predefined constant AttributeNewTokenEthAddr, enabling clients to track the ERC20 representation of newly created tokens.

tests/connect/connect_integration_test.go (3)

71-78: LGTM - Appropriate feemarket configuration for testing

The feemarket parameters are set to "0" to disable fee market functionality during integration tests, which is appropriate for testing scenarios where you want predictable gas pricing.


82-82: LGTM - Proper coin decimals configuration

The addition of coinDecimals with a value of 6 and its integration into the ChainConfig provides proper decimal configuration for the test chain, which is essential for token handling and display.

Also applies to: 107-107


42-42: Confirm connect-sidecar v2.2.1 compatibility

The release for v2.2.1 exists, but its notes call out a proto-breaking change to MsgRemoveMarkets that is not compatible with chains previously running on older v2.x releases. Before merging:

• Ensure our integration test harness and chain genesis accommodate the new proto definitions (e.g., fresh chain or updated message handling).
• Verify that any tests invoking MsgRemoveMarkets still pass under v2.2.1+.
• If compatibility can’t be guaranteed, consider pinning to the last non-breaking v2 release (e.g., v2.1.2) or update the tests accordingly.

x/tokenfactory/types/expected_keepers.go (1)

47-50: LGTM! Clean interface design for ERC20 integration.

The new ERC20Keeper interface is well-structured with clear method signatures for managing token pairs and dynamic precompiles.

app/app.go (1)

542-544: LGTM! Proper keeper integration.

The ERC20 keeper is correctly integrated into both the TokenFactoryKeeper and WasmKeeper constructors, enabling cross-module interactions. The clarifying comment about TransferKeeper being the port source is helpful.

Also applies to: 811-812

x/tokenfactory/keeper/createdenom.go (1)

42-42: Setting denom name correctly.

Good addition to set the Name field explicitly to the denom string for consistency.

tests/e2e/e2e_setup_test.go (1)

105-106: LGTM! Clean implementation of conditional test setup.

The single-node test mode is well-implemented with clear logging and proper conditional logic for both setup and teardown phases.

Also applies to: 143-151, 165-174, 189-191

tests/e2e/e2e_test.go (3)

5-20: Good change from var to const for test flags.

Using const instead of var for test configuration flags prevents accidental modification and makes the intent clearer.


125-126: Good addition of tokenfactory admin tests.

Adding testTokenfactoryAdmin() and testTokenfactorySetMetadata() provides better coverage of tokenfactory functionality.


139-149: Well-structured wasm test with appropriate dependencies.

The test correctly requires both wasm and tokenfactory to be enabled since the wasm contracts interact with the tokenfactory module. The test sequence follows a logical flow from params query through contract lifecycle.

cmd/mantrachaind/cmd/commands.go (1)

89-89: Confirm KeyCommands flag change

We were unable to locate the KeyCommands definition in the local repo—please verify that switching the second argument from true to false does not disable any required key‐management interactions.

• File: cmd/mantrachaind/cmd/commands.go (line 89)

ethermintclient.KeyCommands(app.DefaultNodeHome, false),

Action: Manually inspect the ethermintclient.KeyCommands signature and its documentation in the external module to ensure this flag change won’t remove needed functionality.

tests/e2e/e2e_exec_test.go (4)

643-677: LGTM!

The execWasmStoreCode function is well-implemented and follows the established pattern for transaction execution.


679-736: LGTM!

The execWasmInstantiate function properly handles optional parameters and provides good logging for debugging.


738-771: LGTM!

The execWasmExecute function is correctly implemented with appropriate logging.


806-813: Good addition of transaction hash extraction

The modification to return the transaction hash enables better transaction tracking in tests. The error handling is appropriate.

tests/e2e/e2e_cosmwasm_test.go (4)

20-29: LGTM!

The wasm params query test is well-structured with proper assertions.


31-99: LGTM!

The code storage test is comprehensive with proper validation of the stored code.


101-162: LGTM!

The contract instantiation test includes proper error handling with defer/recover and comprehensive validation.


210-265: LGTM!

The tokenfactory interaction test is comprehensive with proper validation of asset metadata.

tests/e2e/query.go (3)

46-58: Good improvement to error handling

The addition of type assertions prevents potential panics and provides clearer error messages.


63-130: LGTM!

The queryTxEvents function is well-implemented with comprehensive error handling and type safety.


458-584: LGTM!

All new query functions for tokenfactory and wasm modules are well-implemented with consistent error handling patterns. The base64 encoding in queryWasmContractSmart is correctly implemented.

tests/e2e/e2e_tokenfactory_test.go (8)

5-5: LGTM! Appropriate imports for metadata handling.

The new imports are properly added to support JSON marshaling and text case formatting for the metadata functionality.

Also applies to: 14-16


96-96: Excellent refactoring to improve code maintainability.

The introduction of the getAlice() helper method and its consistent usage throughout the tests reduces code duplication and centralizes error handling.

Also applies to: 108-108, 117-117, 270-270, 275-275, 278-278, 283-283, 296-296, 301-301, 311-311, 375-375, 383-383, 388-388, 431-431, 436-436, 447-447, 473-477


278-278: Good helper function for consistent denom construction.

The buildDenom() helper standardizes the factory denom string format and improves code maintainability.

Also applies to: 383-383, 469-471, 535-535


479-513: Well-designed metadata helper functions.

The metadata helper functions provide:

  • Consistent metadata structure for tests
  • Proper text casing for display fields
  • Clean JSON marshaling with appropriate error handling for test utilities

527-528: Good addition of gas estimation flags.

Adding --gas=auto and --gas-adjustment=1.5 to all tokenfactory commands ensures reliable transaction execution with appropriate gas margins.

Also applies to: 559-560, 592-593, 611-612, 645-646, 664-665


546-576: Well-implemented metadata setting command.

The setDenomMetadata method follows established patterns with proper error handling and includes a helpful reference to a sample transaction.


365-467: Good test restructuring for better organization.

Wrapping the burn test in a single Run() block improves test organization and makes the flow clearer by containing all related logic, including the reenable proposal, within the subtest.


536-536: Good improvements to logging and parameter consistency.

The changes improve debugging with explicit logging of the sender and denom being created, while maintaining consistent string parameter usage across methods.

Also applies to: 578-578, 631-631

Comment on lines 56 to 66
// create erc20 contractAddr and set token pair
denomHash := sha256.Sum256([]byte(denom))
ethContractAddr := ethcommon.BytesToAddress(denomHash[:])
pair := erc20types.NewTokenPair(ethContractAddr, denom, erc20types.OWNER_EXTERNAL)
k.erc20Keeper.SetToken(ctx, pair)

err = k.erc20Keeper.EnableDynamicPrecompiles(ctx, pair.GetERC20Contract())
if err != nil {
return err
}

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

Verify the deterministic address generation approach.

The ERC20 integration using SHA256 for deterministic address generation is clever, but please ensure:

  1. The OWNER_EXTERNAL type is the intended ownership model for these token pairs
  2. Consider documenting that this creates a permanent 1:1 mapping between denoms and ERC20 contracts

Let me verify if there's any validation for address collisions:


🏁 Script executed:

#!/bin/bash
# Check if there's any validation for existing ERC20 contracts at the generated address
rg -A 5 "SetToken|GetToken" --type go

Length of output: 2031


Ensure deterministic ERC20 address binding safety

We didn’t find any check for an existing token pair at the derived ethContractAddr before calling SetToken, which means a hash collision (however unlikely) could silently overwrite or duplicate bindings. Please:

• Add an explicit lookup on the ERC20 keeper (e.g. a GetToken(ctx, ethContractAddr) or equivalent) and return an error if a pair already exists at that address.
• Confirm that using OWNER_EXTERNAL is the intended ownership model for these token pairs.
• Document—in a code comment or module-level README—that this mechanism creates a permanent 1:1 mapping between each Cosmos denom and its ERC20 contract address, and cannot be changed once set.

🤖 Prompt for AI Agents
In x/tokenfactory/keeper/createdenom.go around lines 56 to 66, add a check
before calling SetToken to see if a token pair already exists at the derived
ethContractAddr by using a GetToken or equivalent method from the erc20Keeper.
If a pair exists, return an error to prevent overwriting. Verify that
OWNER_EXTERNAL is the correct ownership type for these token pairs and add a
comment explaining that this process creates a permanent, immutable 1:1 mapping
between each Cosmos denom and its ERC20 contract address.

Comment on lines 22 to 24
func (s *IntegrationTestSuite) CanTestOnSingleNode() bool {
return !runIBCTest && !runTokenfactoryTest && !runRateLimitTest
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Logic issue in CanTestOnSingleNode().

The current logic returns true only when !runTokenfactoryTest, but the new wasm tests require tokenfactory to be enabled. This prevents wasm tests from running in single-node mode even though they don't need IBC functionality.

Consider updating the logic to:

func (s *IntegrationTestSuite) CanTestOnSingleNode() bool {
	return !runIBCTest && !runRateLimitTest
}

This would allow tokenfactory and wasm tests to run in single-node mode.

🤖 Prompt for AI Agents
In tests/e2e/e2e_test.go around lines 22 to 24, the CanTestOnSingleNode function
incorrectly excludes tokenfactory tests by returning false when
runTokenfactoryTest is true, which blocks wasm tests that require tokenfactory
from running in single-node mode. Update the function to remove the check for
runTokenfactoryTest and return true only when both runIBCTest and
runRateLimitTest are false, allowing tokenfactory and wasm tests to run in
single-node mode.

Comment on lines 170 to 177
baseappOptions = append(baseappOptions, func(app *baseapp.BaseApp) {
mempool := mempool.NoOpMempool{}
app.SetMempool(mempool)

handler := baseapp.NewDefaultProposalHandler(mempool, app)
app.SetPrepareProposal(handler.PrepareProposalHandler())
app.SetProcessProposal(handler.ProcessProposalHandler())
})
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

No-op mempool configuration needs documentation

Setting a no-op mempool means transactions won't be pooled, which is unusual for production deployments. This appears to be for the test environment but should be documented or made configurable to avoid confusion.

Consider making this configurable:

-baseappOptions = append(baseappOptions, func(app *baseapp.BaseApp) {
-	mempool := mempool.NoOpMempool{}
-	app.SetMempool(mempool)
-
-	handler := baseapp.NewDefaultProposalHandler(mempool, app)
-	app.SetPrepareProposal(handler.PrepareProposalHandler())
-	app.SetProcessProposal(handler.ProcessProposalHandler())
-})
+// Only use no-op mempool for testing environments
+if cast.ToBool(appOpts.Get("testing.no-op-mempool")) {
+	baseappOptions = append(baseappOptions, func(app *baseapp.BaseApp) {
+		mempool := mempool.NoOpMempool{}
+		app.SetMempool(mempool)
+
+		handler := baseapp.NewDefaultProposalHandler(mempool, app)
+		app.SetPrepareProposal(handler.PrepareProposalHandler())
+		app.SetProcessProposal(handler.ProcessProposalHandler())
+	})
+}
🤖 Prompt for AI Agents
In cmd/mantrachaind/cmd/commands.go around lines 170 to 177, the code sets a
no-op mempool which disables transaction pooling, an uncommon setup for
production. To fix this, add a configuration option or flag to enable choosing
between the no-op mempool and a real mempool implementation. Also, include
comments explaining that the no-op mempool is intended for testing or specific
scenarios to avoid confusion for users deploying to production.

@jvr0x jvr0x requested a review from freeelancer July 8, 2025 10:26
@jvr0x jvr0x changed the base branch from main to release/v5.0.0-rcx July 8, 2025 10:27
@freeelancer freeelancer merged commit 3e03325 into release/v5.0.0-rcx Jul 8, 2025
24 of 27 checks passed
@jvr0x jvr0x deleted the ci/cosmwasm-tests branch July 8, 2025 13:50
allthatjazzleo added a commit that referenced this pull request Sep 13, 2025
* chore(deps): bump wasmd fork from v0.55.0-ibc2.0 to v0.60.1 (#350)

* chore: upgrade wasmd fork from v0.55.0-ibc2.0 to v0.60.1

* fix: cosmwasm version (#351)

* fix: cosmwasm version

* fix: WASMVM_VERSION in dockerfile

---------

Co-authored-by: allthatjazzleo <[email protected]>

* test(e2e): add wasm e2e test (#356)

* feat: add support for single-node e2e testing configuration for local machine

* feat: Add rwa_oracle contract for wasm tests

* feat: Enhance e2e test to validate state after execution

* feat: Add end-to-end test for setting token metadata in tokenfactory

* feat: Enhance support for single-node testing in e2e test suite

* feat: Refactor e2e tests to use abstracted function to keep variables consistent

* feat: Improve e2e tests by replacing skips with assertions for contract deployment checks

* feat: Add end-to-end test for token factory admin authority metadata

* feat: Add end-to-end test for contract interaction with token factory

* docs: update README to include instructions for running e2e tests and linting

* feat: enhance end-to-end test setup to support single and multi-node configurations

* feat: add erc20 token address for tokenfactory token (#361)

* feat: deploy erc20 contract and set tokenpair

* hash the denom

* fix: enforce use of noop mempool (#357)

* Merge branch 'main' into release/v5.0.0-rcx (#363)

* fix: connect integration tests and keep cosmos key type as default (#362)

* Merge from main (#365)

* build(golangci-lint): migrate to v2 config and apply lint to repo (#358)

* build(golangci-lint): Migrate to v2 config and apply full repository linting

* update golangci-lint version for github workflow

* feat: block mint burn for disabled tokenfactory coins (#359)

* docs(readme): Update README for modules

* feat: block mint/burn for disabled coins

* test(e2e): add tokenfactory disable token send tests

* point to v5

* Revert "point to v5"

This reverts commit ee7613b.

* ci: add workflow for cosmwasm tests on chain (#360)

* ci: add workflow for cosmwasm tests on chain

* ci: change upload-artifact to v4

* ci: fix ci workflow

* ci: spin off local chain on ci

* chore(deps): bump cosmos-sdk fork from v0.53.0 to v0.53.3 (#369)

* chore(deps): bump cosmos-sdk fork from v0.53.0 to v0.53.3

* fix(lint): staticcheck

* fix: cleanup temp wasmd folder (#334)

Co-authored-by: Lance Lan Meng <[email protected]>

* feat: add empty upgrade handler v5.0.0-rc1

* test(e2e): tokenfactory hooks tests (#370)

* feat: bump cosmos/evm to latest commit + upgradehandler (#373)

* fix: reinstate secp256k1 keys add (#374)

* chore(deps): bump cosmos/evm to latest commit

* fix: update heighliner tag and enable arm64 platform in build configuration (#375)

* fix: register geth core precompiles (#380)

* chore(deps): upgrade wasmvm to v3 and update related imports (#382)

Bumps the following dependencies to their latest versions:

- Bumps github.com/CosmWasm/wasmd from v0.60.1 to v0.61.1
- Bumps github.com/CosmWasm/wasmvm from v2.2.4 to v3.0.0

* chore: consolidate and update test CI workflows into a single tests.yml file (#383)

* chore: consolidate and update test CI workflows into a single tests.yml file

* feat: dynamically determine E2E branch based on target branch in CI workflow

* fix: simplify e2e branch determination and set fixed reference for checkout (#387)

* fix: audit findings patches (#385)

* fix: block module accounts

* fix: cli incorrect denom deconstruction

* fox: add blacklist query standard flags

* fix: remove escrowAddress on channel close

* fix: add pagination flags to blacklist query

* fix: antehandler options adds feegrantkeeper check

* fix: address collision of erc20 precompile

* fix: add pagination flags to blacklist query (#386)

---------

Co-authored-by: mmsqe <[email protected]>

* feat: add IBC middleware to register ERC20 precompile (#384)

* fix: add symbol and display for erc20 symbol and decimals interface

* feat: add ibc middleware for erc20 support

* fix: wrong sendpacket path in comment

* chore: remove obsolete connect-test workflow and integrate it into tests.yml (#389)

* chore(deps): bump github.com/cosmos/evm to latest commit  (#381)

* bump deps

* Revert "feat: allow only single evm msg (#341)"

This reverts commit 93afacf.

* use upstream minGasPriceDecorator

* point to v5

* port mempool fix

* fix: using cosmos prefix (#391)

* fix prefix

---------

Signed-off-by: Lance Lan Meng <[email protected]>
Co-authored-by: Lance Lan Meng <[email protected]>

* fix: callBeforeSendListener reaching max depth if there is recursive call

* feat: v5.0.0-rc3 upgradehandler

* Problem: use of outdated EVM precompiles from the Berlin fork (#392)

* feat: blacklist check for evm (#393)

* feat: blacklist check for evm

* fix: blacklist error change to display bech32 address

* Apply suggestions from code review

---------

Co-authored-by: mmsqe <[email protected]>

* chore(deps): bump github.com/cosmos/evm to latest commit on main (#395)

* Revert "Problem: use of outdated EVM precompiles from the Berlin fork (#392)"

This reverts commit 8321faa.

* feat: add erc20 register migration for tokenfactory tokens (#394)

* fix: tokenfactory migration bugs (#397)

* Problem: secp256k1.PubKey is not supported in multisig (#398)

* fix: migration message format issue

* Problem: not make use of evm debug addr (#399)

* test: add denom related test for tokenfactory (#396)

* align already registered test

* Problem: non-eip155 tx is not supported (#400)

* Problem: non-eip155 tx in evm ecosystem not support

there are some common practices in evm ecosystem that requires
non-eip155 transactions to work.

* fix lint

* fix: comments for for EVMBlacklistCheckDecorator

* fix: incorrect event attributes and comments (#403)

* fix: sanction module wrong comments

* fix: correct tokenfactory burn event + other comments

* chore(deps): bump cosmos/evm to bug fix and msg improvement (#378)

* chore(deps): bump cosmos/evm to bug fix and msg improvement

* bump deps

* add rc4

* bump deps

* doc

* fix: legacy feemarket proposal unmarshal (#408)

* Problem: no migrate for existing dynamic and native precompiles from param (#409)

* chore(deps): bump cosmos/evm to latest commit  (#411)

* pending tx comes after get mined

* allow unsupported public key type when send from old multisign addr

for more info, cosmos/evm#288

bump deps

* bump deps

* align go version

* Problem: redundant baseappOptions in newApp (#414)

* Problem: redundant baseappOptions in newApp

* fix broadcast mode

* fix: cleanup unused cancel function in filter (#415)

* fix: cleanup unused cancel function in filter

* bump up deps

* fix: add [flags] to blacklist use

* fix: readme for sanction module messages

* test upgrade

* Problem: eip-2935 HexAddressFromBech32String and GetStorageRoot fixes are not included (#416)

* Problem: eip-2935 is not implemented

* bump deps

* bump deps

* bump to rc6

* preinstall

* Revert "preinstall"

This reverts commit ad3b610.

* bump deps

* bump deps

* bump deps

* bump to acc check

* bump to getstorageroot fix

* history_serve_window

* bump deps

* bump deps

* bump deps

* feat: change client to eth_secp256k1 keys by default (#422)

* default add eth_secp256k1 key

* fix: test to use eth address

* remove all workflow except to test connect

* change go.mod depedencies for connect

* wip: fail to register /cosmos.evm.crypto.v1.ethsecp256k1.PubKey

* enccodec registry in docker

* Revert "remove all workflow except to test connect"

This reverts commit ad516c0.

---------

Co-authored-by: freeelancer <[email protected]>

* feat: unified v5 upgrade handler (#410)

* renamed v5 to v5rc0 as it was for testnet rc0

* feat: combined v5 upgrade handler

* chore: rename unified upgrade to "v5.0"

---------

Co-authored-by: Leo Pang <[email protected]>

* fix: correct decimal conversion for deposits in werc20 precompile (#424)

* fix: correct decimal conversion for deposits in werc20 precompile

* cleanup

* rc7

* update plan

* update submodule

* feat: emit wasm events for callBeforeSendListener (#430)

* fix: None (#433)

Closes: #432

* feat: support extra chain-id (#426)

* chore(deps): bump github.com/go-viper/mapstructure/v2 to 2.4.0 (#434)

* chore(deps): bump github.com/hashicorp/go-getter to 1.7.9

* chore: update evm chain id for devnet to 7888

* chore: prepare v5rc8 upgrade (#435)

* chore: prepare v5rc8 upgrade

* upgrade both

* feat: parse chain id for evm chain id (#436)

Co-authored-by: mmsqe <[email protected]>

* Problem: ProxyGasMeter fail to consume parent gas meter when out of gas (#443)

* Problem: behavioral change between proxygasmeter and standalone gas meter (backport #439)

Solution:
- refactor proxygasmeter to be more like a standalone gas meter, but
  delegate gas consumption to parent in real time.

* fix String

* fix test

* remove shortcut

* add back shortcut

* add test

* chore: prepare v5rc9 upgrade (#444)

---------

Signed-off-by: Lance Lan Meng <[email protected]>
Co-authored-by: allthatjazzleo <[email protected]>
Co-authored-by: Bigto Chan <[email protected]>
Co-authored-by: mmsqe <[email protected]>
Co-authored-by: Javier ⚛︎ <[email protected]>
Co-authored-by: Leo Pang <[email protected]>
Co-authored-by: yihuang <[email protected]>
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