-
Notifications
You must be signed in to change notification settings - Fork 256
feat: enable smart contracts on akash #2015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughIntegrates CosmWasm (wasmd) and a new oracle module, migrates repository to v2 module paths, introduces wasmvm build/caching and message filtering, adds a price-oracle CosmWasm contract, reorganizes run/test infra under _run/, and replaces v1 upgrade code with a v2.0.0 upgrade flow. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 5 (Critical) | ⏱️ ~120+ minutes Areas to pay extra attention:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
x/market/client/rest/rest.go (1)
13-138: Implement or remove non-functional REST endpoint handlers.The
RegisterRoutesfunction registers 6 HTTP endpoints, but all handler implementations are empty. Additionally, thequerypackage import is commented out (line 9), which would prevent the commented handler logic from compiling if uncommented.These endpoints currently return empty responses with no status codes or error messages when called. Choose one of these approaches:
- Complete the implementation: Uncomment the
queryimport and implement the handler logic using the existingNewRawClientquery methods- Mark as deprecated: Return HTTP 410 Gone with a message directing clients to gRPC query endpoints
- Remove entirely: Delete the route registrations if these REST endpoints are no longer needed
The query layer implementation exists in
x/market/query/and is functional; only the REST integration layer is incomplete..goreleaser-test-bins.yaml (1)
59-86: Keep linux test builds behind the static_wasm tag too.These linux builds now link the static wasmvm archives, but they still omit the
static_wasmbuild tag. Any Go files guarded by//go:build static_wasm(e.g. the new wiring added in this PR) will be dropped, so the resulting binaries won't carry the static integration and may fail to link. Please append the tag to both linux entries as well.- - "-tags={{ .Env.BUILD_TAGS }}" + - "-tags={{ .Env.BUILD_TAGS }} static_wasm".goreleaser.yaml (1)
59-86: Linux release builds also need the static_wasm tag.For the main release builds we now link against the static wasmvm archives, yet we only add
static_wasmon the darwin variants. Without the tag, linux binaries drop the//go:build static_wasmfiles that provide the static integration, so the link step or runtime wiring will break. Please add the tag to both linux entries.- - "-tags={{ .Env.BUILD_TAGS }}" + - "-tags={{ .Env.BUILD_TAGS }} static_wasm"app/types/app.go (1)
118-132: Instantiate ICA keepers before wiring middleware.We now store
ICAControllerandICAHostonAppKeepers, but they are never constructed before use. InInitNormalKeepersthe values remain zero and we immediately callicacontroller.NewIBCMiddlewareWithAuthandWithICS4Wrapperon that zero-value keeper (Line 510 onward). Because the keeper’s internal store services and router references are nil, the first real ICA controller call will panic.Please allocate both keepers (via
icacontrollerkeeper.NewKeeper/icahostkeeper.NewKeeperwith the proper store keys, codec, router, account keeper, etc.) before building the IBC middleware stack, and then assign them toapp.Keepers.Cosmos. Only after that should we create the middleware layers and invokeWithICS4Wrapper.Also applies to: 507-517
🧹 Nitpick comments (4)
_run/.envrc (1)
3-9: Consider resetting ANSI color codes after error messages.The error messages use
\033[31mto display red text but don't reset the color afterward with\033[0m. This may leave the terminal in a colored state after the script exits.Apply this diff to reset colors:
if ! has grpcurl ; then - echo -e "\033[31mgrpcurl is not installed"; exit 1 + echo -e "\033[31mgrpcurl is not installed\033[0m"; exit 1 fi if ! has tqdm ; then - echo -e "\033[31mtqdm is not installed. https://github.com/tqdm/tqdm"; exit 1 + echo -e "\033[31mtqdm is not installed. https://github.com/tqdm/tqdm\033[0m"; exit 1 fix/escrow/query/querier.go (1)
3-12: Consider removing commented-out code.The entire file consists of commented-out code. If this querier implementation is no longer needed, remove the file entirely. If it's retained for future reference, the v2 import path update is appropriate.
_run/node/Makefile (1)
1-5: Consider adding standard phony targets if not provided by includes.The Makefile includes shared build files and declares a
clean-nodetarget. Static analysis warns about missing conventional targets (all,clean,test), but these may be provided by the includedcommon.mkandcommon-commands.mkfiles.If these standard targets are not available through the includes, consider adding them for better Makefile convention compliance. However, if they're already provided by the included files, this warning can be safely ignored.
Based on learnings
x/wasm/simulation/genesis.go (1)
9-16: Function name doesn't match implementation.The function is named
RandomizedGenStatebut usesDefaultParams()rather than generating random values. For simulation testing, you typically want randomized values to test various scenarios.Consider either:
- Renaming to
DefaultGenStateto match the actual behavior, or- Implementing actual randomization for more comprehensive simulation testing.
Example with randomization:
func RandomizedGenState(simState *module.SimulationState) { var params types.Params simState.AppParams.GetOrGenerate(types.ModuleName, ¶ms, simState.Rand, func(r *rand.Rand) { params = types.Params{ // Randomize parameter values here } }) takeGenesis := &types.GenesisState{ Params: params, } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(takeGenesis) }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (148)
.env(1 hunks).envrc(1 hunks).goreleaser-docker.yaml(3 hunks).goreleaser-test-bins.yaml(4 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_build/akash.Dockerfile(1 hunks)_run/.env(1 hunks)_run/.envrc(1 hunks)_run/.envrc_run(1 hunks)_run/common-base.mk(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)_run/node/.envrc(1 hunks)_run/node/.gitignore(1 hunks)_run/node/Makefile(1 hunks)app/app.go(9 hunks)app/app_configure.go(4 hunks)app/config.go(2 hunks)app/modules.go(4 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(9 hunks)app/testnet.go(1 hunks)app/types/app.go(8 hunks)app/upgrades.go(1 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/config.go(1 hunks)cmd/akash/cmd/root.go(5 hunks)cmd/akash/cmd/testnetify/config.go(1 hunks)cmd/akash/cmd/testnetify/testnetify.go(1 hunks)cmd/akash/cmd/testnetify/utils.go(1 hunks)cmd/akash/main.go(1 hunks)docgen/main.go(1 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)pubsub/bus_test.go(1 hunks)tests/e2e/certs_cli_test.go(1 hunks)tests/e2e/certs_grpc_test.go(1 hunks)tests/e2e/cli_test.go(1 hunks)tests/e2e/deployment_cli_test.go(1 hunks)tests/e2e/deployment_grpc_test.go(1 hunks)tests/e2e/grpc_test.go(1 hunks)tests/e2e/market_cli_test.go(1 hunks)tests/e2e/market_grpc_test.go(1 hunks)tests/e2e/provider_cli_test.go(1 hunks)tests/e2e/provider_grpc_test.go(1 hunks)tests/upgrade/upgrade_test.go(1 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/network/network.go(1 hunks)testutil/network_suite.go(1 hunks)testutil/state/suite.go(1 hunks)testutil/types.go(1 hunks)tools/upgrade-info/main.go(1 hunks)upgrades/software/v1.0.0/audit.go(0 hunks)upgrades/software/v1.0.0/cert.go(0 hunks)upgrades/software/v1.0.0/deployment.go(0 hunks)upgrades/software/v1.0.0/escrow.go(0 hunks)upgrades/software/v1.0.0/init.go(0 hunks)upgrades/software/v1.0.0/market.go(0 hunks)upgrades/software/v1.0.0/provider.go(0 hunks)upgrades/software/v1.0.0/take.go(0 hunks)upgrades/software/v1.0.0/upgrade.go(0 hunks)upgrades/software/v2.0.0/init.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)upgrades/types/types.go(1 hunks)upgrades/upgrades.go(1 hunks)upgrades/upgrades_test.go(1 hunks)util/partialord/internal/dag/dag_test.go(1 hunks)util/partialord/partialord.go(1 hunks)util/partialord/partialord_test.go(1 hunks)util/query/pagination.go(1 hunks)x/audit/alias.go(1 hunks)x/audit/genesis.go(1 hunks)x/audit/handler/handler.go(1 hunks)x/audit/handler/handler_test.go(1 hunks)x/audit/handler/msg_server.go(1 hunks)x/audit/keeper/grpc_query_test.go(2 hunks)x/audit/keeper/keeper_test.go(1 hunks)x/audit/keeper/key.go(1 hunks)x/audit/module.go(1 hunks)x/cert/alias.go(1 hunks)x/cert/genesis.go(1 hunks)x/cert/handler/handler.go(1 hunks)x/cert/handler/handler_test.go(1 hunks)x/cert/handler/msg_server.go(1 hunks)x/cert/keeper/grpc_query.go(1 hunks)x/cert/keeper/grpc_query_test.go(1 hunks)x/cert/keeper/keeper_test.go(1 hunks)x/cert/keeper/key.go(1 hunks)x/cert/module.go(1 hunks)x/cert/utils/key_pair_manager.go(1 hunks)x/cert/utils/utils.go(1 hunks)x/deployment/alias.go(1 hunks)x/deployment/genesis.go(1 hunks)x/deployment/handler/handler.go(1 hunks)x/deployment/handler/handler_test.go(1 hunks)x/deployment/handler/server.go(1 hunks)x/deployment/keeper/grpc_query.go(1 hunks)x/deployment/keeper/grpc_query_test.go(1 hunks)x/deployment/keeper/keeper_test.go(1 hunks)x/deployment/module.go(1 hunks)x/deployment/simulation/operations.go(1 hunks)x/escrow/genesis.go(1 hunks)x/escrow/handler/handler.go(1 hunks)x/escrow/handler/server.go(1 hunks)x/escrow/keeper/grpc_query.go(1 hunks)x/escrow/keeper/grpc_query_test.go(1 hunks)x/escrow/keeper/keeper_test.go(1 hunks)x/escrow/module.go(1 hunks)x/escrow/query/querier.go(1 hunks)x/market/alias.go(1 hunks)x/market/client/rest/params.go(1 hunks)x/market/client/rest/rest.go(1 hunks)x/market/genesis.go(1 hunks)x/market/handler/handler_test.go(1 hunks)x/market/handler/keepers.go(1 hunks)x/market/keeper/grpc_query.go(1 hunks)x/market/keeper/grpc_query_test.go(1 hunks)x/market/keeper/keeper.go(1 hunks)x/market/keeper/keeper_test.go(1 hunks)x/market/module.go(1 hunks)x/market/query/path.go(1 hunks)x/market/simulation/operations.go(1 hunks)x/market/simulation/utils.go(1 hunks)x/provider/alias.go(1 hunks)x/provider/genesis.go(1 hunks)x/provider/handler/handler.go(1 hunks)x/provider/handler/handler_test.go(1 hunks)x/provider/handler/server.go(1 hunks)x/provider/keeper/grpc_query_test.go(1 hunks)x/provider/keeper/keeper_test.go(1 hunks)x/provider/module.go(1 hunks)x/provider/simulation/operations.go(1 hunks)x/take/genesis.go(1 hunks)x/take/handler/server.go(1 hunks)x/take/module.go(1 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/handler/server.go(1 hunks)x/wasm/keeper/grpc_query.go(1 hunks)x/wasm/keeper/keeper.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/decoder.go(1 hunks)x/wasm/simulation/genesis.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (9)
- upgrades/software/v1.0.0/deployment.go
- upgrades/software/v1.0.0/escrow.go
- upgrades/software/v1.0.0/take.go
- upgrades/software/v1.0.0/init.go
- upgrades/software/v1.0.0/upgrade.go
- upgrades/software/v1.0.0/market.go
- upgrades/software/v1.0.0/audit.go
- upgrades/software/v1.0.0/provider.go
- upgrades/software/v1.0.0/cert.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
_run/common-base.mk.env_run/common-commands.mkmake/setup-cache.mk_run/common.mk.envrcmake/init.mk_run/node/Makefilemake/releasing.mkMakefile
🧬 Code graph analysis (9)
x/audit/keeper/grpc_query_test.go (1)
app/export.go (1)
Setup(282-347)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(139-150)upgrades/types/types.go (1)
IUpgrade(32-37)
app/app_configure.go (3)
x/cert/alias.go (1)
ModuleName(13-13)x/market/alias.go (1)
ModuleName(13-13)x/take/alias.go (1)
ModuleName(11-11)
upgrades/software/v2.0.0/init.go (2)
upgrades/types/types.go (1)
RegisterUpgrade(79-85)upgrades/software/v2.0.0/upgrade.go (1)
UpgradeName(22-22)
app/sim_test.go (2)
app/app.go (3)
AppName(83-83)NewApp(110-294)AkashApp(97-107)app/sim/sim_utils.go (2)
CheckExportSimulation(78-103)SetupSimulation(23-49)
x/wasm/module.go (2)
x/escrow/keeper/querier.go (1)
NewQuerier(7-9)x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
app/config.go (2)
x/deployment/module.go (8)
AppModuleBasic(44-46)AppModuleBasic(60-62)AppModuleBasic(65-67)AppModuleBasic(78-80)AppModuleBasic(83-90)AppModuleBasic(93-98)AppModuleBasic(101-103)AppModuleBasic(106-108)x/market/module.go (8)
AppModuleBasic(45-47)AppModuleBasic(56-58)AppModuleBasic(61-63)AppModuleBasic(72-74)AppModuleBasic(77-84)AppModuleBasic(87-92)AppModuleBasic(95-97)AppModuleBasic(100-102)
cmd/akash/cmd/config.go (1)
testutil/network/network.go (1)
DefaultConfig(603-651)
cmd/akash/cmd/root.go (2)
app/app.go (1)
DefaultHome(87-87)cmd/akash/cmd/config.go (1)
InitAppConfig(20-31)
🪛 checkmake (0.2.2)
_run/node/Makefile
[warning] 4-4: Missing required phony target "all"
(minphony)
[warning] 4-4: Missing required phony target "clean"
(minphony)
[warning] 4-4: Missing required phony target "test"
(minphony)
🪛 dotenv-linter (4.0.0)
_run/.env
[warning] 2-2: [UnorderedKey] The AKASH_GAS_ADJUSTMENT key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 3-3: [UnorderedKey] The AKASH_CHAIN_ID key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 5-5: [UnorderedKey] The AKASH_GAS_PRICES key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 6-6: [UnorderedKey] The AKASH_GAS key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 7-7: [UnorderedKey] The AKASH_NODE key should go before the AKASH_YES key
(UnorderedKey)
🪛 golangci-lint (2.5.0)
x/wasm/keeper/keeper.go
[error] 5-5: could not import github.com/CosmWasm/wasmd/x/wasm/keeper (-: # github.com/CosmWasm/wasmd/x/wasm/keeper
/tmp/go/.go-mod-cache/github.com/!cosm!wasm/[email protected]/x/wasm/keeper/test_common.go:360:3: too many arguments in call to NewKeeper
have ("github.com/cosmos/cosmos-sdk/codec".Codec, "cosmossdk.io/core/store".KVStoreService, "github.com/cosmos/cosmos-sdk/x/auth/keeper".AccountKeeper, "github.com/cosmos/cosmos-sdk/x/bank/keeper".BaseKeeper, *"github.com/cosmos/cosmos-sdk/x/staking/keeper".Keeper, "github.com/cosmos/cosmos-sdk/x/distribution/keeper".Querier, *"github.com/cosmos/ibc-go/v10/modules/core/04-channel/keeper".Keeper, *"github.com/cosmos/ibc-go/v10/modules/core/04-channel/keeper".Keeper, *"github.com/cosmos/ibc-go/v10/modules/core/04-channel/v2/keeper".Keeper, wasmtesting.MockIBCTransferKeeper, *baseapp.MsgServiceRouter, *baseapp.GRPCQueryRouter, string, "github.com/CosmWasm/wasmd/x/wasm/types".NodeConfig, "github.com/CosmWasm/wasmd/x/wasm/types".VMConfig, []string, string, []Option...)
want ("github.com/cosmos/cosmos-sdk/codec".Codec, "cosmossdk.io/core/store".KVStoreService, "github.com/CosmWasm/wasmd/x/wasm/types".AccountKeeper, "github.com/CosmWasm/wasmd/x/wasm/types".BankKeeper, "github.com/CosmWasm/wasmd/x/wasm/types".StakingKeeper, "github.com/CosmWasm/wasmd/x/wasm/types".DistributionKeeper, "github.com/CosmWasm/wasmd/x/wasm/types".ICS4Wrapper, "github.com/CosmWasm/wasmd/x/wasm/types".ChannelKeeper, "github.com/CosmWasm/wasmd/x/wasm/types".ICS20TransferPortSource, MessageRouter, GRPCQueryRouter, string, "github.com/CosmWasm/wasmd/x/wasm/types".NodeConfig, "github.com/CosmWasm/wasmd/x/wasm/types".VMConfig, []string, string, ...Option))
(typecheck)
⏰ 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). (18)
- GitHub Check: network-upgrade-names
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: lint-shell
- GitHub Check: coverage
- GitHub Check: tests
- GitHub Check: build-bins
- GitHub Check: build-macos
- GitHub Check: lint-shell
- GitHub Check: build-macos
- GitHub Check: tests
- GitHub Check: release-dry-run
- GitHub Check: build-bins
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: network-upgrade-names
- GitHub Check: sims
🔇 Additional comments (110)
_run/node/.gitignore (1)
1-1: Appropriate cache directory exclusion for test environment.The entry correctly uses a trailing slash to ignore cache directories. This is well-suited for the
_run/node/test environment, which may generate build or runtime cache artifacts during testing.util/partialord/internal/dag/dag_test.go (1)
8-8: LGTM: Import path correctly updated to v2.The import path has been properly updated to reflect the module version bump.
util/partialord/partialord_test.go (1)
8-8: LGTM: Import path correctly updated to v2.The import path has been properly updated to reflect the module version bump.
util/partialord/partialord.go (1)
6-6: LGTM: Import path correctly updated to v2 with complete migration verified.Verification confirms all old import paths have been updated throughout the codebase. No remaining
pkg.akt.dev/node/paths without/v2exist, and the specific import inutil/partialord/partialord.goat line 6 is correct.x/audit/keeper/key.go (1)
13-13: LGTM! Import path update is correct and API compatible.The import change from v1 to v2 is safe. All function usages in this file (
AssertKeyAtLeastLengthat lines 41, 51, 56 andAssertKeyLengthat line 60) match the v2 function signatures exactly with no breaking changes.cmd/akash/cmd/testnetify/utils.go (1)
14-14: LGTM! Import path update is correct and consistent with the codebase v2 migration.The change from
pkg.akt.dev/node/util/servertopkg.akt.dev/node/v2/util/serveris consistent with the repository-wide migration to v2. All imports ofpkg.akt.dev/nodepackages throughout the codebase already use the/v2suffix. TheListenForQuitSignalsfunction maintains its expected API signature.x/market/client/rest/rest.go (1)
9-9: This review comment is incorrect and should be dismissed.The commented import and empty handler implementations are intentional. The market module has migrated from REST endpoints to gRPC Gateway. You can see this in
x/market/module.gowhich contains an activeRegisterGRPCGatewayRoutesfunction (line 87) but noRegisterRESTRoutesmethod at all. The handlers are kept as commented stubs for reference but are not wired into the module. This is a deliberate deprecation of REST endpoints in favor of the modern gRPC Gateway approach.Likely an incorrect or invalid review comment.
tools/upgrade-info/main.go (1)
11-11: LGTM!The import path has been correctly updated to the v2 module path, consistent with the broader repository migration.
app/sim/sim_utils.go (1)
17-17: LGTM!The import path correctly migrates to the v2 app module, aligning with the repository-wide v2 migration.
testutil/types.go (1)
17-18: LGTM!Both import paths have been correctly updated to their v2 equivalents, maintaining consistency with the broader v2 module migration.
x/market/keeper/grpc_query_test.go (1)
19-20: LGTM!Test utility imports correctly updated to v2 module paths, ensuring test compatibility with the new module structure.
x/provider/keeper/grpc_query_test.go (1)
16-18: LGTM!All three import paths correctly migrated to v2 module paths, maintaining test compatibility with the updated module structure.
x/cert/keeper/keeper_test.go (1)
22-22: LGTM!The keeper import path correctly updated to the v2 module path, consistent with the repository-wide migration.
x/take/genesis.go (1)
8-8: LGTM!The keeper import path correctly migrated to v2, maintaining consistency with the module structure update.
x/market/client/rest/params.go (1)
11-11: LGTM!The comment has been updated to reflect the v2 module path. While this code is currently commented out, maintaining accurate references is good practice for potential future use.
x/provider/handler/server.go (1)
11-12: LGTM - v1 to v2 module path migration verified as complete.Verification confirms no mixed v1/v2 imports remain, no orphaned v1 references in source files, and go.mod correctly declares the v2 module path. The migration is consistent across the codebase.
x/market/handler/handler_test.go (1)
27-28: LGTM! Import path migration looks correct.The import paths have been properly updated to v2 module paths, consistent with the PR's module version bump objective.
x/provider/genesis.go (1)
12-12: LGTM! Import path migration looks correct.The keeper package import has been properly updated to the v2 module path, aligning with the repository-wide v2 migration.
x/market/keeper/keeper.go (1)
15-15: LGTM! Import path migration looks correct.The keys package import has been properly updated to the v2 module path.
cmd/akash/cmd/testnetify/config.go (1)
15-15: LGTM! Import path migration looks correct.The app package import has been properly updated to the v2 module path.
x/provider/keeper/keeper_test.go (1)
13-14: LGTM! Import path migration looks correct.The test utility and keeper imports have been properly updated to v2 module paths.
x/market/query/path.go (1)
11-11: LGTM! Import path migration looks correct.The deployment query package import has been properly updated to the v2 module path.
x/deployment/simulation/operations.go (1)
24-26: LGTM! Import path migration looks correct.The app params, test simulation, and keeper imports have been properly updated to v2 module paths.
x/market/simulation/utils.go (1)
9-9: LGTM! Import path migration looks correct.The market handler keepers package import has been properly updated to the v2 module path.
cmd/akash/cmd/app_creator.go (1)
25-25: LGTM – Module path migration to v2.The import path update from
pkg.akt.dev/node/apptopkg.akt.dev/node/v2/appis consistent with the repository-wide migration to v2 module paths.x/take/module.go (1)
20-22: LGTM – Consistent v2 module path updates.All three import paths (handler, keeper, simulation) have been updated to reference the v2 package structure, maintaining consistency across the take module.
app/upgrades.go (1)
8-10: LGTM – Upgrades infrastructure migrated to v2.Both upgrade-related import paths have been correctly updated to the v2 module structure.
x/market/simulation/operations.go (1)
20-22: LGTM – Simulation imports updated to v2.All three aliased imports (appparams, testsim, keepers) correctly reference the v2 module paths while maintaining their aliases.
x/wasm/simulation/decoder.go (1)
1-17: LGTM – Scaffolding for future WASM simulation support.This file contains a commented-out template for a decoder function. The code references "mint" types, suggesting it's a placeholder copied from another module's simulation setup. This appears to be intentional scaffolding as part of the WASM integration work.
x/market/handler/keepers.go (1)
19-19: LGTM – Market keeper import migrated to v2.The market keeper import path has been correctly updated to the v2 module structure.
testutil/state/suite.go (1)
29-37: LGTM – Comprehensive v2 migration for test utilities.All import paths for the test suite have been correctly updated to reference v2 module paths, including app, mocks, and all keeper packages (audit, deployment, escrow, market hooks, market keeper, provider, and take).
upgrades/types/types.go (1)
13-13: v2 app types import looks good.The alias now matches the v2 module path adopted elsewhere; no further action needed.
x/wasm/keeper/grpc_query.go (1)
21-30: Params RPC handler is wired correctly.Nil guarding plus context unwrapping and delegating to the keeper is exactly what we need here. Nice work.
cmd/akash/cmd/config.go (1)
20-30: App config defaults capture the wasm knobs nicely.Embedding the server config and layering wasm defaults keeps the interface consistent. No issues spotted.
tests/e2e/grpc_test.go (1)
10-10: LGTM!The import path update to v2 is consistent with the module migration.
x/audit/handler/handler.go (1)
12-12: LGTM!The import path update to v2 is correct and consistent with the broader module migration.
x/market/module.go (1)
24-28: LGTM!The import path updates to v2 are consistent across all market-related components and align with the repository-wide module migration.
x/cert/utils/key_pair_manager.go (1)
30-30: LGTM!The import path update to v2 is correct and maintains existing error handling behavior.
testutil/network/network.go (1)
52-52: LGTM!The import path update to v2 is correct and maintains compatibility with the test network infrastructure.
x/deployment/keeper/grpc_query.go (1)
17-17: LGTM!The import path update to v2 is correct and maintains existing query functionality.
cmd/akash/main.go (1)
8-8: LGTM!The import path update to v2 is correct and ensures the main entry point uses the updated command module.
tests/e2e/provider_cli_test.go (1)
14-14: LGTM! Import path correctly updated to v2.The import path migration to v2 is consistent with the broader module path update across the codebase.
app/config.go (2)
7-7: LGTM! WASM module import added correctly.The import aligns with the PR's goal to enable smart contracts on Akash.
64-64: LGTM! WASM AppModuleBasic correctly integrated.The WASM module is properly added to the basic module manager, following the same pattern as other cosmos SDK modules. This integrates with the broader WASM support being added in app/app_configure.go and app/modules.go.
x/cert/handler/handler_test.go (1)
25-26: LGTM! Test import paths correctly migrated to v2.The import path updates are consistent with the project-wide v2 module migration.
upgrades/upgrades.go (1)
5-5: LGTM! Upgrade path correctly updated to v2.0.0.The anonymous import ensures the v2.0.0 upgrade handlers are registered at initialization time, which is the correct pattern for registering blockchain upgrades.
tests/e2e/provider_grpc_test.go (1)
16-16: LGTM! Import path correctly updated to v2.The testutil import path migration is consistent with the broader v2 module path update.
x/escrow/genesis.go (1)
14-14: LGTM! Keeper import path correctly migrated to v2.The import path update is consistent with the project-wide v2 module migration.
tests/e2e/deployment_grpc_test.go (1)
17-17: LGTM! Import path correctly updated to v2.The testutil import path migration is consistent with the broader v2 module path update across all e2e tests.
x/provider/module.go (1)
23-26: LGTM! Import paths correctly updated to v2.The migration from v1 to v2 module paths is consistent across all provider-related imports.
x/cert/keeper/key.go (1)
16-16: LGTM! Validation import correctly migrated to v2.The utility package import path has been properly updated to align with the v2 module structure.
.envrc (1)
102-103: LGTM! PATH ordering correctly adjusted.The PATH entries are now properly ordered with
AKASH_DEVCACHE_BINbeforeAKASH_DEVCACHE_NODE_BIN, which aligns with the new library cache layout for WASM support.x/escrow/keeper/grpc_query_test.go (1)
22-24: LGTM! Test imports correctly migrated to v2.All escrow-related test imports have been properly updated to use v2 module paths, maintaining consistency across the test suite.
x/market/keeper/keeper_test.go (1)
17-18: LGTM! Market test imports successfully migrated to v2.The test imports are properly aligned with the v2 module structure.
x/market/genesis.go (1)
13-14: LGTM! Genesis module imports correctly updated to v2.Both keeper and keys package imports have been properly migrated to the v2 module path.
x/escrow/keeper/keeper_test.go (1)
13-15: LGTM! Escrow keeper test imports properly migrated to v2.All test dependencies including mocks, state utilities, and keeper have been consistently updated to v2 paths.
pubsub/bus_test.go (1)
9-9: LGTM! Pubsub test import correctly updated to v2.The pubsub package import has been properly migrated to align with the v2 module structure.
x/deployment/genesis.go (1)
13-13: LGTM - Import path updated for v2 migration.The import path has been correctly updated to reference the v2 module path as part of the repository-wide migration.
tests/e2e/deployment_cli_test.go (1)
25-25: LGTM - Test utilities import updated for v2 migration.The import path for test utilities has been correctly updated to the v2 module path, consistent with the broader migration.
_run/node/.envrc (1)
1-1: LGTM - Standard direnv configuration.This file correctly references the shared environment configuration for the node run context.
x/provider/handler/handler.go (1)
10-11: LGTM - Keeper imports updated for v2 migration.Both market and provider keeper imports have been correctly updated to reference the v2 module paths.
x/audit/genesis.go (1)
13-13: LGTM - Import path updated for v2 migration.The audit keeper import has been correctly updated to the v2 module path.
x/cert/genesis.go (1)
12-12: LGTM - Import path updated for v2 migration.The cert keeper import has been correctly updated to the v2 module path.
x/cert/keeper/grpc_query.go (1)
15-15: LGTM - Query utility import updated for v2 migration.The query utility import has been correctly updated to the v2 module path.
tests/e2e/certs_cli_test.go (1)
9-9: ✓ V2 migration verified—all import paths consistent and CI/CD pipelines clean.All verification points confirmed:
- Import paths across codebase consistently updated to v2 (300+ active references)
- go.mod module path is pkg.akt.dev/node/v2
- Breaking changes documentation present (CHANGELOG.md, upgrades/CHANGELOG.md)
- CI/CD pipelines and build scripts contain no v1 references
- File under review (tests/e2e/certs_cli_test.go:9) correctly imports v2 testutil
tests/e2e/market_grpc_test.go (1)
22-22: LGTM! Test utility import path updated to v2.The testutil import path migration is correct and aligns with the PR-wide v2 module path changes.
x/cert/module.go (1)
21-23: LGTM! Cert module import paths migrated to v2.All cert module component imports (handler, keeper, simulation) are correctly updated to v2 paths.
x/deployment/handler/server.go (1)
14-14: LGTM! Deployment keeper import path updated to v2.The import path migration is correct and consistent with other deployment-related files in the PR.
x/audit/handler/msg_server.go (1)
10-10: LGTM! Audit keeper import path updated to v2.The import path change is correct and aligns with the v2 module migration across the codebase.
upgrades/upgrades_test.go (1)
11-11: LGTM! Upgrade types import path updated to v2.The import path migration for upgrade types is correct and consistent with the broader v2 module path changes.
x/cert/handler/handler.go (1)
10-10: LGTM! Import path migration to v2 verified.Verification confirms no remaining v1 cert/keeper imports exist and all references across the codebase are consistently migrated to v2 format, including the import at
x/cert/handler/handler.go:10.x/deployment/handler/handler.go (1)
10-10: LGTM! Import path migration to v2 verified.The verification confirms that the deployment keeper import path update is consistent with the v2 module migration across the entire codebase. No v1 imports remain, and all references to the deployment keeper consistently use the v2 path.
_run/.envrc_run (1)
1-8: No action required—AKASH_RUN is properly defined.Verification confirms that
AKASH_RUNis defined in the root.envfile asAKASH_RUN=${AKASH_DEVCACHE}/run. The root.envrccallsdotenvearly in its execution, which loads variables from.envbeforesource_upis invoked in child.envrcfiles like_run/.envrc_run. The variable is properly available in the environment when_run/.envrc_runexecutes and uses it on line 4.Likely an incorrect or invalid review comment.
tests/e2e/certs_grpc_test.go (1)
16-16: LGTM! Import path correctly updated to v2.The testutil import path has been updated to align with the v2 module migration.
x/escrow/module.go (1)
23-25: LGTM! Escrow module imports correctly migrated to v2.All escrow module imports (rest, handler, keeper) have been consistently updated to v2 paths without any logic changes.
x/take/handler/server.go (1)
11-11: LGTM! Take keeper import correctly updated to v2.The keeper import path has been updated to align with the v2 module migration.
x/audit/module.go (1)
22-23: LGTM! Audit module imports correctly migrated to v2.Both handler and keeper imports have been consistently updated to v2 paths without any logic changes.
x/deployment/handler/handler_test.go (1)
28-33: LGTM! Test imports correctly migrated to v2.All test utilities and module imports (mocks, state, deployment/handler, deployment/keeper, escrow/handler, market/keeper) have been consistently updated to v2 paths without affecting test logic.
.env (1)
9-9: LGTM! Dev cache lib variable added consistently.The new
AKASH_DEVCACHE_LIBvariable follows the established naming convention and integrates with the dev cache infrastructure.x/deployment/module.go (1)
25-27: LGTM! Deployment module imports correctly migrated to v2.All deployment module imports (handler, keeper, simulation) have been consistently updated to v2 paths without any logic changes.
x/escrow/keeper/grpc_query.go (1)
16-16: LGTM! Clean v2 module path migration.The import path update aligns with the repository-wide v1 to v2 migration.
docgen/main.go (1)
8-8: LGTM! Import path correctly updated to v2.The change is consistent with the broader module path migration.
testutil/network_suite.go (1)
29-29: LGTM! Test utility import updated to v2.Correctly aligns test infrastructure with the v2 module migration.
x/audit/keeper/keeper_test.go (1)
24-24: LGTM! Test import updated to v2.The keeper test import is correctly migrated to the v2 module path.
x/cert/utils/utils.go (1)
10-10: LGTM! Certificate error import updated to v2.The import path migration is correctly applied with no changes to error handling logic.
x/deployment/keeper/grpc_query_test.go (1)
21-24: LGTM! Test imports migrated to v2.All test-related imports are correctly updated to the v2 module paths, including the app, test utilities, and keeper references.
x/escrow/handler/handler.go (1)
9-9: LGTM! Escrow keeper import updated to v2.Handler import correctly migrated with no changes to message handling logic.
x/market/keeper/grpc_query.go (1)
16-17: LGTM! Market keeper imports correctly migrated to v2.Verification confirms all internal pkg.akt.dev/node imports have been successfully migrated to v2 across the codebase, and go.mod is properly updated to v2 module path.
x/cert/handler/msg_server.go (1)
10-10: LGTM! Import path updated to v2.The import path update aligns with the project-wide migration to v2 module paths. No functional changes detected.
x/deployment/keeper/keeper_test.go (1)
14-15: LGTM! Test imports updated to v2.The test import paths have been correctly updated to align with the v2 module migration. Test logic remains unchanged.
x/escrow/handler/server.go (1)
9-9: LGTM! Import path updated to v2.The keeper import path has been correctly updated to v2, consistent with the project-wide module migration. No functional changes.
_run/.env (1)
1-7: LGTM! Environment configuration looks good.The environment variables are properly configured for local development. The static analysis warnings about key ordering are purely stylistic—the current logical grouping (keyring, gas settings, chain config, node) is equally valid.
x/cert/keeper/grpc_query_test.go (1)
17-18: LGTM! Test imports updated to v2.The import paths have been correctly migrated to v2 for both the app and cert keeper packages, aligning with the project-wide module migration.
x/provider/handler/handler_test.go (1)
18-21: LGTM! Test imports migrated to v2.All test imports have been correctly updated to v2 module paths, maintaining consistency across the test suite. No behavioral changes to the tests.
upgrades/software/v2.0.0/init.go (1)
9-11: LGTM! Upgrade registration follows correct pattern.The v2.0.0 upgrade is properly registered during package initialization using
utypes.RegisterUpgrade. The registration ties the upgrade name to theinitUpgradehandler, and the framework will panic on duplicate registrations, providing safety.x/market/alias.go (1)
6-6: LGTM! Import path migrated to v2.The keeper import has been updated to the v2 module path while preserving all public type aliases and constants. This maintains API compatibility during the migration.
x/cert/alias.go (1)
6-6: LGTM: v2 import path migration.The keeper import path has been correctly updated from v1 to v2 as part of the module versioning upgrade. The public API surface (Keeper type and NewKeeper function) remains unchanged.
x/audit/alias.go (1)
6-6: LGTM: v2 import path migration.The keeper import path has been correctly updated from v1 to v2, maintaining consistency with the broader module versioning upgrade.
x/deployment/alias.go (1)
6-6: LGTM: v2 import path migration.The keeper import path has been correctly updated to v2, consistent with the module versioning upgrade across the codebase.
tests/e2e/cli_test.go (1)
11-11: LGTM: v2 test utilities import path migration.The testutil import path has been correctly updated to v2, aligning with the broader module versioning upgrade.
app/app_configure.go (4)
7-7: LGTM: WASM module imports added.The addition of CosmWasm types and Akash WASM module imports correctly supports smart contract functionality.
Also applies to: 35-35
28-34: LGTM: v2 import path migration for Akash modules.All Akash module imports have been correctly updated from v1 to v2 paths.
47-47: LGTM: Akash WASM module basic added.The Akash WASM
AppModuleBasichas been correctly added to the module basics slice.
84-85: LGTM: WASM modules correctly positioned in genesis initialization order.Both
awasm.ModuleNameandwasmtypes.ModuleNameare appropriately placed at the end of the genesis initialization sequence, ensuring that all dependencies (bank, staking, etc.) are initialized first.x/provider/alias.go (1)
6-6: LGTM: v2 import path migration.The keeper import path has been correctly updated to v2, maintaining consistency with the module versioning upgrade.
app/modules.go (4)
7-8: LGTM: WASM module imports added.CosmWasm and Akash WASM module imports have been correctly added to support smart contract functionality.
Also applies to: 44-44
37-43: LGTM: v2 import path migration for Akash modules.All Akash module imports have been correctly updated to v2 paths.
196-208: LGTM: WASM modules correctly wired in appModules.Both Akash WASM and CosmWasm modules are properly initialized:
- Akash WASM module is correctly wired with its keeper
- CosmWasm module has all required dependencies (staking, account, bank, message router, and subspace)
340-353: LGTM: WASM modules correctly duplicated in simulation modules.Both WASM modules are properly registered in the simulation module list, maintaining parity with the production module configuration. This ensures simulation tests can exercise WASM functionality.
cmd/akash/cmd/root.go (1)
94-96: Good call exposing wasm init flags.Pulling in
wasm.AddModuleInitFlagshere keeps the CLI wiring in sync with the new module additions and lets operators configure wasm at startup. Looks great.
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
x/deployment/keeper/keeper_test.go (1)
120-154: Remove this skipped test—the keeper method no longer exists and functionality is now in market hooks.The test references
keeper.OnEscrowAccountClosed(), which was refactored intox/market/hooks/hooks.go:30during the hooks refactor. The deployment keeper no longer exposes this method, making the test unrunnable without major restructuring. Since no dedicated market hooks tests exist in the codebase, consider either: (1) removing this test, or (2) adding hooks integration tests tox/market/hooks/if coverage is needed.
♻️ Duplicate comments (7)
Makefile (1)
42-70: Critical: ldflags capture and static-link condition must be fixed.Two critical regressions remain from the previous review:
Line 52:
GORELEASER_LDFLAGS := $(ldflags)captures ldflags before the static-link flags are appended (lines 54-56), so goreleaser never receives-linkmode=external,-extldflags, or any custom$(LDFLAGS). Release artifacts will lose static linking.Line 54: The condition
ifeq (,$(findstring static-link,$(BUILD_OPTIONS)))is inverted—it adds static flags only whenstatic-linkis absent. SinceBUILD_OPTIONSdefaults tostatic-link(line 23), default builds will skip static linking, breaking container deployments.Both issues must be fixed before merging.
Move the
GORELEASER_LDFLAGSassignment to after all ldflags mutations (or use recursive assignment=), and fix the condition to add static flags whenstatic-linkis present:ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ -X github.com/cosmos/cosmos-sdk/version.AppName=akash \ -X github.com/cosmos/cosmos-sdk/version.BuildTags="$(build_tags_cs)" \ -X github.com/cosmos/cosmos-sdk/version.Version=$(shell git describe --tags | sed 's/^v//') \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_HEAD_COMMIT_LONG) \ -X github.com/cosmos/cosmos-sdk/types.DBBackend=$(DB_BACKEND) -GORELEASER_LDFLAGS := $(ldflags) - -ifeq (,$(findstring static-link,$(BUILD_OPTIONS))) +ifneq (,$(findstring static-link,$(BUILD_OPTIONS))) ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" endif # check for nostrip option ifeq (,$(findstring nostrip,$(BUILD_OPTIONS))) ldflags += -s -w BUILD_FLAGS += -trimpath endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) +GORELEASER_LDFLAGS = $(ldflags) GORELEASER_TAGS := $(BUILD_TAGS) GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)'x/wasm/simulation/proposals.go (1)
38-50: Remove unusedcoinsallocation – build currently fails.Lines 38-50 create and append to
coins, but that variable is never referenced afterwards. Go rejects the file with “coins declared but not used.” Please drop the allocation (or wire it into the params if that was the intent) so the code compiles.- coins := simtypes.RandSubsetCoins(r, sdk.Coins{ - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D85", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D86", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D87", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D88", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D89", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D8A", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - sdk.NewInt64Coin("ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D8B", int64(simtypes.RandIntBetween(r, 500000, 50000000))), - }) - - // uakt must always be present - coins = append(coins, sdk.NewInt64Coin("uakt", int64(simtypes.RandIntBetween(r, 500000, 50000000))))upgrades/software/v2.0.0/upgrade.go (1)
63-83: Unwrapsdk.Contextbefore using wasm keepers.The upgrade handler receives a
context.Context, butGetParamsandSetParamsboth demand ansdk.Context. Passing the rawctxwill not compile. Please unwrap once (sdkCtx := sdk.UnwrapSDKContext(ctx)) and reuse that for keeper acesso (and forRunMigrationstoo if your SDK version still expectssdk.Contextthere) so the upgrade builds and runs.@@ -import ( - "context" - "fmt" +import ( + "context" + "fmt" @@ - "github.com/cosmos/cosmos-sdk/types/module" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" @@ - return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) @@ - toVM, err := up.MM.RunMigrations(ctx, up.Configurator, fromVM) + toVM, err := up.MM.RunMigrations(ctx, up.Configurator, fromVM) @@ - params := up.Keepers.Cosmos.Wasm.GetParams(ctx) + params := up.Keepers.Cosmos.Wasm.GetParams(sdkCtx) @@ - err = up.Keepers.Cosmos.Wasm.SetParams(ctx, params) + err = up.Keepers.Cosmos.Wasm.SetParams(sdkCtx, params)x/wasm/keeper/msg_filter.go (1)
95-193: Block Stargate messages to close the Phase 1 bypass
FilterMessagestill never inspectsmsg.Stargate, so these protobuf invocations fall through to the finalreturn nil. That re-opens the exact bypass we called out earlier—contracts can just route staking/distribution/governance ops through Stargate and ignore the Phase 1 policy. Add an explicit guard and label ingetMessageTypeso Stargate calls are rejected and logged.@@ // ALLOW IBC messages (for DeFi composability) if msg.IBC != nil { // IBC allowed in Phase 1 return nil } + + if msg.Stargate != nil { + return errorsmod.Wrap( + sdkerrors.ErrUnauthorized, + "Stargate messages not allowed", + ) + } @@ if msg.Custom != nil { return "custom" } + if msg.Stargate != nil { + return "stargate" + } + if msg.Any != nil { return msg.Any.TypeURL }app/sim_test.go (1)
547-548: Fix the app name assertion in the simulation helper
app.Name()still returnsakash.AppName(currently"akash"), so this helper fails as soon as it runs. Please align the expectation with the constant the rest of the suite uses.- require.Equal(t, "AkashApp", app.Name()) + require.Equal(t, akash.AppName, app.Name())x/wasm/module.go (1)
93-101: Expose wasm CLI entry points.This issue was previously flagged: Returning
nilfrom bothGetQueryCmdandGetTxCmdmeans noakash query wasm ...orakash tx wasm ...subcommands will be registered, blocking CLI-based contract operations (upload, instantiate, execute, query)._run/common.mk (1)
78-79: Serialize the node-init pipeline.This issue was previously flagged: The prerequisites are listed as peers with no ordering, allowing parallel execution with
make -j. This can cause race conditions (e.g.,node-init-genesis-accountsrunning beforenode-init-genesiscreates the genesis file).
🧹 Nitpick comments (1)
x/wasm/simulation/genesis.go (1)
9-15: Clean up copy/paste leftovers in wasm genesis simulation.Docstring still references “supply” and the local variable is called
takeGenesis, which makes this new helper harder to read. Please rename it to reflect the wasm module and adjust the comment for clarity.-// RandomizedGenState generates a random GenesisState for supply +// RandomizedGenState initializes the wasm module genesis for simulations func RandomizedGenState(simState *module.SimulationState) { - takeGenesis := &types.GenesisState{ + wasmGenesis := &types.GenesisState{ Params: types.DefaultParams(), } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(takeGenesis) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(wasmGenesis) }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (156)
.env(1 hunks).envrc(1 hunks).goreleaser-docker.yaml(3 hunks).goreleaser-test-bins.yaml(4 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_build/akash.Dockerfile(1 hunks)_run/.env(1 hunks)_run/.envrc(1 hunks)_run/.envrc_run(1 hunks)_run/common-base.mk(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)_run/node/.envrc(1 hunks)_run/node/.gitignore(1 hunks)_run/node/Makefile(1 hunks)app/app.go(9 hunks)app/app_configure.go(4 hunks)app/config.go(2 hunks)app/modules.go(4 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(9 hunks)app/testnet.go(1 hunks)app/types/app.go(8 hunks)app/upgrades.go(1 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/config.go(1 hunks)cmd/akash/cmd/root.go(5 hunks)cmd/akash/cmd/testnetify/config.go(1 hunks)cmd/akash/cmd/testnetify/testnetify.go(1 hunks)cmd/akash/cmd/testnetify/utils.go(1 hunks)cmd/akash/main.go(1 hunks)docgen/main.go(1 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)pubsub/bus_test.go(1 hunks)script/upgrades.sh(1 hunks)tests/e2e/certs_cli_test.go(1 hunks)tests/e2e/certs_grpc_test.go(1 hunks)tests/e2e/cli_test.go(1 hunks)tests/e2e/deployment_cli_test.go(1 hunks)tests/e2e/deployment_grpc_test.go(1 hunks)tests/e2e/grpc_test.go(1 hunks)tests/e2e/market_cli_test.go(1 hunks)tests/e2e/market_grpc_test.go(1 hunks)tests/e2e/provider_cli_test.go(1 hunks)tests/e2e/provider_grpc_test.go(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/network/network.go(1 hunks)testutil/network_suite.go(1 hunks)testutil/state/suite.go(1 hunks)testutil/types.go(1 hunks)tools/upgrade-info/main.go(1 hunks)upgrades/software/v1.0.0/audit.go(0 hunks)upgrades/software/v1.0.0/cert.go(0 hunks)upgrades/software/v1.0.0/deployment.go(0 hunks)upgrades/software/v1.0.0/escrow.go(0 hunks)upgrades/software/v1.0.0/init.go(0 hunks)upgrades/software/v1.0.0/market.go(0 hunks)upgrades/software/v1.0.0/provider.go(0 hunks)upgrades/software/v1.0.0/take.go(0 hunks)upgrades/software/v1.0.0/upgrade.go(0 hunks)upgrades/software/v2.0.0/init.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)upgrades/types/types.go(1 hunks)upgrades/upgrades.go(1 hunks)upgrades/upgrades_test.go(1 hunks)util/partialord/internal/dag/dag_test.go(1 hunks)util/partialord/partialord.go(1 hunks)util/partialord/partialord_test.go(1 hunks)util/query/pagination.go(1 hunks)x/audit/alias.go(1 hunks)x/audit/genesis.go(1 hunks)x/audit/handler/handler.go(1 hunks)x/audit/handler/handler_test.go(1 hunks)x/audit/handler/msg_server.go(1 hunks)x/audit/keeper/grpc_query_test.go(2 hunks)x/audit/keeper/keeper_test.go(1 hunks)x/audit/keeper/key.go(1 hunks)x/audit/module.go(1 hunks)x/cert/alias.go(1 hunks)x/cert/genesis.go(1 hunks)x/cert/handler/handler.go(1 hunks)x/cert/handler/handler_test.go(1 hunks)x/cert/handler/msg_server.go(1 hunks)x/cert/keeper/grpc_query.go(1 hunks)x/cert/keeper/grpc_query_test.go(1 hunks)x/cert/keeper/keeper_test.go(1 hunks)x/cert/keeper/key.go(1 hunks)x/cert/module.go(1 hunks)x/cert/utils/key_pair_manager.go(1 hunks)x/cert/utils/utils.go(1 hunks)x/deployment/alias.go(1 hunks)x/deployment/genesis.go(1 hunks)x/deployment/handler/handler.go(1 hunks)x/deployment/handler/handler_test.go(1 hunks)x/deployment/handler/server.go(1 hunks)x/deployment/keeper/grpc_query.go(1 hunks)x/deployment/keeper/grpc_query_test.go(1 hunks)x/deployment/keeper/keeper_test.go(1 hunks)x/deployment/module.go(1 hunks)x/deployment/simulation/operations.go(1 hunks)x/escrow/genesis.go(1 hunks)x/escrow/handler/handler.go(1 hunks)x/escrow/handler/server.go(1 hunks)x/escrow/keeper/grpc_query.go(1 hunks)x/escrow/keeper/grpc_query_test.go(1 hunks)x/escrow/keeper/keeper_test.go(1 hunks)x/escrow/module.go(1 hunks)x/escrow/query/querier.go(1 hunks)x/market/alias.go(1 hunks)x/market/client/rest/params.go(1 hunks)x/market/client/rest/rest.go(1 hunks)x/market/genesis.go(1 hunks)x/market/handler/handler_test.go(1 hunks)x/market/handler/keepers.go(1 hunks)x/market/keeper/grpc_query.go(1 hunks)x/market/keeper/grpc_query_test.go(1 hunks)x/market/keeper/keeper.go(1 hunks)x/market/keeper/keeper_test.go(1 hunks)x/market/module.go(1 hunks)x/market/query/path.go(1 hunks)x/market/simulation/operations.go(1 hunks)x/market/simulation/utils.go(1 hunks)x/provider/alias.go(1 hunks)x/provider/genesis.go(1 hunks)x/provider/handler/handler.go(1 hunks)x/provider/handler/handler_test.go(1 hunks)x/provider/handler/server.go(1 hunks)x/provider/keeper/grpc_query_test.go(1 hunks)x/provider/keeper/keeper_test.go(1 hunks)x/provider/module.go(1 hunks)x/provider/simulation/operations.go(1 hunks)x/take/genesis.go(1 hunks)x/take/handler/server.go(1 hunks)x/take/module.go(1 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/handler/server.go(1 hunks)x/wasm/keeper/grpc_query.go(1 hunks)x/wasm/keeper/keeper.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/decoder.go(1 hunks)x/wasm/simulation/genesis.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (10)
- upgrades/software/v1.0.0/market.go
- upgrades/software/v1.0.0/audit.go
- upgrades/software/v1.0.0/deployment.go
- tests/upgrade/config-v0.24.0.tmpl.json
- upgrades/software/v1.0.0/cert.go
- upgrades/software/v1.0.0/init.go
- upgrades/software/v1.0.0/take.go
- upgrades/software/v1.0.0/upgrade.go
- upgrades/software/v1.0.0/escrow.go
- upgrades/software/v1.0.0/provider.go
✅ Files skipped from review due to trivial changes (8)
- x/audit/genesis.go
- x/escrow/keeper/keeper_test.go
- _run/node/.gitignore
- x/audit/handler/handler.go
- util/partialord/internal/dag/dag_test.go
- x/market/client/rest/rest.go
- x/wasm/simulation/decoder.go
- tests/upgrade/test-cases.json
🚧 Files skipped from review as they are similar to previous changes (71)
- tests/e2e/market_cli_test.go
- x/deployment/keeper/grpc_query.go
- x/provider/module.go
- x/provider/simulation/operations.go
- x/deployment/handler/server.go
- x/provider/keeper/grpc_query_test.go
- x/cert/genesis.go
- x/market/query/path.go
- x/provider/keeper/keeper_test.go
- x/take/module.go
- x/wasm/keeper/grpc_query.go
- tests/e2e/deployment_cli_test.go
- x/escrow/keeper/grpc_query.go
- app/upgrades.go
- x/deployment/genesis.go
- x/wasm/genesis.go
- x/provider/handler/handler_test.go
- x/market/keeper/keeper.go
- x/market/keeper/grpc_query.go
- x/cert/alias.go
- x/audit/keeper/keeper_test.go
- pubsub/bus_test.go
- x/cert/handler/msg_server.go
- _build/akash.Dockerfile
- x/cert/keeper/key.go
- tests/e2e/provider_cli_test.go
- cmd/akash/main.go
- x/deployment/alias.go
- x/cert/utils/key_pair_manager.go
- tests/e2e/grpc_test.go
- _run/common-commands.mk
- x/market/keeper/grpc_query_test.go
- x/wasm/handler/server.go
- testutil/network_suite.go
- x/cert/handler/handler_test.go
- tests/e2e/certs_grpc_test.go
- util/partialord/partialord.go
- x/deployment/handler/handler_test.go
- _run/node/.envrc
- x/market/simulation/operations.go
- .goreleaser.yaml
- tests/e2e/certs_cli_test.go
- meta.json
- x/audit/module.go
- _run/common-base.mk
- app/sim/sim_utils.go
- .env
- cmd/akash/cmd/testnetify/testnetify.go
- x/audit/keeper/grpc_query_test.go
- cmd/akash/cmd/testnetify/utils.go
- x/take/handler/server.go
- x/cert/module.go
- x/deployment/keeper/grpc_query_test.go
- x/market/client/rest/params.go
- x/market/genesis.go
- x/market/simulation/utils.go
- x/deployment/handler/handler.go
- _run/.envrc_run
- app/testnet.go
- make/init.mk
- docgen/main.go
- x/audit/keeper/key.go
- make/setup-cache.mk
- app/config.go
- util/query/pagination.go
- x/audit/handler/msg_server.go
- x/wasm/alias.go
- util/partialord/partialord_test.go
- cmd/akash/cmd/app_creator.go
- x/cert/handler/handler.go
- x/market/handler/keepers.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
Makefile.envrc_run/common.mkmake/test-upgrade.mkmake/releasing.mk_run/node/Makefile
🧬 Code graph analysis (8)
upgrades/software/v2.0.0/init.go (2)
upgrades/types/types.go (1)
RegisterUpgrade(79-85)upgrades/software/v2.0.0/upgrade.go (1)
UpgradeName(21-21)
cmd/akash/cmd/root.go (1)
cmd/akash/cmd/config.go (1)
InitAppConfig(20-31)
app/sim_test.go (2)
app/app.go (3)
AppName(83-83)NewApp(110-294)AkashApp(97-107)app/sim/sim_utils.go (2)
CheckExportSimulation(78-103)SetupSimulation(23-49)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(139-150)upgrades/types/types.go (1)
IUpgrade(32-37)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
cmd/akash/cmd/config.go (1)
testutil/network/network.go (1)
DefaultConfig(603-651)
x/wasm/module.go (1)
x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
🪛 checkmake (0.2.2)
_run/node/Makefile
[warning] 4-4: Missing required phony target "all"
(minphony)
[warning] 4-4: Missing required phony target "clean"
(minphony)
[warning] 4-4: Missing required phony target "test"
(minphony)
🪛 dotenv-linter (4.0.0)
_run/.env
[warning] 2-2: [UnorderedKey] The AKASH_GAS_ADJUSTMENT key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 3-3: [UnorderedKey] The AKASH_CHAIN_ID key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 5-5: [UnorderedKey] The AKASH_GAS_PRICES key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 6-6: [UnorderedKey] The AKASH_GAS key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 7-7: [UnorderedKey] The AKASH_NODE key should go before the AKASH_YES key
(UnorderedKey)
⏰ 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). (3)
- GitHub Check: lint-shell
- GitHub Check: lint-go
- GitHub Check: tests
🔇 Additional comments (67)
x/cert/utils/utils.go (1)
10-10: LGTM! Import path updated for v2 module migration.The import path has been correctly updated from
pkg.akt.dev/node/x/cert/errorstopkg.akt.dev/node/v2/x/cert/errorsas part of the v2 module migration. The usage ofcerterrors.ErrCertificatethroughout the file remains unchanged and correct.x/take/genesis.go (1)
8-8: LGTM! Import path correctly updated to v2.The keeper import path has been properly updated to reflect the v2 module namespace, consistent with the broader migration described in the PR objectives.
x/deployment/simulation/operations.go (1)
24-26: LGTM! Import paths correctly updated to v2.The import paths for
appparams,testsim, andkeeperhave been correctly updated to the v2 module paths, consistent with the broader v2 migration across the repository.x/deployment/module.go (1)
25-27: LGTM! Import paths correctly updated to v2.The import paths for
handler,keeper, andsimulationhave been correctly updated to the v2 module paths, aligning with the repository-wide v2 migration.x/cert/keeper/keeper_test.go (1)
22-22: LGTM! Import path correctly updated for v2.The import path has been properly updated to reflect the v2 module structure, consistent with the PR's module version bump. Test logic remains unchanged.
script/upgrades.sh (1)
550-551: Original review comment's assumption about akash CLI signature requires verification.The web search for v1.0.0-rc0+ shows the command uses flag-based arguments (--amount, --pubkey, --moniker, etc.), but does not document a positional JSON file path parameter. The code at line 551 passes
"$valdir/validator.json"as a positional argument, which appears inconsistent with the documented signature.Before approving, confirm:
- Whether
akash tx staking create-validator <file-path>actually works in versions >= v1.0.0-rc0, or- Whether line 551 should instead extract and pass individual fields from
validator.json(matching the older approach in the else block).x/deployment/keeper/keeper_test.go (1)
14-15: LGTM! Import paths correctly updated for v2 migration.The import path updates from
pkg.akt.dev/nodetopkg.akt.dev/node/v2align with the broader module version bump described in the PR summary.x/escrow/query/querier.go (1)
7-7: Import path alignment looks goodThanks for updating the stub to reference the v2 escrow keeper so it stays consistent with the rest of the module migrations.
x/escrow/keeper/grpc_query_test.go (1)
22-47: State test harness update makes senseSwitching to
state.SetupTestSuitekeeps the keeper tests on the same v2 wiring and gives each run its own temp home directory, which matches the new app scaffolding.tools/upgrade-info/main.go (1)
11-11: CLI util import matches v2 moduleGood call updating the upgrade-info tool to the v2 util package so it builds against the new module path.
x/escrow/handler/server.go (1)
9-9: Keeper import migration is consistentAligning the handler with the v2 escrow keeper keeps the message server wired into the same module version as the rest of the stack.
.envrc (1)
102-104: Manual verification needed for PATH precedence impactThe review concern about
PATH_addordering cannot be fully verified because:
- The variables
$AKASH_DEVCACHE_BINand$AKASH_DEVCACHE_NODE_BINare not defined in.envrcand their sources could not be traced in the codebase- The actual directories and their contents are only resolved at runtime
- Cannot confirm whether the order was swapped versus newly added
Please verify manually:
- Whether this change reordered these two
PATH_addcalls (check your local git history)- Whether any overlapping binaries exist between
$AKASH_DEVCACHE_BINand$AKASH_DEVCACHE_NODE_BINthat could shadow each other- Whether this precedence change aligns with your intended tool resolution priority
x/cert/keeper/grpc_query.go (1)
15-15: LGTM: Import path updated to v2.This import path change is part of the systematic v2 module migration across the codebase.
x/audit/handler/handler_test.go (1)
26-27: LGTM: Test imports updated to v2.The import path changes align with the repository-wide v2 module migration. Test logic remains unchanged.
testutil/state/suite.go (1)
29-37: LGTM: Test utility imports migrated to v2.All import paths have been consistently updated to reference v2 modules, aligning with the broader repository migration.
x/provider/genesis.go (1)
12-12: LGTM: Provider keeper import updated to v2.This import path change is part of the systematic v2 module migration.
_run/.env (1)
1-7: LGTM: Local development environment configuration.The environment variables provide sensible defaults for running a local Akash node, with appropriate settings for keyring backend, gas configuration, and node connection.
x/cert/keeper/grpc_query_test.go (1)
17-18: LGTM: Test imports updated to v2.The import path changes align with the repository-wide v2 module migration. Test logic remains intact.
x/audit/alias.go (1)
6-6: LGTM: Audit keeper import updated to v2.This import path change is part of the systematic v2 module migration.
upgrades/types/types.go (1)
13-13: LGTM: App types import updated to v2.This import path change ensures the upgrade types reference the v2 app types, consistent with the broader module migration.
_run/.envrc (1)
1-11: LGTM! Clean environment setup script.The direnv configuration properly validates required dependencies (grpcurl, tqdm) and loads environment variables. The structure follows direnv best practices.
.goreleaser-docker.yaml (3)
22-26: LGTM! Appropriate linker flags for WASM integration.The ldflags correctly configure static linking with architecture-specific wasmvm_muslc libraries for amd64. The
-s -wflags strip debug symbols, and-linkmode=externalwith custom extldflags properly wire the musl C WASM libraries.
41-45: LGTM! ARM64 linker configuration mirrors AMD64 correctly.The ARM64 build uses the appropriate aarch64 variant of wasmvm_muslc with identical static linking strategy.
47-47: LGTM! Dockerfile path update is consistent.The dockerfile path has been updated from
_build/Dockerfile.akashto_build/akash.Dockerfileconsistently across both architecture builds.Also applies to: 62-62
x/provider/alias.go (1)
6-6: LGTM! Import path updated for v2 module migration.The import path correctly reflects the module-wide migration from v1 to v2, while exported symbols remain unchanged.
.goreleaser-test-bins.yaml (3)
19-20: LGTM! Darwin CGO configuration for WASM support.The CGO flags correctly point to the cached library directory and set minimum macOS version requirements for both AMD64 and ARM64 builds.
Also applies to: 39-40
23-23: LGTM! static_wasm build tag added for Darwin.The
static_wasmtag properly enables WASM support for macOS builds.Also applies to: 43-43
64-67: LGTM! Linux builds configured with WASM static linking.The Linux builds correctly use BUILD_LDFLAGS with architecture-specific wasmvm_muslc libraries and appropriate static linking flags.
Also applies to: 83-86
make/releasing.mk (5)
41-41: LGTM! Build target now uses BUILD_FLAGS.The build target correctly passes BUILD_FLAGS to the Go build command, ensuring consistent build configuration.
44-45: LGTM! AKASH target wired for WASM library dependencies.The akash binary target now depends on wasmvm-libs and uses BUILD_FLAGS, ensuring WASM libraries are available before linking. The verbose flag aids debugging.
64-69: LGTM! Test bins consolidated to use unified build variables.The transition from separate BUILD_VARS, STRIP_FLAGS, and LINKMODE to unified BUILD_LDFLAGS and BUILD_TAGS simplifies the build configuration while ensuring wasmvm-libs are available.
86-91: LGTM! Docker image build updated consistently.The docker-image target correctly uses wasmvm-libs prerequisite and unified BUILD_TAGS/BUILD_LDFLAGS variables.
113-118: LGTM! Release target aligned with unified build system.The release target properly depends on wasmvm-libs and uses the consolidated BUILD_LDFLAGS/BUILD_TAGS approach.
Makefile (2)
23-26: LGTM! Build configuration variables properly initialized.The new BUILD_OPTIONS, BUILD_TAGS, DB_BACKEND, and BUILD_FLAGS variables provide a clean foundation for the configurable build system.
30-40: LGTM! Database backend and cgotrace selection logic.The conditional logic correctly selects the database backend based on BUILD_OPTIONS and conditionally adds the cgotrace tag.
make/test-upgrade.mk (3)
24-24: LGTM! Snapshot source default simplified.Changing the default from
sandbox1tosandboxstreamlines the configuration. The sandbox1-specific branch has been removed from the conditional logic.
67-67: LGTM! Test invocation now receives source directory.Adding
-sourcesdir=$(AKASH_ROOT)provides the test with the repository root path, which is necessary for v2 upgrade testing.
76-76: LGTM! Bins step enabled in test-reset.Uncommenting the bins invocation ensures required binaries are built during test reset.
go.mod (3)
1-1: LGTM! Module path migrated to v2.The module path bump to
pkg.akt.dev/node/v2follows Go module versioning semantics for major version changes and aligns with the repository-wide v2 migration.
7-11: LGTM! Dependency updates are appropriate.The dependency updates to cosmos-sdk, ibc-go, prometheus, and golang.org/x packages are minor/patch version bumps that align with the v2 migration and WASM integration.
Also applies to: 21-24, 34-52
64-64: LGTM! Akash cosmos-sdk fork updated consistently.The cosmos-sdk replacement correctly references the akash.10 variant at v0.53.4, aligning with the broader v2 upgrade.
tests/e2e/provider_grpc_test.go (1)
16-16: LGTM: Import path updated for v2 module migration.The import path has been correctly updated to align with the v2 module namespace.
tests/upgrade/test-config.json (1)
3-5: Verify that removing the second validator aligns with v2 upgrade test requirements.The validators array has been reduced from two validators to one. Ensure this change is intentional and that removing
.akash1doesn't negatively impact upgrade test coverage or validation scenarios for the v2 upgrade path.cmd/akash/cmd/testnetify/config.go (1)
15-15: LGTM: Import path updated for v2 module migration.The import path has been correctly updated to align with the v2 module namespace.
testutil/network/network.go (1)
52-52: LGTM: Import path updated for v2 module migration.The import path has been correctly updated to align with the v2 module namespace.
x/escrow/handler/handler.go (1)
9-9: LGTM: Import path updated for v2 module migration.The import path has been correctly updated to align with the v2 module namespace.
x/escrow/genesis.go (1)
14-14: LGTM: Import path updated for v2 module migration.The import path has been correctly updated to align with the v2 module namespace.
x/market/keeper/keeper_test.go (1)
17-18: LGTM: Import paths updated for v2 module migration.The import paths have been correctly updated to align with the v2 module namespace.
tests/upgrade/types/types.go (1)
14-14: Verify that the SourceDir initialization is protected by config invariants.The
SourceDirfield is properly initialized and used in the normal flow: it's assigned at line 398 ofupgrade_test.gowithin the loop overcfg.Validators, and consumed at line 89 ofworkers_test.go. However, the assignment occurs only when the conditioncfg.Work.Home == namematches. If the configuration file hascfg.Work.Homeas a value not present incfg.Validators, the field would remain uninitialized (empty string), causing file path construction to fail. Ensure your test configuration files maintain this invariant—i.e., that thework.homeentry in the JSON config always corresponds to one of the validators in thevalidatorsarray.tests/e2e/market_grpc_test.go (1)
22-22: LGTM! Test utilities import updated to v2.testutil/types.go (1)
17-18: LGTM! Import paths correctly migrated to v2.x/provider/handler/handler.go (1)
10-11: LGTM! Import paths updated to v2 module locations.x/market/module.go (1)
24-28: LGTM! All market module imports correctly updated to v2.tests/e2e/deployment_grpc_test.go (1)
17-17: LGTM! Test utilities import updated to v2.upgrades/upgrades_test.go (1)
11-11: LGTM! Upgrades types import updated to v2.x/provider/handler/server.go (1)
11-12: LGTM! Import paths correctly updated to v2.Verification confirmed that all v1 import paths have been consistently updated across the codebase—no remaining v1 imports detected.
upgrades/upgrades.go (1)
5-5: Upgrade registration verified and complete.The v2.0.0 upgrade implementation is properly in place with complete
StoreLoader()andUpgradeHandler()methods. The anonymous import inupgrades/upgrades.gocorrectly triggers the registration via theinit()function inupgrades/software/v2.0.0/init.go.tests/upgrade/sdktypes.go (1)
1-56: LGTM!The type definitions are clean and serve their purpose well for upgrade simulation. The JSON tags are properly formatted, and the comment at lines 10-11 clearly explains why these types are defined separately rather than using SDK-generated types.
x/wasm/module.go (4)
26-47: LGTM!The interface assertions and type definitions follow Cosmos SDK module patterns correctly. The comprehensive interface assertions ensure compile-time verification that the module implements all required interfaces.
49-91: LGTM!The
AppModuleBasicmethods are implemented correctly with proper error handling inValidateGenesis(nil check at line 72-74) and appropriate registration of interfaces and gRPC gateway routes.
103-158: LGTM!The module lifecycle methods are properly implemented. The service registration at lines 129-131 correctly wires both the message server and query server, and the genesis handlers appropriately delegate to the genesis functions.
160-183: LGTM!The simulation integration is properly implemented. The module correctly delegates to the simulation package for randomized genesis and proposal messages, and returns
ConsensusVersionof 1, which is appropriate for a new module._run/common.mk (5)
1-10: LGTM!The build option handling and include of
common-base.mkfollow standard Makefile patterns. Thenobuildoption detection is implemented correctly.
12-44: LGTM!The variable definitions and environment exports are well-structured. The shell arithmetic for deposit calculations (lines 32-33) is correct, and the exported environment variables provide sensible defaults for local testing.
46-76: LGTM!The initialization workflow is well-structured with proper use of intermediate targets and pattern rules. The multisig key setup at lines 73-76 correctly uses comma-separated signers with a threshold of 2.
81-122: LGTM on individual steps!Each node initialization step is correctly implemented. The genesis manipulation using
jq(lines 86-89), certificate generation, account addition, and finalization are all properly structured. The ordering issue between these steps has been flagged separately.
124-142: LGTM!The runtime and cleanup targets are properly implemented. The
node-runcommand correctly references theAKASH_GAS_PRICESenvironment variable, and therosetta-runtarget includes all necessary parameters.
There was a problem hiding this 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 (2)
go.mod (1)
17-18:⚠️ [DUPLICATE] wasmd v0.61.6 does not exist; update to valid version.This issue was flagged in the previous review. The version
v0.61.6is not a real release in the wasmd repository. The latest available in the v0.61 series is v0.61.4. Please correct this to:- github.com/CosmWasm/wasmd v0.61.6 + github.com/CosmWasm/wasmd v0.61.4After updating, run
go mod tidyto ensure consistency with go.sum.upgrades/software/v2.0.0/upgrade.go (1)
60-86: Address the critical context unwrapping issue.This is a duplicate of a previous review comment. The upgrade handler passes the raw
context.Contextto keeper and module methods that expectsdk.Context, which will cause compilation or runtime failures.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (12)
go.mod(12 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
🚧 Files skipped from review as they are similar to previous changes (5)
- tests/upgrade/test-cases.json
- make/test-upgrade.mk
- script/upgrades.sh
- tests/upgrade/types/types.go
- tests/upgrade/test-config.json
🧰 Additional context used
🧬 Code graph analysis (3)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
tests/upgrade/workers_test.go (1)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(139-150)upgrades/types/types.go (1)
IUpgrade(32-37)
⏰ 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). (9)
- GitHub Check: release-dry-run
- GitHub Check: build-bins
- GitHub Check: sims
- GitHub Check: lint-shell
- GitHub Check: lint-go
- GitHub Check: tests
- GitHub Check: coverage
- GitHub Check: network-upgrade-names
- GitHub Check: build-macos
🔇 Additional comments (11)
go.mod (1)
1-1: Major version bump to v2 requires migration plan confirmation.The module path changed from
pkg.akt.dev/nodetopkg.akt.dev/node/v2, which is a breaking change. Please confirm:
- All dependent repositories have been updated to import from
pkg.akt.dev/node/v2- Release notes clearly document this breaking change
- This aligns with semantic versioning expectations for the CosmWasm integration feature
upgrades/software/v2.0.0/upgrade.go (1)
69-78: Verify the intended permission model for contract instantiation.The comments state "RESTRICTED TO GOVERNANCE ONLY" and "maximum security for mainnet deployment," but Line 78 sets
InstantiateDefaultPermission = wasmtypes.AccessTypeEverybody, which allows anyone to instantiate contracts. This creates an asymmetric permission model: only governance can upload code (Line 76), but anyone can instantiate it.Please confirm this is the intended security model. If instantiation should also be restricted, consider using a more restrictive permission level.
meta.json (1)
48-52: LGTM!The v2.0.0 upgrade configuration is correctly structured and consistent with existing upgrade entries.
tests/upgrade/upgrade_test.go (4)
641-651: LGTM!The new account response structures correctly model the SDK's auth module account response format for the v2 upgrade flow.
719-722: LGTM!Using
time.ParseDurationfor the voting period is more idiomatic than numeric parsing and aligns with the v2 SDK changes.
742-776: LGTM!The new proposal construction flow correctly builds the upgrade proposal as JSON and persists it to a file for submission. This aligns with the v2 governance submission workflow.
817-819: LGTM!The updated field access correctly reflects the v2 governance response structure where proposals have direct
TitleandIDfields.tests/upgrade/workers_test.go (3)
42-76: LGTM!The encoding configuration and client context setup correctly follows Cosmos SDK patterns for v2, properly registering module basics and configuring all necessary components including codec, interface registry, and keyring.
89-113: LGTM!The WASM deployment test correctly verifies that direct contract uploads are unauthorized, which aligns with the
CodeUploadAccess = AllowNobodypermission set in the v2.0.0 upgrade handler. The WASM file handling with compression checks is also appropriate.
115-145: LGTM!The governance-based deployment test correctly validates the permission model: it first confirms that submitting a proposal without the gov module account as sender fails, then succeeds when properly using the gov module account. This thoroughly tests the governance-only upload restriction.
tests/upgrade/sdktypes.go (1)
1-56: LGTM!The SDK-specific type definitions are well-structured with proper JSON tags and clearly document their purpose for upgrade simulation without importing conflicting SDK versions. All types correctly model the expected SDK response formats.
There was a problem hiding this 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)
upgrades/software/v2.0.0/upgrade.go (1)
51-86: Unwrap SDK context and remove redundant assignment.Two issues flagged in previous reviews remain unresolved:
Critical: Lines 63, 68, and 80 pass
context.Contextto keeper/module methods that expectsdk.Context. This will cause compilation failures or runtime panics. Unwrap once at the start:sdkCtx := sdk.UnwrapSDKContext(ctx)and usesdkCtxfor all keeper/module calls.Minor: Lines 72-74 set
params.CodeUploadAccessto a struct, then line 76 immediately overwrites it withwasmtypes.AllowNobody. Remove the first assignment (lines 72-74).Apply these fixes:
func (up *upgrade) UpgradeHandler() upgradetypes.UpgradeHandler { return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // Set wasm old version to 1 if we want to call wasm's InitGenesis ourselves // in this upgrade logic ourselves. // @@ -60,27 +61,24 @@ // Set the initial wasm module version //fromVM[wasmtypes.ModuleName] = wasm.AppModule{}.ConsensusVersion() - toVM, err := up.MM.RunMigrations(ctx, up.Configurator, fromVM) + toVM, err := up.MM.RunMigrations(sdkCtx, up.Configurator, fromVM) if err != nil { return toVM, err } - params := up.Keepers.Cosmos.Wasm.GetParams(ctx) + params := up.Keepers.Cosmos.Wasm.GetParams(sdkCtx) // Configure code upload access - RESTRICTED TO GOVERNANCE ONLY // Only governance proposals can upload contract code // This provides maximum security for mainnet deployment - params.CodeUploadAccess = wasmtypes.AccessConfig{ - Permission: wasmtypes.AccessTypeNobody, - } - params.CodeUploadAccess = wasmtypes.AllowNobody // Configure instantiate default permission params.InstantiateDefaultPermission = wasmtypes.AccessTypeEverybody - err = up.Keepers.Cosmos.Wasm.SetParams(ctx, params) + err = up.Keepers.Cosmos.Wasm.SetParams(sdkCtx, params) if err != nil { return toVM, err }Don't forget to add the import:
+ sdk "github.com/cosmos/cosmos-sdk/types"x/wasm/module.go (1)
94-101: Verify alternative CLI command registration.This issue was flagged in a previous review. Both
GetQueryCmdandGetTxCmdpanic rather than returning CLI commands. The panic message indicates "akash modules do not export cli commands via cosmos interface," suggesting an alternative registration mechanism is used.Please verify that wasm CLI commands are registered through an alternative mechanism (e.g., in
cmd/files) to ensure operators can upload code, instantiate contracts, and query the module.Run this script to check for alternative CLI wiring:
#!/bin/bash # Search for wasm CLI command registration in cmd/ files rg -nP --type=go -C3 'wasm.*(?:Query|Tx).*Command|AddCommand.*wasm' cmd/app/app.go (1)
138-146: Fix undefined identifier and typo in panic message.This issue was already flagged in a previous review. Line 144 references
vlin the panic message, butvlis only scoped inside theif validblock on line 141. Additionally, the panic message contains a typo: "aptOpts" should be "appOpts".Apply this diff to fix both issues:
- panic(fmt.Sprintf("invalid type for aptOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(vl).String())) + panic(fmt.Sprintf("invalid type for appOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(val).String()))
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (16)
app/app.go(9 hunks)app/types/app.go(8 hunks)go.mod(12 hunks)make/releasing.mk(4 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)x/wasm/module.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/upgrade/test-cases.json
- tests/upgrade/test-config.json
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
make/test-upgrade.mkmake/releasing.mk
🧬 Code graph analysis (4)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(135-146)upgrades/types/types.go (1)
IUpgrade(32-37)
x/wasm/module.go (1)
x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
⏰ 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). (8)
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: network-upgrade-names
- GitHub Check: build-macos
- GitHub Check: build-bins
- GitHub Check: tests
🔇 Additional comments (31)
go.mod (1)
1-1: LGTM! Module path upgrade and CosmWasm integration look good.The module path migration to v2 is consistent, CosmWasm dependencies (wasmd v0.61.6, wasmvm/v3 v3.0.2) are correctly added, and the cosmos-sdk fork replacement is properly updated to the akash.10 variant for v0.53.4.
Also applies to: 17-18, 64-64
tests/upgrade/types/types.go (1)
14-14: LGTM! New field added to support test source directory.The
SourceDirfield enables tests to locate upgrade-related resources and is properly utilized in the upgrade test flow.meta.json (1)
48-52: LGTM! v2.0.0 upgrade entry correctly configured.The upgrade path from v1.0.0 (binary v1.0.3-rc4) to v2.0.0 is properly defined and aligns with the v2.0.0 upgrade handler implementation.
tests/upgrade/upgrade_test.go (4)
234-234: LGTM! Sources directory support added correctly.The new
sourcesdirflag enables tests to locate upgrade-related resources (e.g., test WASM files). The flag is validated, trimmed, and properly propagated toTestParams.SourceDir.Also applies to: 271-271, 287-287, 398-398
641-651: LGTM! Module account querying aligns with SDK v0.50+ patterns.The new account-related types and module account query logic correctly retrieve the gov module's authority address for use in upgrade proposals, matching the updated governance message format.
Also applies to: 683-693
719-722: LGTM! Upgrade proposal construction updated for SDK v0.50+.The migration from numeric vote period to duration parsing, dynamic height calculation, and new proposal structure (
SoftwareUpgradeProposalwrapped inProposalMsg) correctly aligns with the SDK's v0.50+ governance changes.Also applies to: 735-740, 742-776
792-792: LGTM! Timeout and proposal field access updated appropriately.The increased submission wait (12s→18s) accounts for potentially slower block production, and the proposal retrieval now correctly uses
TitleandIDfields instead of legacyContent.TitleandProposalID.Also applies to: 817-819
tests/upgrade/sdktypes.go (1)
1-56: LGTM! SDK types defined for upgrade simulation.The types avoid SDK version conflicts during upgrade tests and accurately model SDK v0.50+ governance structures (
SoftwareUpgradeProposal,ProposalMsg) and query responses (nodeStatus,govParams,proposalResp).tests/upgrade/workers_test.go (3)
34-34: LGTM! Post-upgrade worker migrated to v2.0.0.The worker registration, struct definition, and encoding config setup are correctly updated for the v2 upgrade path, using Akash's v2
ModuleBasics()and updated broadcast mode constants.Also applies to: 37-37, 42-43, 49-54
69-98: LGTM! Test setup correctly retrieves address and loads WASM file.The keyring lookup, address extraction, context setup, and WASM file loading (with proper gzip compression check) are all correctly implemented using the new
SourceDirparameter.
100-145: LGTM! WASM permission validation tests governance restrictions.The test correctly validates the v2.0.0 upgrade's wasm permissions (
CodeUploadAccess = AllowNobody):
- Direct
MsgStoreCodeby user → fails withErrUnauthorized✓- Gov proposal with user as sender → fails ✓
- Gov proposal with gov module account as sender → succeeds ✓
This thoroughly exercises the governance-only contract upload flow.
make/test-upgrade.mk (3)
24-24: LGTM: Default snapshot source updated to match supported values.The default value change from
sandbox1tosandboxis correct and prevents the error that would have been triggered at line 33, since onlymainnetandsandboxare valid options in the conditional logic below.
76-76: LGTM: Bins command correctly activated for test-reset.Activating the
binsinvocation in thetest-resettarget is appropriate, as resetting the test environment should rebuild or fetch the necessary binaries. This aligns with the other upgrade script invocations in the same target.
67-67: No issues found - code is correct as written.AKASH_ROOT is validated in make/init.mk (lines 19-21) with an error if not set, confirming it's properly defined as an environment variable. The comment indicates it's sourced from direnv, which is the intended design pattern for this project. The usage of
-sourcesdir=$(AKASH_ROOT)in test-upgrade.mk:67 is correct.make/releasing.mk (4)
86-91: Consistent changes with test-bins target.The changes here mirror those in the
test-binstarget (addingwasmvm-libsprerequisite and renaming environment variables), which ensures consistency across Docker-based build targets.
113-118: Critical release target updated for WASM support.The addition of
wasmvm-libsas a prerequisite for thereleasetarget is appropriate for enabling smart contract support. The environment variable renaming is consistent with other targets. Given this is the production release workflow, ensure thewasmvm-libstarget has clear error messages if it fails to build.
64-69: No breaking changes - this is internal makefile refactoring.The environment variable rename is not a breaking change. The original
BUILD_TAGSandldflagsvariables remain defined in the Makefile (lines 24 and 45). The change introducesGORELEASER_TAGSandGORELEASER_LDFLAGSas makefile-level aliases that reference the original variables. The docker container still receives environment variables namedBUILD_TAGSandBUILD_LDFLAGS, so external CI scripts and workflows are unaffected. No external references to these variables exist outside the makefiles.
41-41: All verifications passed—thewasmvm-libstarget and variable definitions are correct.The
wasmvm-libstarget is properly defined inmake/setup-cache.mk:66and marked.PHONY. BothGORELEASER_TAGS(line 67 in root Makefile) andGORELEASER_LDFLAGS(line 53 in root Makefile) are correctly defined. The changes tomake/releasing.mkproperly use these variables and maintain consistency with the existing build system. No breaking changes detected.app/app.go (3)
9-9: LGTM: Import additions support wasm integration.The added imports (reflect, CosmWasm modules, v2 module paths, awasm alias) correctly support the wasm integration and v2 path migrations.
Also applies to: 29-31, 69-69, 73-79
183-193: LGTM: InitNormalKeepers call updated with wasm parameters.The method call correctly passes
wasmDir,wasmConfig, andwasmOptsto support wasm initialization.
297-329: LGTM: Module ordering consistent for wasm integration.The ordering of
awasm.ModuleNamebeforewasmtypes.ModuleName, with both after IBC transfer, is consistently applied in bothorderBeginBlockersandOrderEndBlockers. The comments clearly document the ordering requirements.Also applies to: 332-362
app/types/app.go (6)
17-19: LGTM: Import additions support wasm integration.The added wasm-related imports (wasmkeeper, wasmtypes, transferv2, ibcapi, v2 keeper paths) correctly support the wasm integration.
Also applies to: 56-56, 60-60, 69-69, 75-75, 78-87
114-117: LGTM: Wasm keeper fields added.The addition of
Wasmfields to both Cosmos and Akash keeper structs correctly supports the wasm integration. Note that ICA keepers are commented out rather than removed.Also applies to: 127-127
248-258: LGTM: InitNormalKeepers signature extended for wasm support.The signature correctly adds
wasmDir,wasmConfig, andwasmOptsparameters to support wasm keeper initialization.
454-494: LGTM: Comprehensive wasm keeper initialization.Both Akash and CosmWasm keepers are properly initialized:
- Akash wasm keeper with message filter decorator integration
- CosmWasm keeper with all required dependencies (account, bank, staking, distribution, IBC, transfer)
- Custom "akash" capability added to enable akash-specific contract features
496-528: LGTM: IBC routing correctly configured for wasm.The IBC routing setup properly integrates wasm:
wasmStackIBCHandlerwraps wasm keeper with IBC channel and transfer keepers- Static IBC router (v1) includes routes for transfer and wasm modules
- IBC v2 router adds transfer and wasm with proper port/prefix routing
Note: The ICA controller stack (lines 499-512) is commented out, so the past review concern about uninitialized ICA keepers is no longer applicable.
585-609: LGTM: Store keys added for wasm modules.Both
wasmtypes.ModuleName(line 603) andawasm.StoreKey(line 620) are correctly added to their respective store key lists, maintaining consistency with the module ordering.Also applies to: 611-622
x/wasm/module.go (4)
1-47: LGTM: Standard module scaffolding.The package imports, interface compliance assertions, and type definitions follow standard Cosmos SDK module patterns.
49-91: LGTM: AppModuleBasic methods properly implemented.All
AppModuleBasicmethods correctly delegate to the types package or provide standard implementations. The gRPC gateway routes are properly registered.
103-143: LGTM: AppModule lifecycle methods properly implemented.The module constructor, service registration, and block lifecycle methods are correctly implemented:
NewAppModuleproperly initializes with codec and keeperRegisterServiceswires msg and query serversBeginBlockandEndBlockare no-ops (acceptable for this module)
145-183: LGTM: Genesis and simulation methods properly implemented.Genesis and simulation methods are correctly implemented:
InitGenesisandExportGenesisdelegate to package-level functionsConsensusVersionappropriately returns 1- Simulation methods delegate to the simulation package
e09983a to
e5c0edb
Compare
47434f8 to
dd9dc31
Compare
There was a problem hiding this 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
♻️ Duplicate comments (3)
x/wasm/module.go (1)
94-101: CLI commands panic by design - verify alternative CLI access exists.The panic messages indicate Akash intentionally doesn't export CLI commands via the Cosmos module interface. This differs from the past review comment's concern. Ensure that CLI functionality for wasm operations (upload, instantiate, execute, query) is available through an alternative mechanism in the Akash CLI structure.
#!/bin/bash # Search for alternative wasm CLI command registration rg -n "wasm.*Command|Command.*wasm" --type go -g 'cmd/**' -g 'cli/**' -A 5app/app.go (1)
138-146: Fix undefined identifier and typo in wasm option validation.Line 144 references
vlwhich is scoped only to theifblock on line 141, causing a compilation error. Additionally, there's a typo: "aptOpts" should be "appOpts".Apply this diff:
- panic(fmt.Sprintf("invalid type for aptOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(vl).String())) + panic(fmt.Sprintf("invalid type for appOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(val).String()))Makefile (1)
45-74: Critical:GORELEASER_LDFLAGScaptures incomplete ldflags.Line 52 sets
GORELEASER_LDFLAGS := $(ldflags)before the ldflags are fully constructed. Subsequent mutations (lines 54-69) add:
-linkmode=external(line 54)- Static/dynamic extldflags (lines 56-60)
- Strip flags
-s -w(line 64)- Custom
$(LDFLAGS)(line 68)None of these will appear in
GORELEASER_LDFLAGS, causing release artifacts to diverge from local builds and potentially lose static linking entirely.Move the
GORELEASER_LDFLAGSassignment to after all ldflags mutations (after line 69), or use a recursive assignment:ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ -X github.com/cosmos/cosmos-sdk/version.AppName=akash \ -X github.com/cosmos/cosmos-sdk/version.BuildTags="$(build_tags_cs)" \ -X github.com/cosmos/cosmos-sdk/version.Version=$(shell git describe --tags | sed 's/^v//') \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_HEAD_COMMIT_LONG) \ -X github.com/cosmos/cosmos-sdk/types.DBBackend=$(DB_BACKEND) -GORELEASER_LDFLAGS := $(ldflags) - ldflags += -linkmode=external ifeq (static-link,$(findstring static-link,$(BUILD_OPTIONS))) ldflags += -extldflags "-L$(AKASH_DEVCACHE_LIB) -Wl,-z,muldefs -static" else ldflags += -extldflags "-L$(AKASH_DEVCACHE_LIB)" endif # check for nostrip option ifeq (,$(findstring nostrip,$(BUILD_OPTIONS))) ldflags += -s -w BUILD_FLAGS += -trimpath endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) +GORELEASER_LDFLAGS := $(ldflags) + GORELEASER_TAGS := $(BUILD_TAGS) GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)'Alternatively, use a recursive assignment so it picks up later changes:
-GORELEASER_LDFLAGS := $(ldflags) +GORELEASER_LDFLAGS = $(ldflags)
🧹 Nitpick comments (3)
tests/upgrade/types/types.go (1)
14-14: Consider adding a documentation comment for the new field.The
SourceDirfield is now used to locate test data files during upgrade tests (e.g., wasm files in workers_test.go). Adding a brief comment would help clarify its purpose and expected format (e.g., absolute path, relative path, must exist).For example:
type TestParams struct { Home string Node string + // SourceDir is the root directory of the source repository for locating test data files SourceDir string ChainID stringtests/upgrade/upgrade_test.go (2)
641-651: Consider moving account types to sdktypes.go.The
baseAccount,moduleAccount, andaccountResptypes are JSON unmarshaling helpers similar to those defined in tests/upgrade/sdktypes.go. Moving them there would improve consistency and reusability across upgrade tests.This is a low-priority organizational improvement and can be deferred.
735-740: Consider documenting the block time assumption.The upgrade height calculation assumes a 6-second block time (line 740). While this is reasonable for Cosmos SDK chains, documenting this assumption or making it configurable would improve clarity and maintainability.
For example:
+ // Assume 6 second block time for height calculation upgradeHeight := int64(votePeriod/(6*time.Second)) + 10
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (21)
.github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)app/app.go(9 hunks)app/types/app.go(8 hunks)go.mod(12 hunks)make/releasing.mk(4 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)x/wasm/module.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
🚧 Files skipped from review as they are similar to previous changes (8)
- script/upgrades.sh
- tests/upgrade/test-config.json
- .github/actions/setup-ubuntu/action.yaml
- .goreleaser.yaml
- meta.json
- tests/upgrade/test-cases.json
- make/releasing.mk
- upgrades/software/v2.0.0/upgrade.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
make/test-upgrade.mkMakefile
🧬 Code graph analysis (3)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
x/wasm/module.go (1)
x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
⏰ 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). (9)
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-shell
- GitHub Check: network-upgrade-names
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: tests
- GitHub Check: build-macos
- GitHub Check: build-bins
🔇 Additional comments (33)
go.mod (4)
17-18: CosmWasm dependencies introduced—ensure smart contract execution security posture is reviewed.Lines 17–18 add
github.com/CosmWasm/wasmd v0.61.6andgithub.com/CosmWasm/wasmvm/v3 v3.0.2, which enable WebAssembly smart contract execution. This introduces significant new attack surface.Per previous review feedback, v0.61.6 is the latest wasmd release (verified November 5, 2025) and wasmvm/v3 v3.0.2 is the latest in that series with no known HIGH severity vulnerabilities. However, ensure:
- CosmWasm module integration is properly sandboxed and tested
- Smart contract validation and resource limits are enforced
- Execution environment security has undergone threat modeling
1-79: Review PR checklist against completed work before merge.Per the PR objectives, the PR author's checklist contains all items unchecked, including:
- ✗ Correct commit type prefix
- ✗ Breaking-change marker (if applicable)
- ✗ Link to relevant issue/specification
- ✗ Unit/integration tests added
- ✗ Changelog entry
- ✗ Go documentation comments
- ✗ Documentation updates
- ✗ Files changed reviewed
- ✗ CI passing
Before merge, confirm whether these items are actually complete but the checklist was not updated, or whether the PR is incomplete. A v2 module migration with CosmWasm support is a major change that requires thorough verification.
1-1: Verification complete: All imports correctly updated to pkg.akt.dev/node/v2.The codebase has been successfully updated. No old imports using
pkg.akt.dev/node(without/v2) were found, and new imports consistently usepkg.akt.dev/node/v2/across all modules including app, audit, cert, deployment, escrow, market, provider, take, and wasm packages.
64-64: I've confirmed the fork version is accessible and has a very recent commit (Nov 10, 2025). However, I need additional verification to assess maintenance status and the purpose of Akash-specific patches. Let me gather more information:I need more details on the specific patches applied in the Akash fork. Let me search for that:
Based on my verification, I have found sufficient information to assess the review comment. The fork version
v0.53.4-akash.10is accessible and was recently updated (Nov 10, 2025). The upstream Cosmos SDK v0.53.4 is a well-maintained, stable patch release. However, detailed information about the specific Akash patches is not publicly documented in release notes, which is a limitation I cannot overcome further.Fork is accessible and recently maintained; upstream SDK is stable.
The fork version
github.com/akash-network/cosmos-sdk v0.53.4-akash.10exists and was updated Nov 10, 2025. Upstream Cosmos SDK v0.53.4 is a patch release with minor dependency and non-breaking functionality additions that is fully API and state-compatible with all v0.53.x releases.However, the specific Akash-specific patches applied in the
-akash.10iteration are not publicly documented in accessible release notes. Without access to the fork's patch documentation or commit history details, the following cannot be conclusively verified:
- The exact purpose and scope of Akash-specific patches
- Whether a documented migration path back to upstream exists
- Any known compatibility gaps with the Cosmos ecosystem
Recommend: Confirm with Akash maintainers that the fork patches are documented internally, that they remain compatible with your application's requirements, and that a clear upgrade/downgrade path exists if needed to sync with upstream Cosmos SDK updates in the future.
tests/upgrade/sdktypes.go (1)
1-56: LGTM! Clean type definitions for upgrade simulation.The SDK-specific types are well-structured for JSON serialization/deserialization during upgrade testing. The comment at lines 10-11 appropriately explains the rationale for defining these types locally rather than importing SDK-generated types.
tests/upgrade/workers_test.go (7)
33-37: LGTM! Version upgrade to v2.0.0.The registration of the v2.0.0 post-upgrade worker and simplification of the
postUpgradestruct align with the v2 migration described in the PR summary.
41-62: LGTM! Standard SDK client context setup.The encoding configuration and client context are properly initialized using the v2 app module basics. All necessary parameters are provided for transaction broadcasting and signing.
69-86: LGTM! Proper keyring and client initialization.The keyring operations and client discovery follow standard patterns with appropriate error handling. Gas settings are reasonable for test transactions.
88-98: LGTM! Proper wasm file handling.The code correctly reads the test wasm file and ensures it's gzipped using wasmd's ioutils. Error handling and validation are appropriate for test scenarios.
100-113: LGTM! Correct test for unauthorized direct wasm deployment.The test properly validates that direct wasm contract deployment fails with
ErrUnauthorized, which is the expected behavior when wasm deployment is restricted to governance.
124-136: Verify the double unpacking pattern.The code unpacks the module account twice (lines 129 and 134). The first unpacking to
sdk.AccountIfollowed by type assertion and then a second unpacking tosdk.ModuleAccountIseems redundant.Consider simplifying to a single unpack operation:
var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()The type assertion at line 131 already provides
maccas aModuleAccountI, so the second unpacking at line 134 appears unnecessary unless there's a specific reason to re-unpack.
138-146: LGTM! Complete test flow for wasm deployment authorization.The test properly validates the three scenarios:
- Direct deployment fails (unauthorized)
- Governance proposal with wrong sender fails
- Governance proposal with gov module as sender succeeds
The use of gas simulation for the final broadcast is appropriate for test validation.
tests/upgrade/upgrade_test.go (5)
234-234: LGTM! Proper flag addition and validation.The
sourcesdirflag is properly declared, validated, and normalized (trailing slash removal) consistent with the existingworkdirflag handling.Also applies to: 271-271, 287-287
349-355: LGTM! Proper setup of cache directory and source directory.The code correctly sets up the cache directory from the first validator's home and propagates the source directory to test parameters for use by test workers.
Also applies to: 398-398
683-693: LGTM! Proper governance module account query.The code correctly queries and unmarshals the governance module account information needed for constructing the upgrade proposal.
742-776: LGTM! Proper governance proposal construction.The upgrade proposal is correctly constructed using the new v2 governance format with the gov module address as authority. The proposal is properly marshaled and written to a file for submission.
816-821: LGTM! Correct proposal lookup by title.The code properly searches for the proposal by matching the upgrade name with the proposal title, iterating backwards to find the most recent match.
app/app.go (3)
160-172: LGTM! Wasm configuration is properly initialized.The wasm directory setup, config reading, and security defaults (memory limits, query gas limit, debug mode disabled) are correctly implemented.
323-326: Verify module ordering dependencies.The comments indicate specific ordering requirements: awasm before wasm, and wasm after IBC transfer. Ensure these dependencies are validated during testing, particularly the interaction between the custom Akash wasm module and the standard CosmWasm module.
Also applies to: 356-359
231-234: LGTM! Proper error handling.The error from
RegisterServicesis now correctly captured and handled.app/types/app.go (4)
253-255: LGTM! Signature extended for wasm integration.The additional parameters
wasmDir,wasmConfig, andwasmOptsproperly support wasm keeper initialization. This is a breaking change to the public API but necessary for the feature.
454-493: LGTM! Comprehensive wasm keeper initialization.The wasm keepers are properly initialized with all necessary dependencies. The Akash-specific message filter decorator (line 464) and custom "akash" capability (line 472) are good integration points for Akash-specific constraints.
Verify that the message filter decorator correctly restricts wasm contract operations according to Akash's security requirements.
496-528: LGTM! IBC routing properly configured for wasm.Both the static IBC router and the v2 router correctly include wasm routes. The integration with transfer modules on both routing layers ensures proper IBC packet handling for wasm contracts.
602-603: LGTM! Store keys properly registered.Both the Cosmos wasm module and Akash wasm module store keys are correctly added to their respective key lists.
Also applies to: 620-620
x/wasm/module.go (2)
134-163: LGTM! Lifecycle hooks and genesis handling properly implemented.The no-op begin/end blockers are appropriate, genesis initialization and export correctly delegate to package functions, and the consensus version is properly set.
165-183: LGTM! Simulation scaffolding in place.The simulation methods provide basic support through
RandomizedGenStateandProposalMsgs. Store decoder and weighted operations stubs are acceptable for initial integration.make/test-upgrade.mk (3)
74-78: LGTM: test-reset now properly downloads binaries.The
binsinvocation is now enabled in thetest-resettarget, ensuring that required binaries are properly downloaded during test reset. This aligns with the upgrade testing workflow.
24-34: Sandbox1 removal verified—no stale references remain.Comprehensive search confirms that all references to
sandbox1have been successfully removed from the codebase. The change fromsandbox1tosandboxas the default snapshot source is complete and safe.
67-67: ****
AKASH_ROOTis properly defined. The file that includesmake/test-upgrade.mk(tests/upgrade/Makefile) first includesmake/init.mk, which validates thatAKASH_ROOTis set via environment (or errors out). The usage at line 67 is safe and consistent with howAKASH_ROOTis used throughout the codebase..github/workflows/tests.yaml (1)
50-50: LGTM: Explicit static-link option improves CI clarity.Setting
BUILD_OPTIONS=static-linkexplicitly in the CI workflow improves clarity, even though it matches the default value in the Makefile. This makes the build configuration self-documenting and easier to modify in the future.Makefile (3)
23-26: LGTM: Build configuration defaults are appropriate.The default build options (static-link, muslc, gcc, goleveldb) are appropriate for a Cosmos SDK application that requires CGO and static linking for container distribution.
30-36: LGTM: DB backend derivation logic is correct.The conditional logic properly derives the database backend from
BUILD_OPTIONS, with appropriate fallback to thegoleveldbdefault.
57-60: VerifyAKASH_DEVCACHE_LIBis defined.The linker flags reference
$(AKASH_DEVCACHE_LIB)for the library search path, but this variable is not defined in this Makefile. Ensure it's properly set in an included makefile or environment to avoid an empty-Lflag being passed to the linker.Run the following script to verify
AKASH_DEVCACHE_LIBis defined:
ff3c57c to
b647a27
Compare
There was a problem hiding this 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 (9)
tests/upgrade/upgrade_test.go (2)
695-704: Remove commented-out code.This commented-out timer/sleep block should be removed to keep the codebase clean. If needed for debugging in the future, it can be recovered from git history.
Apply this diff:
- //tm := time.NewTimer(30 * time.Second) - //select { - //case <-l.ctx.Done(): - // if !tm.Stop() { - // <-tm.C - // } - // err = l.ctx.Err() - // return err - //case <-tm.C: - //} - cmdRes, err = l.cmdr.execute(l.ctx, "query gov params")
757-765: Handle multi-denom governance deposits correctly.Using
params.DepositParams.MinDeposit[0]assumes the min deposit array has at least one entry and ignores additional denoms. If the chain config supplies more than one coin or none, this will either panic or submit an insufficient deposit.Apply this diff to handle the full
sdk.Coinsvalue:+ depositCoins := params.DepositParams.MinDeposit + if depositCoins.Empty() { + return fmt.Errorf("min deposit parameter is empty") + } + prop := &ProposalMsg{ Messages: []json.RawMessage{ jup, }, - Deposit: params.DepositParams.MinDeposit[0].String(), + Deposit: depositCoins.String(), Title: l.upgradeName, Summary: l.upgradeName, Expedited: false, }tests/upgrade/workers_test.go (1)
128-136: Remove redundant account unpacking.The account is unpacked twice: first into
sdk.AccountIand type-asserted tosdk.ModuleAccountI(lines 128-132), then unpacked again intomacc(lines 134-136). After the type assertion at line 132,maccalready contains the correct module account, making the second unpacking redundant.Apply this diff:
var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()Makefile (1)
56-86: GORELEASER_LDFLAGS captures ldflags too early; release artifacts will diverge from local builds.The Makefile's immediate assignment at line 63 (
GORELEASER_LDFLAGS := $(ldflags)) captures ldflags before mutations on lines 65, 68/70, 75, and 79. The evidence:
- Line 63 captures only the initial version flags (version.Name, version.AppName, etc.)
- Lines 65–80 add dynamic flags:
-linkmode=external, platform-specific-extldflags, strip flags-s -w, and custom$(LDFLAGS)- These missing flags are passed to
make/releasing.mk(lines 70, 93, 121) asBUILD_LDFLAGSenvironment variable- The
.goreleaser.yamlconfig partially works around this by hardcoding-s -w,-linkmode=external, and-extldflags, but this bypasses the Makefile's dynamic BUILD_OPTIONS logic and ignores custom$(LDFLAGS)Result: Release artifacts built by Goreleaser lack the dynamic linking flags and custom flags that local builds include, breaking static-linking guarantees and reproducibility.
Fix: Change line 63 to use recursive assignment:
-GORELEASER_LDFLAGS := $(ldflags) +GORELEASER_LDFLAGS = $(ldflags)This defers evaluation until GORELEASER_LDFLAGS is used, capturing all mutations to ldflags.
x/wasm/module.go (2)
38-41: Fix copy-paste documentation errors.Several doc comments incorrectly reference "provider module" instead of "wasm module" (lines 38, 54, 64-65, 86). Update these for accuracy and maintainability.
Apply these fixes:
-// AppModuleBasic defines the basic application module used by the provider module. +// AppModuleBasic defines the basic application module used by the wasm module. type AppModuleBasic struct { cdc codec.Codec }-// RegisterLegacyAminoCodec registers the provider module's types for the given codec. +// RegisterLegacyAminoCodec registers the wasm module's types for the given codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {-// DefaultGenesis returns default genesis state as raw bytes for the provider -// module. +// DefaultGenesis returns default genesis state as raw bytes for the wasm +// module. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {-// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the provider module. +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the wasm module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(cctx client.Context, mux *runtime.ServeMux) {Also applies to: 54-57, 64-68, 86-91
43-47: Fix additional copy-paste documentation errors.Several comments incorrectly reference "take module" or "deployment module" instead of "wasm module" (lines 43, 122, 139, 145, 153).
Apply these fixes:
-// AppModule implements an application module for the take module. +// AppModule implements an application module for the wasm module. type AppModule struct {-// QuerierRoute returns the take module's querier route name. +// QuerierRoute returns the wasm module's querier route name. func (am AppModule) QuerierRoute() string {-// EndBlock returns the end blocker for the deployment module. It returns no validator +// EndBlock returns the end blocker for the wasm module. It returns no validator // updates.-// InitGenesis performs genesis initialization for the take module. It returns +// InitGenesis performs genesis initialization for the wasm module. It returns // no validator updates.-// ExportGenesis returns the exported genesis state as raw bytes for the take +// ExportGenesis returns the exported genesis state as raw bytes for the wasm // module.Also applies to: 122-125, 139-143, 145-151, 153-158
app/types/app.go (1)
470-490: Fix wasmkeeper.NewKeeper distribution keeper argument.Line 476 wraps the distribution keeper in
distrkeeper.NewQuerier(), but wasmd v0.61.6 expects the concretetypes.DistributionKeeperdirectly. Passapp.Keepers.Cosmos.Distrwithout wrapping.Apply this diff:
wasmKeeper := wasmkeeper.NewKeeper( cdc, runtime.NewKVStoreService(app.keys[wasmtypes.StoreKey]), app.Keepers.Cosmos.Acct, app.Keepers.Cosmos.Bank, *app.Keepers.Cosmos.Staking, - distrkeeper.NewQuerier(app.Keepers.Cosmos.Distr), + app.Keepers.Cosmos.Distr, app.Keepers.Cosmos.IBC.ChannelKeeper, app.Keepers.Cosmos.IBC.ChannelKeeper, app.Keepers.Cosmos.IBC.ChannelKeeperV2,app/app.go (1)
138-146: Fix undefined identifier in wasm option type-check panic.Line 144 references
vlin thereflect.TypeOf(vl)call, butvlis only scoped inside theifblock at line 141. This causes a compilation error. Usevalinstead, which is in scope.Apply this diff:
if val := appOpts.Get("wasm"); val != nil { if vl, valid := val.([]wasmkeeper.Option); valid { wasmOpts = append(wasmOpts, vl...) } else { - panic(fmt.Sprintf("invalid type for aptOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(vl).String())) + panic(fmt.Sprintf("invalid type for appOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(val).String())) } }(Also fixes the typo "aptOpts" → "appOpts".)
make/releasing.mk (1)
39-42: Critical: Restore wasmvm-libs prerequisite on build target.The
buildtarget is missing thewasmvm-libsprerequisite that was identified in the previous review. On a clean checkout, this causes linker errors because libwasmvm is not available. All other build targets (AKASH, test-bins, docker-image, release) correctly depend on wasmvm-libs.Apply this diff:
.PHONY: build -build: +build: wasmvm-libs $(GO_BUILD) -a $(BUILD_FLAGS) ./...
🧹 Nitpick comments (1)
x/wasm/module.go (1)
94-101: CLI panic is intentional but document the design choice.GetQueryCmd and GetTxCmd panic with a clear message that Akash modules don't export CLI commands via the Cosmos interface. This appears to be an intentional design decision (commands are exported through a different mechanism), but consider adding a code comment above these methods explaining why they panic rather than return nil, to help future maintainers understand the pattern.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
-
go.sumis excluded by!**/*.sum -
tests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (24)
-
.github/actions/setup-ubuntu/action.yaml(1 hunks) -
.github/workflows/tests.yaml(1 hunks) -
.goreleaser.yaml(6 hunks) -
Makefile(1 hunks) -
app/app.go(9 hunks) -
app/types/app.go(8 hunks) -
go.mod(12 hunks) -
make/init.mk(3 hunks) -
make/releasing.mk(4 hunks) -
make/setup-cache.mk(2 hunks) -
make/test-integration.mk(1 hunks) -
make/test-upgrade.mk(3 hunks) -
meta.json(1 hunks) -
script/upgrades.sh(1 hunks) -
tests/upgrade/config-v0.24.0.tmpl.json(0 hunks) -
tests/upgrade/sdktypes.go(1 hunks) -
tests/upgrade/test-cases.json(1 hunks) -
tests/upgrade/test-config.json(1 hunks) -
tests/upgrade/types/types.go(1 hunks) -
tests/upgrade/upgrade_test.go(14 hunks) -
tests/upgrade/workers_test.go(1 hunks) -
upgrades/software/v2.0.0/upgrade.go(1 hunks) -
wasmvm.go(1 hunks) -
x/wasm/module.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
🚧 Files skipped from review as they are similar to previous changes (13)
- tests/upgrade/test-config.json
- wasmvm.go
- tests/upgrade/test-cases.json
- make/test-upgrade.mk
- script/upgrades.sh
- .github/actions/setup-ubuntu/action.yaml
- upgrades/software/v2.0.0/upgrade.go
- meta.json
- tests/upgrade/types/types.go
- make/test-integration.mk
- .goreleaser.yaml
- .github/workflows/tests.yaml
- make/setup-cache.mk
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
Makefilemake/init.mkmake/releasing.mk
🧬 Code graph analysis (3)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
x/wasm/module.go (1)
x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
⏰ 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). (6)
- GitHub Check: network-upgrade
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: build-bins
🔇 Additional comments (29)
tests/upgrade/sdktypes.go (1)
1-56: LGTM!The test types are well-structured and appropriately model SDK concepts needed for upgrade testing without importing different Cosmos SDK versions. The JSON tags are correctly applied and the comment explains the purpose clearly.
tests/upgrade/upgrade_test.go (3)
641-651: Good implementation of gov module account retrieval.The new types and query logic correctly retrieve the governance module account address, which is required for constructing upgrade proposals in newer Cosmos SDK versions where the authority field must be set.
Also applies to: 683-694
719-740: Approve dynamic upgrade height calculation.The voting period is correctly parsed as a duration, and the upgrade height is calculated dynamically based on current block height and estimated blocks during the voting period. This is more robust than hardcoding values.
742-783: Good refactoring to file-based proposal submission.The proposal is now correctly structured as
SoftwareUpgradeProposalwith proper authority and plan fields, marshaled to JSON, written to a file, and submitted via the CLI. This aligns with the newer Cosmos SDK governance workflow.tests/upgrade/workers_test.go (2)
34-34: Confirm upgrade version change to v2.0.0.The post-upgrade worker registration has been updated from "v1.0.0" to "v2.0.0", aligning with the PR objectives to enable smart contracts on Akash.
88-146: Good test coverage for wasm contract deployment restrictions.The test correctly validates the wasm contract deployment flow:
- Direct deployment by regular account fails (unauthorized)
- Governance proposal with incorrect sender fails
- Governance proposal with gov module account as sender succeeds
This ensures smart contracts can only be deployed through proper governance channels.
Makefile (1)
67-71: Excellent: static-link condition is now correct.The condition
ifeq (static-link,$(findstring static-link,$(BUILD_OPTIONS)))properly adds static-linking flags whenstatic-linkis present inBUILD_OPTIONS. This addresses the inverted logic from the previous regression.app/types/app.go (5)
17-19: LGTM: Wasm imports and v2 path migration.The CosmWasm imports and module path updates to v2 correctly support the smart contract integration objective.
Also applies to: 54-54, 58-58, 67-67, 73-73, 76-86
112-112: LGTM: Wasm keeper fields added.Both Cosmos and Akash keeper structs properly expose Wasm components for smart contract functionality.
Also applies to: 123-123
244-251: LGTM: InitNormalKeepers signature extended for wasm.The additional parameters (wasmDir, wasmConfig, wasmOpts) properly support wasm keeper initialization.
492-509: LGTM: Wasm IBC routing configured.Both IBC v1 and v2 routers properly integrate wasm handlers with correct port routing.
564-588: LGTM: Wasm store keys registered.Both CosmWasm (line 582) and Akash wasm (line 599) store keys are properly included in the KV store key lists.
Also applies to: 590-601
go.mod (2)
1-1: LGTM: Module path promoted to v2.The module path update to
pkg.akt.dev/node/v2aligns with the repo-wide v2 migration mentioned in the AI summary.
17-18: LGTM: CosmWasm dependencies added.wasmd v0.61.6 and wasmvm/v3 v3.0.2 are current versions for enabling smart contract support.
Based on learnings
app/app.go (4)
9-9: LGTM: Wasm imports and v2 path updates.The reflect import and CosmWasm package imports support the wasm integration, and v2 path updates are consistent with the module promotion.
Also applies to: 29-31, 69-69, 73-77, 79-79
160-172: LGTM: Wasm configuration setup.Wasm directory, node config reading, and production-safe limits (100 MB memory cache, 3M gas query limit, ContractDebugMode=false) are properly configured.
182-192: LGTM: Wasm parameters passed to InitNormalKeepers.Lines 187-189 correctly pass wasmDir, wasmConfig, and wasmOpts to InitNormalKeepers, matching the extended signature in app/types/app.go.
296-328: LGTM: Wasm modules added to begin/end blocker order.Lines 323-327 and 356-360 properly sequence awasm.ModuleName before wasmtypes.ModuleName, with clear comments explaining the ordering requirement ("akash wasm module must be prior wasm", "wasm after ibc transfer").
Also applies to: 331-361
x/wasm/module.go (2)
103-109: LGTM: Module wiring implementation.The module lifecycle methods, service registration, genesis handling, and consensus version are correctly implemented for integrating the wasm module into the Akash app.
Also applies to: 128-132, 134-143, 145-158, 160-163
167-183: LGTM: Simulation hooks implemented.The simulation methods (GenerateGenesisState, ProposalMsgs, RegisterStoreDecoder, WeightedOperations) properly wire the module into the Cosmos SDK simulation framework.
make/init.mk (4)
28-29: LGTM: Clean variable definitions.The SPACE and WHITESPACE variable definitions are clear and follow Make conventions.
93-93: LGTM: Standard release tag pattern.The RELEASE_TAG definition using
git describeis a standard approach and supports override via environment variable.
71-72: No issues found - wasmvm module is properly declared and the Makefile commands work correctly.The verification confirms that
github.com/CosmWasm/wasmvm/v3 v3.0.2is declared in go.mod (line 18), and both commands in make/init.mk successfully resolve:
- WASMVM_MOD extracts:
github.com/CosmWasm/wasmvm/v3- WASMVM_VERSION extracts:
v3.0.2
95-100: All WASMVM_LIBS filenames are correct and verified.Verification confirms all six library filenames match actual CosmWasm/wasmvm release artifacts: libwasmvm_muslc.x86_64.a, libwasmvm_muslc.aarch64.a (musl static archives), libwasmvm.x86_64.so, libwasmvm.aarch64.so (Linux shared libraries), libwasmvm.dylib (macOS dynamic library), and libwasmvmstatic_darwin.a (macOS static, universal build). No naming issues will cause library fetch failures.
make/releasing.mk (5)
37-37: LGTM: Simplified dependency.Directly depending on
$(AKASH) instead of $ (BINS) eliminates unnecessary indirection.
44-45: LGTM: Correct wasmvm-libs prerequisite.The AKASH target correctly depends on wasmvm-libs, ensuring libraries are fetched before linking. Based on learnings, the .PHONY is intentional to force rebuilds.
64-70: LGTM: Correct prerequisites and consistent variable naming.The test-bins target correctly depends on wasmvm-libs, and the environment variable renames align with the goreleaser configuration updates.
87-93: LGTM: Consistent with test-bins target.The docker-image target correctly depends on wasmvm-libs and uses consistent environment variable naming.
115-121: LGTM: Complete prerequisites for release target.The release target correctly depends on both wasmvm-libs and gen-changelog, with consistent environment variable naming throughout.
dd65357 to
785223c
Compare
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/types/app.go (1)
536-561: Add missing wasm params subspace registration ininitParamsKeeper.Verification confirms the issue. The
initParamsKeeperfunction (app/types/app.go lines 536-561) does not register a params subspace forwasmtypes.ModuleName, but app/modules.go lines 207 and 352 both callapp.GetSubspace(wasmtypes.ModuleName)during module initialization. TheGetSubspaceimplementation (app/types/app.go 159-165) panics if the subspace is not found, causing app startup to fail.Additionally, upgrade.go lines 68 and 79 call
GetParamsandSetParamson the wasm keeper, which requires an initialized subspace.Add the following line to
initParamsKeeper(after line 551):paramsKeeper.Subspace(wasmtypes.ModuleName).WithKeyTable(wasmtypes.ParamKeyTable())
♻️ Duplicate comments (7)
app/app.go (1)
138-146: Clarify wasm option panic message and fix minor typo.The type check is fine, but the panic path is a bit misleading:
- The message says
aptOptsinstead ofappOpts.- Using
reflect.TypeOf(vl)will always show the slice type ([]wasmkeeper.Option), even when the type assertion failed—so “actual” ends up equal to “expected”.Switching to the original value makes the error clearer and removes the typo:
- if val := appOpts.Get("wasm"); val != nil { - if vl, valid := val.([]wasmkeeper.Option); valid { - wasmOpts = append(wasmOpts, vl...) - } else { - panic(fmt.Sprintf("invalid type for aptOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(vl).String())) - } - } + if val := appOpts.Get("wasm"); val != nil { + if vl, ok := val.([]wasmkeeper.Option); ok { + wasmOpts = append(wasmOpts, vl...) + } else { + panic(fmt.Sprintf( + "invalid type for appOpts.Get(%q): expected %T, actual %T", + "wasm", + wasmOpts, + val, + )) + } + }x/wasm/module.go (1)
110-113: Clean up remaining copy‑paste doc comment leftovers in wasm module.Implementation is fine, but a few comments still mention other modules:
- Line 110: “Name returns the provider module name” (should be “wasm module”).
- Line 166: “GenerateGenesisState creates a randomized GenState of the staking module.”
- Line 176: “RegisterStoreDecoder registers a decoder for take module's types.”
- Line 179: “WeightedOperations doesn't return any take module operation.”
Updating these to consistently say “wasm module” will avoid confusion when navigating the code.
Also applies to: 166-181
Makefile (1)
56-65: Fix GORELEASER_LDFLAGS so releases use the final ldflags (including static link & strip).
GORELEASER_LDFLAGS := $(ldflags)is evaluated before you append-linkmode=external,-extldflags ...,-s -w, and any custom$(LDFLAGS). As a result, goreleaser builds won’t pick up static linking or strip flags, while localmakebuilds will—reintroducing a divergence between CI artifacts and local binaries.You can fix this by making
GORELEASER_LDFLAGSa recursive variable so it always sees the finalldflagsvalue:-ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ +ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ -X github.com/cosmos/cosmos-sdk/version.AppName=akash \ -X github.com/cosmos/cosmos-sdk/version.BuildTags="$(build_tags_cs)" \ -X github.com/cosmos/cosmos-sdk/version.Version=$(shell git describe --tags | sed 's/^v//') \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_HEAD_COMMIT_LONG) \ -X github.com/cosmos/cosmos-sdk/types.DBBackend=$(DB_BACKEND) -GORELEASER_LDFLAGS := $(ldflags) +GORELEASER_LDFLAGS = $(ldflags)This keeps the rest of the ldflags mutations intact while ensuring goreleaser uses the exact same link flags.
make/setup-cache.mk (1)
62-70: Re‑enable checksum verification and harden wasmvm lib downloads.You now download both
checksums.txtand the wasmvm libs, but the integrity check is commented out and partial downloads aren’t handled. That leaves the original supply‑chain risk largely unchanged.Consider tightening this up along these lines:
$(AKASH_DEVCACHE_LIB)/checksums.txt: - wget -q --show-progress https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/checksums.txt -O $@ + wget -q --show-progress \ + https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/checksums.txt \ + -O $@ || (rm -f $@ && false) -$(AKASH_DEVCACHE_LIB)/%: #$(AKASH_DEVCACHE_LIB)/checksums.txt - wget -q --show-progress https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/$* -O $@ -# cd $(AKASH_DEVCACHE_LIB) && sha256sum -c --ignore-missing checksums.txt +$(AKASH_DEVCACHE_LIB)/%: $(AKASH_DEVCACHE_LIB)/checksums.txt + wget -q --show-progress \ + https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/$* \ + -O $@ || (rm -f $@ && false) + cd $(AKASH_DEVCACHE_LIB) && sha256sum -c --ignore-missing checksums.txtThat way:
- Libs are only accepted if they pass the published checksums.
- Failed or interrupted downloads don’t leave corrupt artifacts on disk.
tests/upgrade/upgrade_test.go (1)
757-765: Handle multi-denom governance deposits correctly.Line 761 uses
params.DepositParams.MinDeposit[0].String(), which assumes the array has at least one entry and ignores additional denoms. If the chain config supplies zero coins or multiple denoms, this will either panic (empty slice) or submit an insufficient deposit (multi-denom), causing proposal rejection.Apply this diff to consume the full
sdk.Coins:+ depositCoins := params.DepositParams.MinDeposit + if depositCoins.Empty() { + return fmt.Errorf("min deposit parameter is empty") + } + prop := &ProposalMsg{ Messages: []json.RawMessage{ jup, }, - Deposit: params.DepositParams.MinDeposit[0].String(), + Deposit: depositCoins.String(), Title: l.upgradeName, Summary: l.upgradeName, Expedited: false, }tests/upgrade/workers_test.go (1)
128-136: Remove redundant account unpacking.Lines 134-135 unpack
qResp.Accountintomacca second time, butmaccalready holds the correct module account after the type assertion at lines 131-132. The secondUnpackAnycall is redundant.Apply this diff:
var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()make/releasing.mk (1)
51-52: Add wasmvm-libs prerequisite to akash_docgen target.The verification confirms that
docgenhas transitive dependencies on CosmWasm modules (includinggithub.com/CosmWasm/wasmvm/v3andpkg.akt.dev/node/v2/x/wasm). Without thewasmvm-libsprerequisite, the build will fail during linking. Apply the suggested diff:-.PHONY: akash_docgen -akash_docgen: $(AKASH_DEVCACHE) +.PHONY: akash_docgen +akash_docgen: $(AKASH_DEVCACHE) wasmvm-libs $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgen
🧹 Nitpick comments (3)
make/test-upgrade.mk (2)
62-71:-sourcesdir=$(AKASH_ROOT)addition is fine; consider quoting for safetyPassing the source dir into the upgrade test runner makes sense and the flag placement under
-argslooks correct. To be robust against paths with spaces, you could quote the assignment:- -sourcesdir=$(AKASH_ROOT) \ + -sourcesdir="$(AKASH_ROOT)" \
73-79: Re‑enabledbinsstep intest-resetis consistent; consider reuse/SKIPsemanticsReactivating the
binsinvocation and adding--gbv=$(GENESIS_BINARY_VERSION)bringstest-resetin line with the other upgrade script calls, which is good. Note this always runsbinsregardless ofSKIP(unlike the separatebinstarget guarded byifneq ($(findstring build,$(SKIP)),build)), which is probably intentional.If you want to avoid argument drift and optionally honor
SKIP, you could refactortest-resetto call thebinsmake target instead of duplicating the script arguments.app/sim_test.go (1)
151-204: Import/export flow, InitChainer usage, and wasm store comparison look solid (small optional cleanup)The refactor to use
setupSimulationApp, the InitChainer-based import path with explicitAppStateBytes, and the subsequent store comparison (including the new wasm store withTXCounterPrefixexcluded) all look correct and align with typical Cosmos import/export tests. The special-casing of"validator set is empty after InitGenesis"with a stack trace log is also reasonable here.One minor readability nit: in
TestAppImportExportyou mutate the sharedappOptsmap before constructingappB:appOpts[cflags.FlagHome] = t.TempDir() // ensure a unique folder for the new app appB := akash.NewApp(..., appOpts, ...)This works today because
NewApponly consumesappOptsat construction time, but it’s slightly surprising thatappAandappBshare the same map instance. If you want to make this more explicit and future-proof, consider cloning the map forappB:- appOpts[cflags.FlagHome] = t.TempDir() // ensure a unique folder for the new app - appB := akash.NewApp(logger, newDB, nil, true, sim.FlagPeriodValue, map[int64]bool{}, encodingConfig, appOpts, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID)) + newAppOpts := simtestutil.AppOptionsMap{} + for k, v := range appOpts { + newAppOpts[k] = v + } + newAppOpts[cflags.FlagHome] = t.TempDir() // ensure a unique folder for the new app + appB := akash.NewApp(logger, newDB, nil, true, sim.FlagPeriodValue, map[int64]bool{}, encodingConfig, newAppOpts, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID))Not required, but would make the data flow a bit clearer.
Also applies to: 353-360
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (32)
.github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_run/common-commands.mk(1 hunks)app/app.go(9 hunks)app/sim_test.go(9 hunks)app/types/app.go(8 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)wasmvm.go(1 hunks)x/audit/module.go(5 hunks)x/cert/module.go(5 hunks)x/escrow/module.go(5 hunks)x/market/module.go(2 hunks)x/provider/module.go(3 hunks)x/take/module.go(6 hunks)x/wasm/module.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
🚧 Files skipped from review as they are similar to previous changes (14)
- x/escrow/module.go
- x/provider/module.go
- tests/upgrade/types/types.go
- tests/upgrade/test-config.json
- x/take/module.go
- .github/actions/setup-ubuntu/action.yaml
- make/test-integration.mk
- .goreleaser.yaml
- x/cert/module.go
- wasmvm.go
- make/init.mk
- x/audit/module.go
- _run/common-commands.mk
- script/upgrades.sh
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
make/test-upgrade.mkmake/setup-cache.mkMakefilemake/releasing.mk
🧬 Code graph analysis (5)
app/sim_test.go (2)
app/app.go (3)
AppName(83-83)NewApp(110-293)AkashApp(97-107)app/sim/sim_utils.go (3)
CheckExportSimulation(78-103)PrintStats(106-110)SetupSimulation(23-49)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
x/wasm/module.go (5)
x/audit/module.go (14)
AppModuleBasic(39-41)AppModuleBasic(44-46)AppModuleBasic(49-51)AppModuleBasic(59-61)AppModuleBasic(64-79)AppModuleBasic(87-92)AppModuleBasic(95-100)AppModuleBasic(103-105)AppModuleBasic(108-110)AppModuleBasic(113-115)AppModule(118-121)AppModule(132-134)AppModule(204-206)NewAppModule(124-129)x/cert/module.go (11)
AppModuleBasic(39-41)AppModuleBasic(50-52)AppModuleBasic(55-57)AppModuleBasic(65-67)AppModuleBasic(70-83)AppModuleBasic(86-91)AppModule(44-47)AppModule(117-119)AppModule(168-170)AppModule(173-175)NewAppModule(109-114)x/market/module.go (5)
AppModule(50-53)AppModule(137-139)AppModule(188-190)AppModule(193-195)NewAppModule(110-134)x/escrow/keeper/querier.go (1)
NewQuerier(7-9)x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(131-142)upgrades/types/types.go (1)
IUpgrade(32-37)
🪛 GitHub Check: lint-go
app/sim_test.go
[failure] 32-32:
ST1019(related information): other import of "github.com/cosmos/cosmos-sdk/types/simulation" (staticcheck)
[failure] 172-172:
SA1019: simcli.FlagEnabledValue is deprecated: This flag is unused and will be removed in a future release. (staticcheck)
[failure] 544-544:
SA1019: simcli.FlagPeriodValue is deprecated: This flag is unused and will be removed in a future release. (staticcheck)
[failure] 531-531:
SA1019: simcli.FlagEnabledValue is deprecated: This flag is unused and will be removed in a future release. (staticcheck)
tests/upgrade/sdktypes.go
[failure] 28-28:
type govParams is unused (unused)
[failure] 24-24:
type depositParams is unused (unused)
[failure] 20-20:
type votingParams is unused (unused)
[failure] 13-13:
type nodeStatus is unused (unused)
⏰ 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). (1)
- GitHub Check: build-bins
🔇 Additional comments (21)
make/test-upgrade.mk (1)
24-34: DefaultSNAPSHOT_SOURCEnowsandbox— behavior looks correctThe new default and the remaining branches (
mainnet/sandbox) are consistent with the URLs below and the explicit error on unknown values. Just make sure any docs or CI jobs that previously referencedsandbox1are updated to usesandboxso they don’t trip the “invalid snapshot source” error.x/market/module.go (2)
24-28: LGTM: Import path migration to v2.The import paths have been correctly updated to reflect the v2 module promotion. All market module components (keeper, handler, simulation) and related module keepers (audit, escrow) are consistently referencing the v2 paths.
159-163: LGTM: Comment accurately describes the EndBlock function.The comment correctly identifies this as the EndBlock function for the market module.
go.mod (3)
64-64: Note the Akash-forked Cosmos SDK version.The dependency uses an Akash-specific fork
v0.53.4-akash.10(updated fromakash.b.10). Ensure this fork includes all necessary patches and is kept in sync with upstream Cosmos SDK releases.
1-1: v2 module migration verified as complete.The verification confirms that the module path migration from
pkg.akt.dev/nodetopkg.akt.dev/node/v2is complete across the repository:
- Module declaration correctly set to
pkg.akt.dev/node/v2in go.mod- All import statements in .go files use the correct
pkg.akt.dev/node/v2/...paths (110 confirmed matches)- No unmigrated v1 imports found
- No old module path references in go.mod or go.sum
- Single root go.mod module (no subdirectory modules)
5-53: I'll search for breaking changes in the other notable dependency mentioned (gRPC v1.75.0) to provide comprehensive verification.Dependency updates verified—no API-breaking changes detected.
Verification of the key dependencies shows:
Cosmos SDK v0.53.4 is fully API and state-compatible with v0.53.3 (no breaking changes).
IBC-go v10.4.0 has no API-breaking changes compared to v10.3.x (though it is state-breaking and requires a coordinated chain upgrade).
gRPC v1.75.0 contains refinements, improvements, and bug fixes with no documented major API-breaking changes for Go.
The dependency updates appear safe from an API compatibility perspective. If you have concerns about state-breaking changes (particularly IBC-go v10.4.0), verify that any required chain coordination is handled separately.
meta.json (1)
48-52: All v2.0.0 upgrade handler components are fully implemented and verified.The v2.0.0 upgrade handler in
upgrades/software/v2.0.0/upgrade.goincludes:
- Store migrations:
StoreUpgradeswith WASM stores added;RunMigrationscalled to execute module migrations- Parameter updates: WASM parameters configured with
CodeUploadAccess(restricted to governance) andInstantiateDefaultPermission(set to everybody)- WASM module initialization: WASM store keys properly added and params persisted
app/sim_test.go (3)
399-401: Good move to uset.TempDir()forhomein import-after-sim testSetting
appOpts.Set("home", t.TempDir())for both the initial app andnewAppinTestAppSimulationAfterImportis a nice improvement: it ensures per-run isolation, avoids cross-test interference on the filesystem, and matches how other tests in this file now treathome.Also applies to: 442-444
487-496: Per-runhomedirectories in determinism test improve isolationSimilarly, using
t.TempDir()forhomeinTestAppStateDeterminismkeeps each run’s on-disk state isolated and should help avoid flakes when tests run in parallel or are re-run frequently.
8-15: Unifytypes/simulationimports to fix ST1019 and simplify aliasesYou import
github.com/cosmos/cosmos-sdk/types/simulationtwice (lines 31–32) with aliasessdksimandsimtypes, which staticcheck flags as ST1019. This is redundant and makes the code harder to follow.Unify to a single import alias (e.g.,
simtypes) and update all usages:- sdksim "github.com/cosmos/cosmos-sdk/types/simulation" simtypes "github.com/cosmos/cosmos-sdk/types/simulation"Then replace:
sdksim.Config→simtypes.Config(line 93)sdksim.RandomAccounts→simtypes.RandomAccounts(line 99)sdksim.RandTimestamp→simtypes.RandTimestamp(lines 128, 403, 491)Likely an incorrect or invalid review comment.
tests/upgrade/test-cases.json (1)
2-9: v2.0.0 test case wiring for wasm/awasm looks consistent.The new
v2.0.0entry withmodules.added=["wasm","awasm"]matches the new store additions in the v2.0.0 upgrade and the extra KV store keys inapp/types/app.go, so the upgrade test matrix stays aligned with the code path..github/workflows/tests.yaml (1)
49-51: CI explicitly exercising static-link build path looks good.Setting
BUILD_OPTIONS=static-linkfor the Linuxbuild-binsjob guarantees the CI build uses the static-link configuration, independent of Makefile defaults. That should make regressions in the static link path easier to catch.upgrades/software/v2.0.0/upgrade.go (1)
40-85: v2.0.0 upgrade wiring for wasm stores and params looks coherent.
StoreLoaderaddsawasm.StoreKeyandwasmtypes.StoreKey, matching the new KV store keys and IBC routing for Akash wasm + CosmWasm wasm.UpgradeHandlerruns module migrations first, then tightens wasm params to governance‑only code upload (AccessTypeNobody) while allowingInstantiateDefaultPermission = AccessTypeEverybody, and persists via the wasm keeper.Assuming the wasm keeper methods and module manager now use
context.Context(as implied by theupgradetypes.UpgradeHandlersignature), this handler is consistent with the new SDK/wasmd APIs.app/types/app.go (1)
451-491: Verify akash wasm store key consistency across package imports.The cosmos wasm store key concern in the original review is based on a misunderstanding—wasmd defines StoreKey = ModuleName = "wasm", so both
wasmtypes.StoreKey(line 472) andwasmtypes.ModuleName(line 581) resolve to the same string value and will correctly retrieve the same KVStore.However, there is a genuine concern with the akash wasm keeper:
- Line 453: Akash wasm keeper accesses the store via
app.keys[wtypes.StoreKey](wherewtypesispkg.akt.dev/go/node/wasm/v1)- Line 598: The store is registered as
awasm.StoreKey(whereawasmispkg.akt.dev/node/v2/x/wasm)These constants come from different packages. If
wtypes.StoreKeyandawasm.StoreKeyhave different string values, the keeper will fail with a nil KVStore at runtime. Verify that these are intentionally aliased and that their string values match.Regarding VMConfig: using
wasmtypes.VMConfig{}is correct—wasmd doesn't provide a default constructor, and the zero value is the intended behavior.tests/upgrade/sdktypes.go (1)
13-40: Static analysis false positives—types are used.The linter flags
nodeStatus,votingParams,depositParams, andgovParamsas unused, but they're legitimately consumed intests/upgrade/upgrade_test.go(lines 662 and 712). These are test-scoped data containers for unmarshaling JSON responses.tests/upgrade/upgrade_test.go (2)
234-234: Verify sourcesdir flag is properly documented.The new
sourcesdirflag is required but lacks usage documentation. Ensure the test invocation instructions or README explain this parameter.
641-651: LGTM—minimal account types for test scaffolding.These types mirror SDK account structures to avoid importing multiple SDK versions in the test harness. The approach aligns with the stated goal in
sdktypes.go(line 11).make/releasing.mk (1)
37-45: LGTM—wasmvm-libs prerequisites restored.The
buildand$(AKASH)targets now correctly depend onwasmvm-libs, resolving the linker errors on clean checkouts noted in past reviews.tests/upgrade/workers_test.go (3)
34-34: LGTM—worker registration updated to v2.0.0.The post-upgrade worker is now registered for
v2.0.0instead ofv1.0.0, aligning with the broader repository migration to v2 upgrade semantics.
88-98: LGTM—wasm file handling with proper compression check.The code reads the wasm bytecode, detects whether it's already gzipped, and compresses if needed. This defensive pattern prevents double-compression errors.
100-145: Well-structured authorization test coverage.The test correctly validates three scenarios: (1) direct wasm store fails with
ErrUnauthorized, (2) gov proposal with wrong sender fails, and (3) gov proposal with the governance module account as sender succeeds. This thoroughly exercises the authorization logic introduced in the v2 upgrade.
7172ea6 to
5765a2b
Compare
There was a problem hiding this 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 (12)
script/upgrades.sh (1)
548-551: Add file existence check before passing validator.json file path.Line 551 now passes the file path
"$valdir/validator.json"directly tocreate-validator, but there is no validation that this file exists. Ifinit()was skipped or failed, the validator.json file will not exist, and the command will fail with an unclear error message. Thevaljsonvariable read at line 548 remains unused in this branch, making it impossible to fallback to the old code path if the file is missing.Apply this diff to add an explicit existence check:
valjson=$(cat "$valdir/validator.json") if [[ $cnt -gt 0 ]]; then if [[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]]; then + # Validate that validator.json exists for the file-based approach (v1.0.0-rc0+) + if [[ ! -f "$valdir/validator.json" ]]; then + echo >&2 "Error: $valdir/validator.json not found. Ensure init() has been called." + exit 1 + fi $AKASH tx staking create-validator "$valdir/validator.json" --home="$rvaldir" --from="validator$cnt" --yesAlternatively, fall back to the old code path if the file is missing:
valjson=$(cat "$valdir/validator.json") if [[ $cnt -gt 0 ]]; then if [[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]] && [[ -f "$valdir/validator.json" ]]; then $AKASH tx staking create-validator "$valdir/validator.json" --home="$rvaldir" --from="validator$cnt" --yesupgrades/software/v2.0.0/upgrade.go (2)
5-18: Add missing SDK import for context unwrapping.This issue was flagged in a previous review but remains unresolved. The
UpgradeHandlermethod receives acontext.Contextbut passes it directly to keeper methods that expectsdk.Context. You needsdk.UnwrapSDKContextto perform the conversion.Add the import:
import ( "context" "fmt" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" upgradetypes "cosmossdk.io/x/upgrade/types" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" apptypes "pkg.akt.dev/node/v2/app/types" utypes "pkg.akt.dev/node/v2/upgrades/types" awasm "pkg.akt.dev/node/v2/x/wasm" )
51-86: Unwrap the SDK context before calling keeper methods.This critical issue was flagged in a previous review but remains unresolved. The handler receives a
context.Context(line 51) but passes it directly to keeper methods that expectsdk.Context:
- Line 63:
up.MM.RunMigrations(ctx, ...)- Line 68:
up.Keepers.Cosmos.Wasm.GetParams(ctx)- Line 79:
up.Keepers.Cosmos.Wasm.SetParams(ctx, ...)This will cause compilation errors or runtime panics.
Apply this diff to unwrap the context once and reuse it:
func (up *upgrade) UpgradeHandler() upgradetypes.UpgradeHandler { return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + // Set wasm old version to 1 if we want to call wasm's InitGenesis ourselves // in this upgrade logic ourselves. // // vm[wasm.ModuleName] = wasm.ConsensusVersion // // Otherwise we run this, which will run wasm.InitGenesis(wasm.DefaultGenesis()) // and then override it after. // Set the initial wasm module version //fromVM[wasmtypes.ModuleName] = wasm.AppModule{}.ConsensusVersion() - toVM, err := up.MM.RunMigrations(ctx, up.Configurator, fromVM) + toVM, err := up.MM.RunMigrations(sdkCtx, up.Configurator, fromVM) if err != nil { return toVM, err } - params := up.Keepers.Cosmos.Wasm.GetParams(ctx) + params := up.Keepers.Cosmos.Wasm.GetParams(sdkCtx) // Configure code upload access - RESTRICTED TO GOVERNANCE ONLY // Only governance proposals can upload contract code // This provides maximum security for mainnet deployment params.CodeUploadAccess = wasmtypes.AccessConfig{ Permission: wasmtypes.AccessTypeNobody, } // Configure instantiate default permission params.InstantiateDefaultPermission = wasmtypes.AccessTypeEverybody - err = up.Keepers.Cosmos.Wasm.SetParams(ctx, params) + err = up.Keepers.Cosmos.Wasm.SetParams(sdkCtx, params) if err != nil { return toVM, err } return toVM, err } }app/sim_test.go (1)
172-173: Use localsimflags instead of deprecatedsimcliflags in simulation setupThis call still passes
simcli.FlagVerboseValue/simcli.FlagEnabledValueintosimtestutil.SetupSimulation, whereas elsewhere you’ve already switched to the localsim.FlagVerboseValue/sim.FlagEnabledValueto address the SA1019 deprecation warnings on the cosmossimcliflags.For consistency with the fixes you’ve already applied (and to keep staticcheck quiet), I recommend switching this call over as well:
- newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", sim.FlagVerboseValue, sim.FlagEnabledValue)#!/bin/bash # Verify there are no remaining uses of deprecated simcli Flag* globals. rg -n "simcli\.Flag(VerboseValue|EnabledValue|PeriodValue)" app/sim_test.go -n -C2 || echo "No remaining simcli.Flag* usages in app/sim_test.go"tests/upgrade/workers_test.go (1)
124-137: Remove redundant secondUnpackAnyof the gov module accountYou already unpack into
accand assert it assdk.ModuleAccountI, so the secondUnpackAnyintomaccis redundant; it just adds noise.- var acc sdk.AccountI - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) - require.NoError(t, err) - macc, ok := acc.(sdk.ModuleAccountI) - require.True(t, ok) - - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) + var acc sdk.AccountI + err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) + require.NoError(t, err) + macc, ok := acc.(sdk.ModuleAccountI) + require.True(t, ok)The rest of the flow (
msg.Sender = macc.GetAddress().String()) stays the same.tests/upgrade/upgrade_test.go (3)
695-704: Remove reintroduced commented‑out timer blockThe commented timer/select block is dead code and was previously flagged for removal. Since you’re not using it anymore, it’s better to delete it entirely and rely on the subsequent logic.
- //tm := time.NewTimer(30 * time.Second) - //select { - //case <-l.ctx.Done(): - // if !tm.Stop() { - // <-tm.C - // } - // err = l.ctx.Err() - // return err - //case <-tm.C: - //}
791-799: Fix block‑count comment and typo to match timeoutThe comment says “two blocks” and “commited” while the timeout is 18 seconds (~3 blocks at 6s/block). Either adjust the comment or the timeout; e.g.:
- // give it two blocks to make sure a proposal has been commited - tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second) + // give it three blocks to make sure a proposal has been committed + tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second)
742-765: Handle multi‑denom or empty min‑deposit safely
prop.Depositusesparams.DepositParams.MinDeposit[0].String(), which assumes a non‑empty, single‑denom min‑deposit. If the chain ever configures zero coins or multiple denoms, this will either panic or submit an under‑funded deposit.Safer version:
- prop := &ProposalMsg{ - Messages: []json.RawMessage{ - jup, - }, - Deposit: params.DepositParams.MinDeposit[0].String(), + depositCoins := params.DepositParams.MinDeposit + if depositCoins.Empty() { + return fmt.Errorf("min deposit parameter is empty") + } + + prop := &ProposalMsg{ + Messages: []json.RawMessage{ + jup, + }, + Deposit: depositCoins.String(), Title: l.upgradeName, Summary: l.upgradeName, Expedited: false, }This keeps the test correct even if governance parameters change to multi‑denom deposits.
x/wasm/module.go (1)
166-181: Clarify copy‑pasted comments referring to other modulesThere are a couple of comments that still reference other modules:
GenerateGenesisStatesays “staking module”.RegisterStoreDecoderandWeightedOperationstalk about the “take module”.They should refer to the wasm module instead, to avoid confusion for future maintainers. For example:
-// GenerateGenesisState creates a randomized GenState of the staking module. +// GenerateGenesisState creates a randomized genesis state for the wasm module. @@ -// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for wasm module types. @@ -// WeightedOperations doesn't return any take module operation. +// WeightedOperations doesn't return any wasm module operation._run/common.mk (1)
78-81:.NOTPARALLEL: node-initresolves the earlier race riskMarking
node-initas.NOTPARALLELwhile listing the genesis, accounts, certs, gentx, and finalize steps as its prerequisites ensures those run serially even undermake -j. That addresses the previous risk of races in genesis creation vs. account/cert/gentx steps.app/app.go (1)
138-146: Fix wasm options panic message: correct typo and improve type reportingThe code contains a typo ("aptOpts" should be "appOpts") and the panic message logic is flawed. When the type assertion fails,
reflect.TypeOf(vl)will always show[]wasmkeeper.Option(the zero-value), not the actual type passed. Use the suggested fix to showval's type instead, which provides useful debugging information:- if val := appOpts.Get("wasm"); val != nil { - if vl, valid := val.([]wasmkeeper.Option); valid { - wasmOpts = append(wasmOpts, vl...) - } else { - panic(fmt.Sprintf("invalid type for aptOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(vl).String())) - } - } + if val := appOpts.Get("wasm"); val != nil { + if vl, valid := val.([]wasmkeeper.Option); valid { + wasmOpts = append(wasmOpts, vl...) + } else { + panic(fmt.Sprintf( + "invalid type for appOpts.Get(\"wasm\"): expected %T, actual %T", + []wasmkeeper.Option{}, val, + )) + } + }make/setup-cache.mk (1)
65-67: Checksum verification remains disabled—security risk unaddressed.Line 67 shows the checksum verification is still commented out. As noted in the previous review, downloading prebuilt native libraries without integrity verification poses a security risk. Please enable the sha256sum verification to ensure library authenticity.
🧹 Nitpick comments (7)
upgrades/software/v2.0.0/upgrade.go (2)
60-61: Consider removing commented code if not needed.The commented code for setting the initial wasm module version (lines 60-61) appears to be unused. If this code is no longer needed, consider removing it to keep the codebase clean. If it's kept as a reference for future upgrades, consider adding a comment explaining why it's preserved.
84-84: Return nil explicitly for clarity.At line 84,
erris guaranteed to benil(due to the check on line 80). Consider returningnilexplicitly for better readability:- return toVM, err + return toVM, nilx/escrow/module.go (1)
40-63: Align module comments and panic message with escrow moduleDoc comments you updated (e.g.,
AppModuleBasic,Name,DefaultGenesis,EndBlock) now correctly reference the escrow module, which helps readability.There are still a few copy‑paste leftovers worth cleaning up when convenient:
- Line 90: panic text says
"couldn't register provider grpc routes"but this is the escrow module; suggest changing to"escrow grpc routes".- Lines 109, 138, 178, 192, 200, 204, etc. still mention “audit module”, “take module”, or “staking module” while this file is escrow‑specific.
These are cosmetic but will reduce confusion when debugging or browsing.
Also applies to: 86-92, 109-205
x/wasm/simulation/proposals.go (1)
14-42: Wasm params simulation proposal wiring looks correct
ProposalMsgsandSimulateMsgUpdateParamsare wired correctly: authority uses the gov module address, defaults come fromtypes.DefaultParams(), and the returnedMsgUpdateParamssatisfies the expectedsdk.Msgshape for simulation. If you ever want richer coverage, you could later randomize individual fields ofparams, but the current implementation is sound.app/sim_test.go (1)
8-15: Imports and new dependencies are consistent; consider deduping simulation aliasesThe added imports (
runtime/debug,strings,wasmtypes,cmtproto,simcli,cflags, akash v2 app/sim/simtestutil) are all exercised in the code below and look consistent with the v2 module wiring.Minor style nit: you import
github.com/cosmos/cosmos-sdk/types/simulationtwice assdksimandsimtypes. Since they refer to the same package, you can drop one alias and reuse the other for bothConfigandWeightedProposalMsgtypes to keep things a bit cleaner.Also applies to: 19-20, 32-33, 56-59
tests/upgrade/upgrade_test.go (1)
719-741: Upgrade height calculation is reasonable but assumes ~6s blocksDeriving
upgradeHeightascurrentHeight + votePeriod/(6s) + 10works given your assumed block time, but it hardcodes6*time.Second. If block time ever changes, upgrade timing will drift. Consider either sourcing the expected block time from config or adding a brief comment noting this assumption.x/wasm/module.go (1)
110-113: Fix outdated “provider module” wording inNamecommentMinor doc nit: the comment still says “provider module name” while this is the wasm module. Consider updating to keep docs consistent.
-// Name returns the provider module name +// Name returns the wasm module name func (AppModule) Name() string {
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (38)
.github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)app/app.go(9 hunks)app/sim_test.go(9 hunks)app/types/app.go(8 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/sims/simulation_helpers.go(3 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)wasmvm.go(1 hunks)x/audit/module.go(5 hunks)x/cert/module.go(5 hunks)x/escrow/module.go(5 hunks)x/market/module.go(2 hunks)x/provider/module.go(3 hunks)x/take/module.go(6 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
✅ Files skipped from review due to trivial changes (1)
- testutil/sims/simulation_helpers.go
🚧 Files skipped from review as they are similar to previous changes (14)
- x/take/module.go
- make/test-upgrade.mk
- make/test-integration.mk
- x/cert/module.go
- _run/common-commands.mk
- x/wasm/genesis.go
- tests/upgrade/test-config.json
- x/market/module.go
- wasmvm.go
- tests/upgrade/test-cases.json
- x/audit/module.go
- .github/actions/setup-ubuntu/action.yaml
- meta.json
- .github/workflows/tests.yaml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
📚 Learning: 2025-11-14T01:24:04.219Z
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
Applied to files:
x/wasm/keeper/msg_filter.gogo.mod
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
make/setup-cache.mkmake/releasing.mkMakefile_run/common.mkmake/init.mk
🧬 Code graph analysis (8)
upgrades/software/v2.0.0/upgrade.go (3)
app/types/app.go (1)
App(131-142)upgrades/types/types.go (1)
IUpgrade(32-37)x/wasm/alias.go (1)
StoreKey(9-9)
app/app.go (1)
x/wasm/alias.go (1)
ModuleName(11-11)
app/sim_test.go (3)
app/app.go (3)
AppName(83-83)NewApp(110-293)AkashApp(97-107)testutil/sims/simulation_helpers.go (3)
CheckExportSimulation(87-112)PrintStats(115-119)SetupSimulation(26-49)x/wasm/alias.go (1)
StoreKey(9-9)
x/escrow/module.go (2)
x/audit/module.go (8)
AppModuleBasic(39-41)AppModuleBasic(44-46)AppModuleBasic(49-51)AppModuleBasic(59-61)AppModuleBasic(64-79)AppModuleBasic(87-92)AppModuleBasic(95-100)AppModuleBasic(103-105)x/provider/module.go (8)
AppModuleBasic(43-45)AppModuleBasic(58-60)AppModuleBasic(63-65)AppModuleBasic(73-75)AppModuleBasic(78-85)AppModuleBasic(88-93)AppModuleBasic(96-98)AppModuleBasic(101-103)
tests/upgrade/workers_test.go (1)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
x/wasm/module.go (3)
x/wasm/alias.go (1)
ModuleName(11-11)x/wasm/genesis.go (4)
DefaultGenesisState(22-34)ValidateGenesis(16-18)InitGenesis(37-42)ExportGenesis(45-50)x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
app/types/app.go (1)
x/wasm/alias.go (2)
StoreKey(9-9)ModuleName(11-11)
⏰ 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). (7)
- GitHub Check: network-upgrade
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: tests
- GitHub Check: build-bins
🔇 Additional comments (50)
upgrades/software/v2.0.0/upgrade.go (1)
72-74: Verify the definition ofwasmtypes.AllowNobodyin wasmd v0.61.6.Lines 72-74 manually create
AccessConfig{Permission: AccessTypeNobody}. The test code references&wasmtypes.AllowNobody, suggesting a predefined constant exists in the external wasmd package. IfAllowNobodyis indeed equivalent to this struct, the manual construction would be redundant. Check the wasmd v0.61.6 source or documentation to determine whether to use the constant directly instead.tests/upgrade/types/types.go (1)
11-19: Addition ofSourceDirtoTestParamslooks finePurely additive field on a test-only params struct; no behavioral risk here. Just ensure any new tests that depend on
SourceDirpopulate it where required.x/escrow/module.go (1)
23-26: v2 escrow imports look consistentSwitch to
pkg.akt.dev/node/v2/x/escrow/{client/rest,handler,keeper}matches the v2 module namespace and the usages below. No issues from what’s visible here.x/wasm/alias.go (1)
1-12: Wasm alias constants are straightforwardRe-exporting
StoreKeyandModuleNamefrom the v1 wasm types via this alias file is clear and keeps callers decoupled from the underlying path. No issues here.app/sim_test.go (4)
150-168:TestAppImportExportrefactor and wasm store comparison look goodThe refactor to
setupSimulationAppsimplifiesTestAppImportExportand centralizes simulation wiring:
- Using
setupSimulationAppavoids repeated encoding/config/DB/app setup.- Asserting
appA.Name()againstakash.AppNamekeeps this aligned with the real app name.- Exporting state via
ExportAppStateAndValidatorsand importing into a freshAkashAppinstance with a new home directory (t.TempDir) mirrors a realistic import/export flow.- Building
ctxA/ctxBfromNewContextLegacyatLastBlockHeight()before store comparison is reasonable.- Adding the wasm entry into
storeKeysPrefixeswithwasmtypes.StoreKeyandwasmtypes.TXCounterPrefixextends determinism checks to the wasm store in a targeted way.This all looks correct and improves test coverage for the wasm-enabled app.
Also applies to: 183-204, 353-360
170-197: Guarding “validator set is empty after InitGenesis” is a good safety valveThe new
InitChainererror guard that detects"validator set is empty after InitGenesis"and logs a stack trace before returning is a pragmatic way to avoid hard-failing the test suite on this specific, known edge case, while still surfacing other errors viarequire.NoError(t, err). The use ofruntime/debug.Stack()andstrings.Containsis appropriate here.
383-405: Usingt.TempDir()for app home improves test isolationThe changes to set the app’s home directory via
t.TempDir()inTestFullAppSimulation,TestAppSimulationAfterImport, andTestAppStateDeterminismensure each test (and each run inside the determinism loop) gets its own isolated home path, which reduces cross-test interference and makes failures easier to reproduce.Also applies to: 399-401, 442-443, 488-489
523-548:setupSimulationApphelper centralizes sim wiring effectivelyThe new
setupSimulationApphelper does a nice job of:
- Building a sim config via
simcli.NewConfigFromFlags()and settingChainID.- Wiring encoding config and interface registration once.
- Using
simtestutil.SetupSimulationwithsim.FlagVerboseValue/sim.FlagEnabledValue.- Ensuring DB and temp dir cleanup via
t.Cleanup.- Preparing
AppOptionsMapwithFlagHomeandFlagInvCheckPeriodand constructing a fully wiredAkashApp.The returned tuple covers everything the tests need (config, encoding, DB, options, logger, app) and keeps
TestAppImportExportfocused on the import/export semantics instead of setup boilerplate.tests/upgrade/sdktypes.go (1)
10-56: SDK test types look consistent with gov/upgrade JSON shapesThe helper types (govParams, SoftwareUpgradeProposal, ProposalMsg, etc.) match the JSON you use elsewhere in the tests and keep upgrade tests SDK‑agnostic. I don't see functional issues here.
go.mod (1)
1-292: Module path and core dependency set look coherent with the v2 transitionThe
module pkg.akt.dev/node/v2declaration and the CosmWasm deps (wasmd v0.61.6,wasmvm/v3 v3.0.2) align with the rest of the PR’s wiring (app, x/wasm, tests). Nothing stands out here as inconsistent from a Go modules perspective.If you haven’t already, it’s worth re‑running
go mod tidyand your usualgo list/go buildCI to ensure there are no hidden version conflicts in the upgraded dependency graph.app/app.go (2)
160-189: Wasm config wiring and keeper init shape look goodDeriving
wasmDirfromhomePath, loadingwasmConfigviawasm.ReadNodeConfig(appOpts), clampingMemoryCacheSize,SmartQueryGasLimit, and passing(wasmDir, wasmConfig, wasmOpts)intoInitNormalKeepersis consistent with the rest of the wasm wiring in this PR. No functional issues stand out here from the app side.If you haven’t already, please run the wasm e2e/sim tests on this branch to confirm the new
InitNormalKeeperssignature matches all call sites and that nodes start correctly with customwasmoptions present/absent.
295-360: Begin/EndBlocker ordering forawasmandwasmlooks intentionalPlacing
awasm.ModuleNamebeforewasmtypes.ModuleNamein bothorderBeginBlockersandOrderEndBlockers, after the IBC/transfer modules, matches the comments and expected execution ordering for Akash’s wrapper vs. underlying wasm module.tests/upgrade/workers_test.go (4)
69-77: Main client context construction is soundDeriving
mainAddrfrom the keyring, then buildingmainCctxwithWithFromNameandWithFromAddressgives a clean, explicit sender for the discovered client. This aligns with the new v2 client wiring.
88-104: Wasm store message preparation matches chain expectationsReading
hackatom.wasmfromSourceDir, gzipping it when needed, and settingInstantiatePermission: &wasmtypes.AllowNobodyis appropriate for a “store only via gov” flow. No issues here.
109-114: Good coverage of direct store rejectionAsserting that direct
MsgStoreCodesubmission fails withsdkerrors.ErrUnauthorizedand still returns a*sdk.TxResponsenicely validates the Phase 1 wasm message filter.
138-145: Gov‑mediated wasm store happy‑path assertion looks goodThe final broadcast via gov (with gov module account as the
MsgStoreCodesender andSimulate: true) is a solid positive test that the privileged path works once governance is correctly set up.tests/upgrade/upgrade_test.go (6)
232-288: Newsourcesdirflag is plumbed correctlyRequiring
-sourcesdir, trimming a trailing slash, and threading it intopostUpgradeParams.SourceDirgives the workers enough context to locatehackatom.wasm. That wiring looks consistent and safe.
339-399: Upgrade test harness setup (validators, env, postUpgradeParams) looks coherentThe way you derive validator homes, pick the work validator, construct
cmdr, and initializepostUpgradeParams(includingSourceDir) is internally consistent and matches the rest of the e2e harness.
641-651: Account JSON helpers matchauthmodule‑account shapeThe
baseAccount/moduleAccount/accountRespstructs match thequery auth module-account govJSON (account.base_account.address), keeping the e2e test independent from SDK concrete types. This looks fine.
683-693: Typed authority lookup is a nice improvementQuerying
authfor the gov module account and extractingBaseAccount.Addressto use as theauthorityfield in the upgrade message correctly aligns with v1beta1MsgSoftwareUpgradeexpectations.
772-783: Using a cached proposal file undercacheDiris a nice, repeatable patternWriting the marshaled
ProposalMsgJSON toupgrade-prop-<name>.jsonincacheDirand passing the absolute path intotx gov submit-proposalis a clean approach and decouples the test from CLI JSON‑format specifics.
815-835: Proposal lookup and voting logic look solidSearching
proposals.Proposalsfrom the end for a matchingTitleand then issuingtx gov vote <id> yesis a pragmatic way to target the just‑submitted upgrade proposal. No issues here.x/wasm/module.go (1)
126-157: Service registration and genesis wiring look correctRegistering the Msg and Query servers via
handler.NewMsgServerImpl(am.keeper)andam.keeper.NewQuerier(), and delegating Init/ExportGenesis toInitGenesis/ExportGenesisfromx/wasm/genesis.go, all line up with the keeper and types you’ve defined elsewhere. No functional issues detected here._run/common.mk (3)
36-45: Key, multisig, and cert defaults provide a sensible local topologyThe
KEY_NAMES,MULTISIG_KEY,CLIENT_CERTS, andSERVER_CERTSsets give a good minimal local environment (main/provider/validator/other + msig and provider server cert). This matches the downstream usage in genesis init and keeps local runs straightforward.
82-92: Genesis mutation viajqlooks consistent with chain paramsTweaking
gov.voting_params.voting_periodto"30s"and normalizing alldenom,bond_denom, andmint_denomfields to$(CHAIN_TOKEN_DENOM)innode-init-genesisis a clear, deterministic way to prepare the local chain state. No issues here assumingjqis available in the test environment.
106-119: Account funding and gentx amounts are internally consistentGiving each genesis account
CHAIN_MIN_DEPOSITtokens and delegatingCHAIN_VALIDATOR_DELEGATE = CHAIN_MIN_DEPOSIT / 2for the validator ensures there’s enough balance for proposals and staking while staying simple.x/provider/module.go (2)
23-26: LGTM! Import paths correctly migrated to v2.The import path updates from
node/x/...tonode/v2/x/...are consistent with the repository-wide v2 module path migration.
72-72: Good catch on the comment corrections.The comments now correctly reference the "provider module" instead of the "deployment module", improving code documentation accuracy.
Also applies to: 145-145
.goreleaser.yaml (4)
19-28: LGTM! Darwin amd64 build correctly configured for wasm support.The build configuration properly sets:
- macOS 10.12 minimum version for broad compatibility
static_wasmbuild tag for wasm support- Library path
-L./.cache/libto reference downloaded wasmvm libraries- Symbol stripping (
-s -w) for smaller binaries
39-48: Darwin arm64 configuration mirrors amd64 setup correctly.The arm64 build configuration matches the amd64 pattern with the same wasm support, minimum macOS version, and linking flags.
64-67: Linux builds correctly configured for static wasm linking.Both amd64 and arm64 Linux builds properly reference architecture-specific wasmvm_muslc libraries with appropriate static linking flags. The use of
-Wl,-z,muldefshandles potential multiple definitions in static builds.Also applies to: 83-86
124-124: Dockerfile path update aligns with file rename.The path change from
_build/Dockerfile.akashto_build/akash.Dockerfileis consistent across both amd64 and arm64 builds.Also applies to: 141-141
make/init.mk (3)
28-29: LGTM! Standard Make whitespace handling pattern.The
SPACEandWHITESPACEvariable definitions follow common Make idioms for handling whitespace in variable substitutions.
71-72: LGTM! Dynamic wasmvm version detection.The
WASMVM_MODandWASMVM_VERSIONvariables dynamically discover the wasmvm module path and version fromgo.mod, ensuring version consistency across the build system.
95-100: Comprehensive wasmvm library list for all platforms.The
WASMVM_LIBSvariable correctly includes all necessary wasmvm library artifacts:
- Linux static libraries (muslc for x86_64 and aarch64)
- Darwin static library
- Shared objects for runtime linking
make/setup-cache.mk (2)
5-5: LGTM! Library cache directory creation.The addition of
$(AKASH_DEVCACHE_LIB)directory creation aligns with the cache structure expansion for wasmvm libraries.
69-70: LGTM! Aggregate target for wasmvm libraries.The
wasmvm-libsphony target provides a convenient way to ensure all necessary wasmvm libraries are downloaded before building.Makefile (3)
31-51: LGTM! Build options and tag configuration.The build options setup correctly:
- Defaults to
static-linkon non-Darwin platforms- Supports multiple DB backends (cleveldb, rocksdb, goleveldb)
- Conditionally includes
cgotracewhen specified
67-71: Static-link conditional correctly implemented.The
ifeq (static-link,$(findstring static-link,$(BUILD_OPTIONS)))check correctly adds static linking flags whenBUILD_OPTIONScontainsstatic-link. The logic properly distinguishes between static and dynamic linking scenarios.
74-85: LGTM! Nostrip handling and final build flag assembly.The code correctly:
- Strips symbols (
-s -w) and enables trimpath by default unlessnostripis inBUILD_OPTIONS- Allows custom
LDFLAGSto be appended- Assembles final
BUILD_FLAGSwith complete ldflags for local buildsapp/types/app.go (6)
17-19: LGTM! Comprehensive wasm-related imports.The imports correctly include:
- CosmWasm wasmd packages (wasm, wasmkeeper, wasmtypes)
- IBC v2 transfer and API packages for routing
- Akash wasm module packages
Also applies to: 54-54, 58-58, 73-73, 84-85
112-112: Wasm keeper fields properly added to AppKeepers.Both Cosmos and Akash wasm keepers are correctly exposed in the AppKeepers structure with appropriate types.
Also applies to: 123-123
249-251: LGTM! InitNormalKeepers signature and Akash wasm keeper initialization.The function signature correctly extends to accept wasm configuration parameters, and the Akash wasm keeper is initialized with the standard keeper pattern.
Also applies to: 451-455
457-490: LGTM! Cosmos wasm keeper initialization with custom decorators.The initialization correctly:
- Applies the Akash message filter decorator to control permitted CosmWasm messages
- Extends capabilities with "akash" for custom queries
- Uses
distrkeeper.NewQuerierwrapper to satisfy thetypes.DistributionKeeperinterface (as confirmed in previous review)- Passes all required parameters to
wasmkeeper.NewKeeper
492-509: Comprehensive IBC routing with wasm support.The IBC router setup correctly:
- Creates wasm IBC handler with necessary keeper dependencies
- Configures both IBC v1 and v2 routers
- Routes transfer module and wasm module appropriately
- Uses prefix routing for wasm in v2 (
PortIDPrefixV2)
580-581: Store keys correctly added for both wasm modules.Both Cosmos wasm (
wasmtypes.ModuleName) and Akash wasm (awasm.StoreKey) store keys are properly registered in their respective key collections.Also applies to: 598-598
make/releasing.mk (4)
37-41: LGTM! Build targets properly depend on wasmvm libraries.Both
binsandbuildtargets ensure wasmvm libraries are available before compilation.
44-45: AKASH binary target correctly gates on wasmvm libraries.The wasmvm-libs prerequisite ensures native libraries are available for linking when building the akash binary.
64-84: Test and docker targets properly configured with wasm dependencies.Both
test-binsanddocker-imagetargets:
- Depend on
wasmvm-libsto ensure libraries are available- Use
GORELEASER_TAGSandGORELEASER_LDFLAGSfor consistent build flags- Pass necessary environment variables to goreleaser
Also applies to: 87-107
115-138: Release target correctly configured with wasm dependencies.The
releasetarget properly depends onwasmvm-libsand uses consistent GORELEASER environment variables for the release build.
1865fb7 to
6a9859b
Compare
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
x/audit/module.go (1)
86-91: Fix copy-paste error in panic message.The error message at line 90 says "provider grpc routes" but should say "audit grpc routes" to match the module context.
Apply this diff:
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { - panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register audit grpc routes: %s", err.Error())) } }
♻️ Duplicate comments (9)
app/sim_test.go (1)
172-172: Replace deprecatedsimcliflags withsimpackage flagsThis line still uses deprecated
simcli.FlagVerboseValueandsimcli.FlagEnabledValue, which will trigger SA1019 staticcheck warnings. The newsetupSimulationApphelper at line 531 correctly usessim.FlagVerboseValueandsim.FlagEnabledValueinstead.Apply this diff to align with the helper's approach:
- db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", sim.FlagVerboseValue, sim.FlagEnabledValue)script/upgrades.sh (1)
548-551: Add file existence check before passing validator.json to create-validator command.The file path
"$valdir/validator.json"is used without validation. Ifinit()was skipped or failed, this will produce an unclear error message.As previously noted, consider adding an explicit check:
valjson=$(cat "$valdir/validator.json") if [[ $cnt -gt 0 ]]; then if [[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]]; then + if [[ ! -f "$valdir/validator.json" ]]; then + echo >&2 "Error: $valdir/validator.json not found. Ensure init() has been called." + exit 1 + fi $AKASH tx staking create-validator "$valdir/validator.json" --home="$rvaldir" --from="validator$cnt" --yesupgrades/software/v2.0.0/upgrade.go (1)
50-86: Critical: Context must be unwrapped before passing to keeper methods.The upgrade handler receives
context.Contextbut passes it directly to keeper methods (MM.RunMigrations,GetParams,SetParams) that expectsdk.Context. This will cause a type mismatch or panic.You need to:
- Add the SDK types import:
sdk "github.com/cosmos/cosmos-sdk/types"- Unwrap the context at the start of the handler
- Use the unwrapped context for all keeper calls
Apply this diff:
import ( "context" "fmt" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" upgradetypes "cosmossdk.io/x/upgrade/types" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" apptypes "pkg.akt.dev/node/v2/app/types" utypes "pkg.akt.dev/node/v2/upgrades/types" awasm "pkg.akt.dev/node/v2/x/wasm" )func (up *upgrade) UpgradeHandler() upgradetypes.UpgradeHandler { return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + // Set wasm old version to 1 if we want to call wasm's InitGenesis ourselves // in this upgrade logic ourselves. // // vm[wasm.ModuleName] = wasm.ConsensusVersion // // Otherwise we run this, which will run wasm.InitGenesis(wasm.DefaultGenesis()) // and then override it after. // Set the initial wasm module version //fromVM[wasmtypes.ModuleName] = wasm.AppModule{}.ConsensusVersion() - toVM, err := up.MM.RunMigrations(ctx, up.Configurator, fromVM) + toVM, err := up.MM.RunMigrations(sdkCtx, up.Configurator, fromVM) if err != nil { return toVM, err } - params := up.Keepers.Cosmos.Wasm.GetParams(ctx) + params := up.Keepers.Cosmos.Wasm.GetParams(sdkCtx) // Configure code upload access - RESTRICTED TO GOVERNANCE ONLY // Only governance proposals can upload contract code // This provides maximum security for mainnet deployment params.CodeUploadAccess = wasmtypes.AccessConfig{ Permission: wasmtypes.AccessTypeNobody, } // Configure instantiate default permission params.InstantiateDefaultPermission = wasmtypes.AccessTypeEverybody - err = up.Keepers.Cosmos.Wasm.SetParams(ctx, params) + err = up.Keepers.Cosmos.Wasm.SetParams(sdkCtx, params) if err != nil { return toVM, err } return toVM, err } }make/setup-cache.mk (1)
62-70: Checksum verification still commented out.The security issue from the previous review remains unresolved. Line 67 shows the
sha256sumverification is still commented out, and line 65 shows the dependency on checksums.txt is also commented. Downloading native libraries without integrity verification exposes the build to supply-chain attacks.tests/upgrade/workers_test.go (1)
128-146: Redundant account unpacking persists.The issue flagged in the previous review remains: lines 134-136 redundantly unpack the account into
macc, which already contains the correct value from the type assertion at lines 131-132. Although the previous review marked this as addressed in commit 8efe0de, the redundant code is still present.Apply this diff to remove the redundant unpacking:
var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()tests/upgrade/upgrade_test.go (3)
695-704: Remove commented-out timer code.The commented-out timer/select block from lines 695-704 should be removed, as flagged in the previous review. Although marked as addressed in commit b647a27, this dead code is still present in the current changes.
Apply this diff:
- //tm := time.NewTimer(30 * time.Second) - //select { - //case <-l.ctx.Done(): - // if !tm.Stop() { - // <-tm.C - // } - // err = l.ctx.Err() - // return err - //case <-tm.C: - //} - cmdRes, err = l.cmdr.execute(l.ctx, "query gov params")
757-765: Handle multi-denom deposits safely.Line 761 accesses
params.DepositParams.MinDeposit[0]without bounds checking and ignores any additional denoms. This will panic if MinDeposit is empty and may submit an insufficient deposit if multiple denoms are required.Apply this diff to handle the full deposit safely:
+ depositCoins := params.DepositParams.MinDeposit + if depositCoins.Empty() { + return fmt.Errorf("min deposit parameter is empty") + } + prop := &ProposalMsg{ Messages: []json.RawMessage{ jup, }, - Deposit: params.DepositParams.MinDeposit[0].String(), + Deposit: depositCoins.String(), Title: l.upgradeName, Summary: l.upgradeName, Expedited: false, }
791-792: Fix block count comment and typo.The comment at line 791 says "two blocks" but the timeout is 18 seconds (approximately three 6-second blocks). Additionally, "commited" should be "committed". This issue was flagged in a previous review and marked as addressed in commit 2fdeb4e, but the mismatch persists.
Apply this diff:
- // give it two blocks to make sure a proposal has been commited + // give it three blocks to make sure a proposal has been committed tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second)Or if two blocks is sufficient:
- // give it two blocks to make sure a proposal has been commited - tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second) + // give it two blocks to make sure a proposal has been committed + tmctx, cancel := context.WithTimeout(l.ctx, 12*time.Second)make/releasing.mk (1)
51-52: akash_docgen still missing wasmvm-libs prerequisite.Although the previous review flagged this and marked it as addressed in commit dd65357, the
akash_docgentarget at line 51 still lacks thewasmvm-libsprerequisite. Since docgen imports wasm-dependent code, it will fail to link without the CosmWasm library.Apply this diff:
.PHONY: akash_docgen -akash_docgen: $(AKASH_DEVCACHE) +akash_docgen: $(AKASH_DEVCACHE) wasmvm-libs $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgen
🧹 Nitpick comments (1)
app/sim_test.go (1)
523-549: Excellent refactor! Helper consolidates simulation setupThe new
setupSimulationApphelper function effectively reduces duplication by centralizing common simulation setup logic. Good practices observed:
- Uses
t.Cleanup()for proper resource cleanup in tests- Returns all necessary artifacts (config, encodingConfig, db, appOpts, logger, app)
- Correctly uses
sim.Flag*values (not deprecatedsimcli.Flag*)- Proper error handling and skip logic
Consider updating
TestFullAppSimulation(lines 107-148) andTestAppStateDeterminism(lines 456-521) to also use this helper where applicable, which would further reduce duplication. However, this can be deferred as those tests have slightly different setup requirements.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (38)
.github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)app/app.go(9 hunks)app/sim_test.go(9 hunks)app/types/app.go(8 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/sims/simulation_helpers.go(3 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)wasmvm.go(1 hunks)x/audit/module.go(5 hunks)x/cert/module.go(5 hunks)x/escrow/module.go(5 hunks)x/market/module.go(2 hunks)x/provider/module.go(3 hunks)x/take/module.go(6 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
🚧 Files skipped from review as they are similar to previous changes (11)
- tests/upgrade/test-config.json
- x/wasm/alias.go
- .github/workflows/tests.yaml
- x/escrow/module.go
- x/cert/module.go
- _run/common-commands.mk
- x/take/module.go
- make/test-integration.mk
- make/init.mk
- tests/upgrade/types/types.go
- _run/common.mk
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
make/test-upgrade.mkMakefilemake/releasing.mkmake/setup-cache.mk
📚 Learning: 2025-11-14T01:24:04.219Z
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
Applied to files:
x/wasm/keeper/msg_filter.gogo.mod
🧬 Code graph analysis (9)
upgrades/software/v2.0.0/upgrade.go (3)
app/types/app.go (1)
App(131-142)upgrades/types/types.go (1)
IUpgrade(32-37)x/wasm/alias.go (1)
StoreKey(9-9)
x/audit/module.go (2)
x/cert/module.go (9)
AppModuleBasic(39-41)AppModuleBasic(50-52)AppModuleBasic(55-57)AppModuleBasic(65-67)AppModuleBasic(70-83)AppModuleBasic(86-91)AppModuleBasic(94-96)AppModuleBasic(99-101)AppModuleBasic(104-106)x/provider/module.go (7)
AppModuleBasic(43-45)AppModuleBasic(58-60)AppModuleBasic(63-65)AppModuleBasic(73-75)AppModuleBasic(78-85)AppModuleBasic(88-93)AppModuleBasic(96-98)
x/wasm/genesis.go (1)
x/wasm/alias.go (1)
ModuleName(11-11)
app/sim_test.go (4)
app/app.go (3)
AppName(83-83)NewApp(110-293)AkashApp(97-107)testutil/sims/simulation_helpers.go (3)
CheckExportSimulation(87-112)PrintStats(115-119)SetupSimulation(26-49)x/wasm/alias.go (1)
StoreKey(9-9)app/config.go (1)
ModuleBasics(72-74)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
app/types/app.go (1)
x/wasm/alias.go (2)
StoreKey(9-9)ModuleName(11-11)
x/wasm/module.go (3)
x/wasm/alias.go (1)
ModuleName(11-11)x/wasm/genesis.go (4)
DefaultGenesisState(22-34)ValidateGenesis(16-18)InitGenesis(37-42)ExportGenesis(45-50)x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
app/app.go (1)
x/wasm/alias.go (1)
ModuleName(11-11)
⏰ 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). (7)
- GitHub Check: network-upgrade
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: tests
- GitHub Check: build-bins
🔇 Additional comments (54)
testutil/sims/simulation_helpers.go (3)
24-24: LGTM: Grammar improvement.The added comma properly separates the conditional clause and improves readability.
59-59: LGTM: Documentation clarity improvement.The hyphenated "module-weighted" is grammatically correct as a compound adjective and improves readability.
199-200: LGTM: Improved variable naming.Renaming the loop variable from
kvtopairimproves clarity and distinguishes it from thekvpackage type.app/sim_test.go (1)
353-360: LGTM! Wasm store verification added correctlyThe addition of
wasmtypes.StoreKeyto the import/export verification list properly enables state comparison for the wasm module. Excludingwasmtypes.TXCounterPrefixis appropriate since transaction counters are expected to differ between app instances.x/provider/module.go (2)
72-72: Comment corrections look good.The updated comments accurately describe the provider module's methods. The EndBlock comment correction (from deployment to provider module reference) fixes what was likely a copy-paste error.
Also applies to: 145-146
23-26: Verification confirms: v2 import migration is complete and consistent.The v2 import paths for provider packages are correctly in place (lines 23-26), and no stale v1 provider imports remain anywhere in the codebase across 228 Go files. The migration is complete.
.github/actions/setup-ubuntu/action.yaml (1)
17-17: LGTM! Appropriate dependency for wasm support.The addition of
musl-toolsaligns with the wasm integration changes throughout the PR, particularly the muslc-based wasmvm linking referenced in.goreleaser.yaml.tests/upgrade/test-cases.json (1)
2-9: LGTM! Correctly defines v2.0.0 upgrade test case.The addition of the v2.0.0 upgrade entry with the
wasmandawasmmodules is consistent with the PR objectives and aligns with the broader v2 migration changes.meta.json (1)
48-52: LGTM! v2.0.0 upgrade configuration is consistent.The upgrade entry is properly structured and aligns with the test case definitions in
tests/upgrade/test-cases.json.x/audit/module.go (1)
22-23: LGTM! Import paths correctly updated to v2.The import path migration is consistent with the broader v2 module path changes across the codebase.
x/market/module.go (1)
24-28: LGTM! Import paths correctly updated to v2.The import path migration for audit, escrow, market handler, keeper, and simulation packages is consistent with the broader v2 module path changes.
.goreleaser.yaml (4)
19-28: LGTM! Darwin build configuration properly set up for wasm.The macOS minimum version flag, static_wasm build tag, and restructured ldflags with external linking are correctly configured for wasm support.
64-67: LGTM! Linux amd64 ldflags correctly configured for static wasm linking.The ldflags properly reference the muslc variant of wasmvm with appropriate static linking flags.
83-86: LGTM! Linux arm64 ldflags correctly configured for static wasm linking.The architecture-specific wasmvm_muslc.aarch64 library is correctly referenced with static linking flags.
124-141: Dockerfile path verified—no action needed.The file
_build/akash.Dockerfileexists at the new location with proper permissions. The Dockerfile path change has been successfully implemented.wasmvm.go (1)
1-3: Verify that .cache/lib is populated during the build process.The CGO linker directive correctly sets up runtime library paths for wasmvm. Ensure that the
.cache/libdirectory is populated with the necessary wasmvm libraries before linking occurs.Run the following script to verify the wasmvm library setup:
x/wasm/genesis.go (4)
15-18: LGTM!The validation logic correctly delegates to the Params validation method.
20-34: LGTM!The genesis state initialization correctly builds from
DefaultParams()and appropriately blocks transfers to critical module addresses (governance, distribution, staking pools).
36-42: LGTM!Genesis initialization correctly applies the parameters and appropriately panics on error during chain initialization.
44-50: LGTM!Genesis export correctly retrieves and returns the current parameter state.
upgrades/software/v2.0.0/upgrade.go (1)
68-78: LGTM!The wasm parameter configuration appropriately restricts code upload to governance-only and allows everyone to instantiate contracts. The redundant assignment mentioned in past reviews has been addressed.
x/wasm/simulation/proposals.go (2)
21-30: LGTM!Simulation proposal registration correctly wires the update-params operation with appropriate weight and handler.
32-42: LGTM!The simulation correctly constructs a governance proposal for updating wasm parameters. Uses default parameters for simplicity, which is acceptable for basic simulation testing.
x/wasm/keeper/msg_filter.go (5)
16-30: LGTM!Clean decorator pattern implementation for wrapping the wasm messenger with Phase 1 message filtering.
32-61: LGTM!The dispatch logic correctly applies Phase 1 filtering before message execution, with appropriate event emission and logging for monitoring blocked messages.
95-108: Verify IBC blocking is intentional for Phase 1.Both IBC and IBC2 messages are currently blocked (lines 96-108). Previous code comments suggested "ALLOW IBC messages (for DeFi composability)" which would enable contract-to-contract interactions across chains. Blocking IBC messages prevents:
- Cross-chain token transfers initiated by contracts
- IBC packet sends/receives from smart contracts
- Interchain account operations from contracts
If this is intentional for Phase 1 security, consider adding a comment explaining the rationale. If contracts should support basic IBC operations, you may need to allow IBC with restrictions.
135-165: LGTM!Bank message filtering appropriately blocks transfers to critical addresses and denies burn operations while allowing normal transfers.
167-205: LGTM!Message type classification is comprehensive and correct, with all wasmvm v3 CosmosMsg types properly labeled for event emission and logging. The IBC2 duplicate check issue from past reviews has been addressed.
go.mod (2)
1-1: LGTM!Module path correctly updated to v2 namespace for the major version upgrade.
17-18: LGTM!CosmWasm dependencies are properly added with current stable versions (wasmd v0.61.6 and wasmvm v3.0.2), confirmed secure and up-to-date in previous reviews.
Based on learnings
app/types/app.go (5)
17-19: LGTM!CosmWasm imports properly added for wasm module integration.
112-112: LGTM!Cosmos wasm keeper field properly added to AppKeepers structure.
123-123: LGTM!Akash wasm keeper field properly added to AppKeepers structure.
244-254: LGTM!Function signature correctly extended to accept wasm configuration parameters (directory, config, options) needed for wasm keeper initialization.
451-509: LGTM!Wasm keeper initialization correctly:
- Initializes Akash wasm keeper with basic params
- Wraps the message handler with Akash's filter decorator for Phase 1 restrictions
- Builds Cosmos wasm keeper with all required dependencies
- Includes "akash" in the capabilities list
- Properly wires both static and v2 IBC routing for wasm module
app/app.go (3)
160-172: LGTM!Wasm configuration properly initializes with appropriate production-safe settings:
- 100 MB memory cache limit to prevent DoS
- 3M gas limit for queries
- Debug mode disabled for security
182-192: LGTM!Wasm configuration parameters correctly passed to keeper initialization.
323-327: LGTM!Module ordering correctly places Akash wasm before Cosmos wasm, with clear comments explaining the sequencing requirements.
x/wasm/module.go (2)
38-100: LGTM!AppModuleBasic implementation is complete with all required methods. The panic in
GetQueryCmdandGetTxCmdis intentional per the design choice to not expose CLI commands via the Cosmos SDK interface.
102-182: LGTM!AppModule implementation is complete with:
- Proper service registration for messages and queries
- Genesis initialization and export
- Simulation support
- Appropriate consensus version
All methods correctly delegate to keeper and package-level functions.
make/test-upgrade.mk (3)
24-24: LGTM: Snapshot source consolidation.The default change from
sandbox1tosandboxaligns with the conditional logic that only recognizesmainnetandsandboxas valid sources.
67-67: LGTM: Source directory parameter added.The
-sourcesdirparameter provides the test with access to source files (e.g., test wasm contracts intests/upgrade/testdata/), which is necessary for the v2.0.0 upgrade test flow.
76-77: LGTM: Binary preparation activated in test-reset.Uncommenting the
binsinvocation and adding--gbv=$(GENESIS_BINARY_VERSION)ensures that the correct genesis binary version is prepared during the test reset flow, consistent with the initialization logic.make/setup-cache.mk (1)
5-5: LGTM: Library cache directory added.The new
AKASH_DEVCACHE_LIBdirectory is necessary for caching wasmvm library artifacts, supporting the CosmWasm integration.tests/upgrade/sdktypes.go (1)
1-56: LGTM: Clean test type definitions.The SDK-specific types are well-structured for upgrade simulation. The comment at lines 10-11 clearly explains the rationale for avoiding direct SDK imports, and the JSON tags are correctly aligned with SDK response formats.
Makefile (2)
31-51: LGTM: Build options configuration.The platform-aware build options (static linking for non-Darwin) and multi-backend DB selection logic are well-structured and provide good flexibility for different build scenarios.
56-86: Verify GORELEASER_LDFLAGS timing is intentional.
GORELEASER_LDFLAGSis assigned at line 63 using:=(immediate assignment) before the linkmode/extldflags additions at lines 65-71 and the strip flags at line 75. This means goreleaser builds will use base ldflags without these linking directives.If the goreleaser-cross docker environment handles linking differently and doesn't need these flags, this is correct. However, if goreleaser needs the same flags as local builds, the assignment should be moved after line 80 or changed to
=(recursive assignment).Please confirm this is intentional. If goreleaser needs the same flags, apply this diff:
-GORELEASER_LDFLAGS := $(ldflags) - ldflags += -linkmode=external ifeq (static-link,$(findstring static-link,$(BUILD_OPTIONS))) ldflags += -extldflags "-L$(AKASH_DEVCACHE_LIB) -lm -Wl,-z,muldefs -static" else ldflags += -extldflags "-L$(AKASH_DEVCACHE_LIB)" endif # check for nostrip option ifeq (,$(findstring nostrip,$(BUILD_OPTIONS))) ldflags += -s -w BUILD_FLAGS += -trimpath endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) +GORELEASER_LDFLAGS = $(ldflags) GORELEASER_TAGS := $(BUILD_TAGS) GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)'Note: Changed to
=(recursive) so it always reflects the current ldflags value.tests/upgrade/workers_test.go (1)
33-37: LGTM: Upgraded to v2.0.0 worker registration.The post-upgrade worker registration correctly reflects the v2.0.0 upgrade target, consistent with the PR's objective of enabling smart contracts on Akash.
tests/upgrade/upgrade_test.go (2)
641-651: LGTM: Account response types added.The new
baseAccount,moduleAccount, andaccountResptypes are appropriately defined for unmarshaling the governance module account query response.
683-693: LGTM: Authority address query added.Querying the governance module account to obtain the authority address is necessary for constructing the
MsgSoftwareUpgradeproposal in the v2 upgrade flow.make/releasing.mk (4)
37-45: LGTM: wasmvm-libs prerequisites properly added.The
buildand$(AKASH)targets now correctly depend onwasmvm-libs, ensuring the CosmWasm library is available before linking.
64-84: LGTM: test-bins updated with wasmvm-libs and goreleaser variables.The
test-binstarget correctly depends onwasmvm-libsand uses theGORELEASER_TAGSandGORELEASER_LDFLAGSvariables for consistent build configuration.
87-107: LGTM: docker-image updated with wasmvm-libs and goreleaser variables.The
docker-imagetarget correctly depends onwasmvm-libsand uses the updated goreleaser variables for consistent build configuration across different target types.
115-138: LGTM: release target properly configured.The
releasetarget correctly depends on bothwasmvm-libsandgen-changelog, and uses the updatedGORELEASER_TAGSandGORELEASER_LDFLAGSvariables for consistent release builds.
8cda046 to
423fe08
Compare
There was a problem hiding this 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)
script/upgrades.sh (1)
542-552: Ensurevalidator.jsonexists before using file-basedcreate-validatorpathThe new path calls:
valjson=$(cat "$valdir/validator.json") if [[ $cnt -gt 0 ]]; then if [[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]]; then $AKASH tx staking create-validator "$valdir/validator.json" ...If
init()wasn’t run (or failed) for higher‑index validators,$valdir/validator.jsonmay not exist, leading to a confusing failure during upgrades.Consider a small guard here so we fail fast with a clear message instead of relying on
cat/akasherrors:- valdir=$validators_dir/.akash${cnt} - - valjson=$(cat "$valdir/validator.json") + valdir=$validators_dir/.akash${cnt} + + if [[ ! -f "$valdir/validator.json" ]]; then + echo >&2 "Error: $valdir/validator.json not found. Ensure init() has been run for all validators before prepare_state()." + exit 1 + fi + + valjson=$(cat "$valdir/validator.json") if [[ $cnt -gt 0 ]]; then if [[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]]; then $AKASH tx staking create-validator "$valdir/validator.json" --home="$rvaldir" --from="validator$cnt" --yesThis keeps the new file‑based create‑validator behavior while making failure modes explicit.
app/sim_test.go (1)
150-181: Unify simulation flag usage (avoid simcli.Flag in TestAppImportExport)*
setupSimulationAppcorrectly uses localsim.FlagVerboseValue/sim.FlagEnabledValueandsimtestutil.SetupSimulation, butTestAppImportExportstill calls:newDB, newDir, _, _, err := simtestutil.SetupSimulation( config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue, )This reintroduces the dependency on deprecated
simcli.Flag*globals and is inconsistent with the helper right below, which usessim.Flag*. Since you already have the local sim package wrapping these flags, it’s cleaner to use it here as well:- newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", sim.FlagVerboseValue, sim.FlagEnabledValue)This keeps all tests on the same flag source and avoids SA1019 warnings against
simcli.Flag*.[describe_issue_if_applicable]
Also applies to: 172-181, 523-549
_run/common.mk (1)
78-124: Node init pipeline is now properly serialised and deterministicThe
node-initworkflow:
- Is marked
.NOTPARALLEL: node-initand.INTERMEDIATE: node-init,- Runs the logical stages (
node-init-genesis,node-init-genesis-accounts,node-init-genesis-certs,node-init-gentx,node-init-finalize) as prerequisites,- Uses
jqto adjust voting period and denom fields, then adds accounts, certs, gentx, and finally validates genesis.This setup addresses the earlier risk of parallel execution (e.g., accounts/certs/gentx racing the genesis file) and should give a deterministic genesis pipeline even under
make -j. The only small duplication is hardcoding--gas-prices=0.025uaktinnode-init-gentxinstead of reusing$(AKASH_GAS_PRICES), which you could unify later if desired.Makefile (1)
53-80: Fix GORELEASER_LDFLAGS so it captures the final ldflags (not the pre-mutated value)Right now:
ldflagsis initialised with the-X ...metadata (Lines 56–61).GORELEASER_LDFLAGS := $(ldflags)is set immediately afterwards (Line 63).- Then
ldflagsis further mutated with-linkmode=external, static vs dynamic-extldflags,-s -w(whennostripis absent), and any custom$(LDFLAGS)(Lines 65–80).This means
GORELEASER_LDFLAGSnever sees the finalldflagsstring used for local builds; goreleaser will miss-linkmode=external, the wasm static-link-extldflags, strip flags, and any user-providedLDFLAGS. Release binaries can therefore diverge from locally built ones and, in the worst case, lose the static wasm linkage entirely.You should bind
GORELEASER_LDFLAGSafter all ldflags mutations (or make it recursive) so it always reflects the final value. For example:-ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ - -X github.com/cosmos/cosmos-sdk/version.AppName=akash \ - -X github.com/cosmos/cosmos-sdk/version.BuildTags="$(build_tags_cs)" \ - -X github.com/cosmos/cosmos-sdk/version.Version=$(shell git describe --tags | sed 's/^v//') \ - -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_HEAD_COMMIT_LONG) \ - -X github.com/cosmos/cosmos-sdk/types.DBBackend=$(DB_BACKEND) - -GORELEASER_LDFLAGS := $(ldflags) - -ldflags += -linkmode=external +ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ + -X github.com/cosmos/cosmos-sdk/version.AppName=akash \ + -X github.com/cosmos/cosmos-sdk/version.BuildTags="$(build_tags_cs)" \ + -X github.com/cosmos/cosmos-sdk/version.Version=$(shell git describe --tags | sed 's/^v//') \ + -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_HEAD_COMMIT_LONG) \ + -X github.com/cosmos/cosmos-sdk/types.DBBackend=$(DB_BACKEND) + +ldflags += -linkmode=external @@ ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) -GORELEASER_TAGS := $(BUILD_TAGS) -GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)' +GORELEASER_LDFLAGS = $(ldflags) +GORELEASER_TAGS := $(BUILD_TAGS) +GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)'This keeps goreleaser and local builds aligned on the exact same linker flags, including static wasm settings and any custom
LDFLAGS.
🧹 Nitpick comments (14)
x/cert/module.go (1)
89-89: Address remaining comment inconsistencies for consistency.While this PR improves comment accuracy, a few pre-existing inconsistencies remain:
- Line 89: Error message references "provider" instead of "cert"
- Line 116: Comment says "provider module" instead of "cert module"
- Line 152: Comment says "audit module" instead of "cert module"
Consider updating these for consistency with the other comment improvements in this PR.
Apply this diff to fix the remaining inconsistencies:
err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { - panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register cert grpc routes: %s", err.Error())) } } -// Name returns the provider module name +// Name returns the cert module name func (AppModule) Name() string { return types.ModuleName } -// ExportGenesis returns the exported genesis state as raw bytes for the audit +// ExportGenesis returns the exported genesis state as raw bytes for the cert // module. func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {Also applies to: 116-117, 152-153
x/escrow/module.go (1)
86-92: Align escrow module comments and error messagesThere are a few leftover copy‑paste references to other modules:
- Line 90: panic text still says “provider grpc routes”.
- Line 109:
AppModulecomment says “audit module”.- Line 127:
Namecomment says “provider module name”.- Lines 178–180:
ExportGenesiscomment mentions the “audit” module.Consider updating these to “escrow” for clarity and easier debugging; behavior doesn’t change but the surface becomes less confusing.
@@ -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := v1.RegisterQueryHandlerClient(context.Background(), mux, v1.NewQueryClient(clientCtx)) - if err != nil { - panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) - } +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + err := v1.RegisterQueryHandlerClient(context.Background(), mux, v1.NewQueryClient(clientCtx)) + if err != nil { + panic(fmt.Sprintf("couldn't register escrow grpc routes: %s", err.Error())) + } } @@ -// AppModule implements an application module for the audit module. +// AppModule implements an application module for the escrow module. @@ -// Name returns the provider module name +// Name returns the escrow module name @@ -// ExportGenesis returns the exported genesis state as raw bytes for the audit -// module. +// ExportGenesis returns the exported genesis state as raw bytes for the escrow +// module.Also applies to: 109-131, 164-180
x/take/module.go (1)
37-56: Tidy up take module comments (and optionally align CLI behavior)The functional wiring for the
takemodule looks good, but a couple of small cleanups would make it more self‑describing:
- Line 109 comment still says “provider module name” even though this is the take module.
- Other comments correctly reference “take module”.
Optionally, you may also want to mirror the pattern used in other Akash modules where
GetQueryCmd/GetTxCmdpanic("akash modules do not export cli commands via cosmos interface")instead of returningnil, but that’s stylistic.-// Name returns the provider module name +// Name returns the take module name func (AppModule) Name() string { return types.ModuleName }Also applies to: 63-67, 84-89, 101-112
x/wasm/module.go (3)
110-113: Fix copy-paste error in comment.The comment says "provider module" but should reference "wasm module" for consistency.
Apply this diff:
-// Name returns the provider module name +// Name returns the wasm module name func (AppModule) Name() string { return types.ModuleName }
176-177: Fix copy-paste error in comment.The comment references "take module" but should say "wasm module".
Apply this diff:
-// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for wasm module's types. func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {}
180-182: Fix copy-paste error in comment.The comment references "take module" but should say "wasm module".
Apply this diff:
-// WeightedOperations doesn't return any take module operation. +// WeightedOperations doesn't return any wasm module operation. func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil }.goreleaser.yaml (3)
19-28: Darwin build flags and minimum macOS version look consistentThe added
CGO_CFLAGS=-mmacosx-version-min=10.12,static_wasmtag, and-extldflags "-L./.cache/lib -mmacosx-version-min=10.12"combination for both darwin arches is coherent and should give you reproducible >=10.12 binaries. The duplication of the min-version flag in bothCGO_CFLAGSand-extldflagsis harmless; if you want to simplify later, you could centralize it in one place.Also applies to: 39-48
64-67: Keep Goreleaser Linux ldflags in lockstep with Makefile static-link flagsFor Linux targets,
ldflagsnow prepend{{ .Env.BUILD_LDFLAGS }}and then add-s -w,-linkmode=external, and architecture-specific-extldflagswith-lwasmvm_muslc.{arch}and-static. This is exactly what you want for static wasmvm builds, but it does introduce two coupling points:
- The Makefile’s final
ldflags(built aroundAKASH_DEVCACHE_LIBandBUILD_OPTIONS) must be the source ofBUILD_LDFLAGS, otherwise release artifacts may diverge from local builds.- Any future change to the static-link recipe (e.g., different library path or extra libs) now needs to be updated in both the Makefile and here.
Consider confirming that
BUILD_LDFLAGSis always derived from the Makefile’s finalldflags, and optionally consolidating the static-link recipe in one place to avoid drift.Also applies to: 83-86
123-157: Verify Dockerfile path rename and multi-arch image wiringThe
dockerssection now points both amd64 and arm64 images at_build/akash.Dockerfile. That’s fine, but it assumes:
_build/akash.Dockerfileexists and is the canonical Dockerfile for releases.- Any CI workflows, docs, or scripts that referenced the old
_build/Dockerfile.akashhave been updated or removed.Please double-check the CI/release workflow wiring so this rename doesn’t break image builds.
Makefile (1)
82-85: Ensure Goreleaser env wiring matches these GORELEASER_ variables*
GORELEASER_TAGS := $(BUILD_TAGS)andGORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)'are set up as the goreleaser-facing view of your build configuration, while.goreleaser.yamlstill references.Env.MOD,.Env.BUILD_TAGS, and.Env.BUILD_LDFLAGS.Please confirm that the release scripts/workflows export:
MODfrom$(GOMOD),BUILD_TAGSfrom$(GORELEASER_TAGS), andBUILD_LDFLAGSfrom the final$(GORELEASER_LDFLAGS),so goreleaser sees the same tags and ldflags that
go builduses viaBUILD_FLAGS._run/common.mk (4)
1-8: OPTIONS / SKIP_BUILD gate is fine; ensure it’s consumed upstreamThe
OPTIONS/SKIP_BUILDwiring fornobuildis straightforward and harmless here. Just make sureSKIP_BUILDis actually honoured in../common-base.mk(e.g., around thebinstarget); otherwise this knob will be a no-op.Also applies to: 10-17
18-45: Chain/env defaults are reasonable; minor unused constantThe exported
AKASH_*defaults and chain constants (CHAIN_MIN_DEPOSIT,CHAIN_VALIDATOR_DELEGATE,CHAIN_TOKEN_DENOM) all look consistent for a local testnet. One minor nit:CHAIN_ACCOUNT_DEPOSITis computed but not used anywhere in this file; either wire it into the genesis/account flow or drop it to avoid confusion.
46-77: Client init and key generation flow looks goodThe
init,AKASH_INIT,client-init, andclient-init-keystargets are wired coherently:
initdepends onbinsandakash-init,akash-initis driven by the.akash-initmarker,client-init-keysfan-outs overKEY_NAMESplus the multisig.Using
.INTERMEDIATEfor these orchestration targets keeps the run directory tidy. No issues here; you might optionally reuse$(KEY_OPTS)in thekeys addcalls for consistency, but the exportedAKASH_KEYRING_BACKENDalready makes them work.
125-143: Runtime convenience targets are straightforward
node-run,node-status,rest-server-run, androsetta-runare thin wrappers around theakashCLI and look fine. Reusing$(AKASH_GAS_PRICES)innode-run(as you already do) keeps things consistent with the exported env; similarly, if you ever want to vary gas prices, consider piping that throughnode-init-gentxas well so the whole flow stays aligned.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (38)
.github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)app/app.go(9 hunks)app/sim_test.go(9 hunks)app/types/app.go(8 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/sims/simulation_helpers.go(3 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)wasmvm.go(1 hunks)x/audit/module.go(5 hunks)x/cert/module.go(5 hunks)x/escrow/module.go(5 hunks)x/market/module.go(2 hunks)x/provider/module.go(3 hunks)x/take/module.go(6 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
🚧 Files skipped from review as they are similar to previous changes (15)
- _run/common-commands.mk
- tests/upgrade/types/types.go
- x/provider/module.go
- wasmvm.go
- .github/workflows/tests.yaml
- make/init.mk
- make/test-integration.mk
- x/wasm/genesis.go
- x/audit/module.go
- testutil/sims/simulation_helpers.go
- .github/actions/setup-ubuntu/action.yaml
- make/releasing.mk
- x/wasm/alias.go
- make/setup-cache.mk
- make/test-upgrade.mk
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
📚 Learning: 2025-11-14T01:24:04.219Z
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
Applied to files:
x/wasm/keeper/msg_filter.gogo.mod
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
Makefile_run/common.mk
🧬 Code graph analysis (9)
x/cert/module.go (2)
x/cert/alias.go (2)
Keeper(18-18)ModuleName(13-13)x/cert/keeper/keeper.go (1)
Keeper(12-22)
x/escrow/module.go (2)
x/audit/module.go (8)
AppModuleBasic(39-41)AppModuleBasic(44-46)AppModuleBasic(49-51)AppModuleBasic(59-61)AppModuleBasic(64-79)AppModuleBasic(87-92)AppModuleBasic(95-100)AppModuleBasic(103-105)x/provider/module.go (8)
AppModuleBasic(43-45)AppModuleBasic(58-60)AppModuleBasic(63-65)AppModuleBasic(73-75)AppModuleBasic(78-85)AppModuleBasic(88-93)AppModuleBasic(96-98)AppModuleBasic(101-103)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
app/sim_test.go (4)
app/app.go (3)
AppName(83-83)NewApp(110-293)AkashApp(97-107)testutil/sims/simulation_helpers.go (3)
CheckExportSimulation(87-112)PrintStats(115-119)SetupSimulation(26-49)x/wasm/alias.go (1)
StoreKey(9-9)app/config.go (1)
ModuleBasics(72-74)
app/app.go (1)
x/wasm/alias.go (1)
ModuleName(11-11)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
upgrades/software/v2.0.0/upgrade.go (3)
app/types/app.go (1)
App(131-142)upgrades/types/types.go (1)
IUpgrade(32-37)x/wasm/alias.go (1)
StoreKey(9-9)
x/wasm/module.go (3)
x/wasm/alias.go (1)
ModuleName(11-11)x/wasm/genesis.go (4)
DefaultGenesisState(22-34)ValidateGenesis(16-18)InitGenesis(37-42)ExportGenesis(45-50)x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
x/take/module.go (1)
x/take/alias.go (1)
ModuleName(11-11)
⏰ 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). (6)
- GitHub Check: network-upgrade
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: build-bins
🔇 Additional comments (27)
x/cert/module.go (2)
38-85: LGTM! Comment updates improve documentation consistency.The comment updates correctly reference the cert module throughout, improving the accuracy and consistency of the documentation.
Also applies to: 138-138
21-23: V2 import path migration verified as complete.Verification confirms that all v1 cert imports have been successfully migrated to v2 across the codebase. No remaining v1 references were found in any of the 16 files that import from the cert module. The imports at lines 21-23 in x/cert/module.go (handler, keeper, simulation) are correctly updated, and all dependent files consistently use v2 paths with no mixed versions.
tests/upgrade/test-config.json (1)
3-5: Single-validator test config matches script defaultsHaving a single validator entry (
.akash0) aligns withMAX_VALIDATORS=1inscript/upgrades.sh, so the default upgrade test path now cleanly exercises the single-validator scenario. Note that multi-validator flows won’t be covered by this config, which is fine if that’s intentional.x/market/module.go (1)
24-28: v2 wiring and EndBlock documentation look consistentThe market module now correctly depends on the v2 audit/escrow/market keepers and handler, and the EndBlock comment matches the module name. No functional changes introduced here.
Also applies to: 159-163
x/wasm/simulation/proposals.go (1)
14-29: MsgUpdateParams simulation wiring looks correctThe wasm simulation module now exposes a single weighted proposal that builds
MsgUpdateParamsusing the gov module account as authority andtypes.DefaultParams(). This matches the usual parameter‑update pattern and should integrate cleanly with the broader simulation manager.Also applies to: 32-42
app/sim_test.go (1)
353-360: Including wasm TX counter in store comparison is a good additionAdding the wasm store (with
wasmtypes.StoreKeyandwasmtypes.TXCounterPrefix) to the import/export store comparison ensures wasm state stays consistent across export/import cycles. This is an important check now that CosmWasm is enabled.go.mod (1)
1-2: No action needed—Stargate references verified absentVerification confirms the codebase is clean of any
CosmosMsg.Stargateusage. With wasmvm v3.0.2 integrated, the removal of the Stargate field poses no compatibility issues.meta.json (1)
48-52: LGTM!The v2.0.0 upgrade entry is properly structured and consistent with the existing upgrade entries. The upgrade path from v1.0.0 to v2.0.0 (using binary v1.0.3-rc4) aligns with the broader PR changes introducing wasm module support.
tests/upgrade/test-cases.json (1)
2-9: LGTM!The v2.0.0 test case entry correctly declares the addition of
wasmandawasmmodules. This aligns with the StoreLoader implementation in upgrades/software/v2.0.0/upgrade.go and the broader wasm integration in this PR.x/wasm/keeper/msg_filter.go (1)
168-205: LGTM!The
getMessageTypehelper correctly classifies all known message types for logging and observability. The IBC and IBC2 messages are properly distinguished, and the "unknown" fallback provides safe error reporting.tests/upgrade/sdktypes.go (1)
1-56: LGTM!The test helper types are well-structured and properly documented. The comment at line 10-11 clearly explains why these types exist (avoiding import of different Cosmos SDK versions during upgrade testing), which is helpful for maintainability.
app/types/app.go (2)
492-509: LGTM!The IBC routing setup properly integrates wasm into both v1 and v2 IBC routing layers. The wasm IBC handler is correctly wired with the required keepers, and the v2 router uses prefix-based routing for wasm ports as expected.
470-490: No action required—empty VMConfig is appropriate.The empty
wasmtypes.VMConfig{}at line 485 is correct. VMConfig defines WasmLimits and Cache options for the wasmvm library, which has fields that are optional pointer types with nil defaults that allow the Rust VM to provide effective defaults at runtime. The critical DoS protection settings are properly configured at the app level viawasmConfig(MemoryCacheSize, SmartQueryGasLimit, ContractDebugMode), while VM-specific limits appropriately defer to wasmvm's internal defaults through the empty VMConfig struct.tests/upgrade/upgrade_test.go (10)
641-651: LGTM! Helper types for account query response.These types correctly structure the JSON response from the
query auth module-accountcommand.
683-693: LGTM! Gov module account authority retrieval.This correctly queries the governance module account to extract the authority address, which is required for the new
MsgSoftwareUpgradeproposal format in the v2 governance module.
719-722: LGTM! Vote period parsing updated for duration format.The change from integer parsing to
time.ParseDurationcorrectly handles the new governance parameter format where voting periods are represented as duration strings (e.g., "172800s") rather than integers.
735-740: LGTM! Upgrade height calculation.The upgrade height is correctly calculated by converting the voting period to an estimated block count (assuming 6-second blocks) and adding a 10-block buffer to ensure the upgrade occurs after voting completes.
742-755: LGTM! Upgrade proposal structure updated for v2 governance.The proposal correctly uses the new
MsgSoftwareUpgradeformat with theAuthorityfield set to the governance module account address, aligning with Cosmos SDK v0.47+ governance changes.
767-776: LGTM! Proposal file writing.Writing the proposal to a file before submission is a clean approach. The file permissions (0644) are appropriate for a temporary JSON file.
783-789: LGTM! Proposal submission command.The submission correctly uses the file-based approach with
tx gov submit-proposal <propFile>, which is cleaner than inline JSON for complex proposals.
816-825: LGTM! Proposal lookup by title.The backward iteration (starting from the most recent proposal) combined with title matching is appropriate for this test scenario, ensuring the correct upgrade proposal is identified even if multiple proposals exist.
349-355: LGTM! Cache directory initialization.Using the first validator's home directory as the cache location for test artifacts (like the proposal JSON file) is a reasonable approach for the upgrade test.
234-234: LGTM! Sources directory flag handling.The new
sourcesdirflag is properly validated, normalized (trailing slash removed), and propagated to post-upgrade test parameters, following the same pattern as the existingworkdirflag.Also applies to: 271-271, 287-287, 398-398
x/wasm/module.go (3)
1-36: LGTM! Standard module structure.The module correctly implements the required Cosmos SDK interfaces (
AppModuleBasic,AppModule,HasGenesisBasics,HasConsensusVersion,HasGenesis,HasServices, andAppModuleSimulation) following the standard pattern for Cosmos SDK modules.
127-157: LGTM! Module lifecycle implementation.The service registration, genesis handling, and lifecycle hooks are correctly implemented. The no-op
BeginBlock/EndBlockare appropriate for the wasm module, which doesn't require per-block processing.
166-174: LGTM! Simulation support wired correctly.The genesis state generation and proposal messages are properly delegated to the simulation package, providing the necessary support for the SDK's simulation framework.
Makefile (1)
31-47: BUILD_OPTIONS and DB_BACKEND selection logic looks solidThe combination of:
- Defaulting
BUILD_OPTIONStostatic-linkon non-Darwin, and- Deriving
DB_BACKENDfromBUILD_OPTIONSviafindstringforcleveldb,rocksdb, andgoleveldbis straightforward and behaves as expected even when multiple options are present (e.g.,
static-link cleveldb cgotrace). No issues here.
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
x/escrow/module.go (1)
86-92: Correct module name in GRPC gateway panic message
RegisterGRPCGatewayRoutesis documented for the escrow module, but the panic still mentions “provider grpc routes”. Updating the string will make logs less confusing:- panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register escrow grpc routes: %s", err.Error()))x/audit/module.go (1)
86-92: Fix module name in RegisterGRPCGatewayRoutes panicThe function is documented for the audit module, but the panic still mentions “provider grpc routes”. Updating the message will make any panic clearer:
- panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register audit grpc routes: %s", err.Error()))
♻️ Duplicate comments (9)
script/upgrades.sh (1)
548-551: Unresolved: File existence check still missing.The past review flagged that
"$valdir/validator.json"should be validated to exist before being passed to the create-validator command at line 551. This concern remains unaddressed. Ifinit()failed or was skipped, the file won't exist and the command will fail with an unclear error.Add a guard clause before the version check:
valjson=$(cat "$valdir/validator.json") + # Validate that validator.json exists before using it + if [[ ! -f "$valdir/validator.json" ]]; then + echo >&2 "Error: $valdir/validator.json not found. Ensure init() has been called." + exit 1 + fi if [[ $cnt -gt 0 ]]; thentests/upgrade/workers_test.go (1)
128-136: Redundant account unpacking still present.Despite the past review comment being marked as addressed in commit 8efe0de, the redundant unpacking remains in the code. After unpacking and type-asserting at lines 128-132,
maccalready contains the correct module account. The secondUnpackAnycall at lines 134-135 is unnecessary.Apply this diff to remove the redundant unpacking:
var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()tests/upgrade/upgrade_test.go (3)
695-704: Commented-out code still present.Despite the past review comment being marked as addressed in commit b647a27, the commented-out timer/select block remains in the code. This dead code should be removed to keep the codebase clean.
Apply this diff:
- //tm := time.NewTimer(30 * time.Second) - //select { - //case <-l.ctx.Done(): - // if !tm.Stop() { - // <-tm.C - // } - // err = l.ctx.Err() - // return err - //case <-tm.C: - //} - cmdRes, err = l.cmdr.execute(l.ctx, "query gov params")
791-792: Comment/timeout mismatch still present.Despite the past review comment being marked as addressed in commit 2fdeb4e, the mismatch remains. The comment says "two blocks" but the timeout is 18 seconds (approximately 3 blocks at 6s/block). Also note the typo "commited" should be "committed".
Apply this diff to fix both issues:
- // give it two blocks to make sure a proposal has been commited + // give it three blocks to make sure a proposal has been committed tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second)Or if two blocks is the intent:
- // give it two blocks to make sure a proposal has been commited - tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second) + // give it two blocks to make sure a proposal has been committed + tmctx, cancel := context.WithTimeout(l.ctx, 12*time.Second)
757-765: Unsafe array indexing without bounds check.Accessing
params.DepositParams.MinDeposit[0]assumes the array has at least one element, which could cause a panic if the governance parameters are misconfigured or empty. Additionally, this ignores any multi-denom deposits.Apply this diff to handle the empty case and use the full coins value:
+ depositCoins := params.DepositParams.MinDeposit + if depositCoins.Empty() { + return fmt.Errorf("min deposit parameter is empty") + } + prop := &ProposalMsg{ Messages: []json.RawMessage{ jup, }, - Deposit: params.DepositParams.MinDeposit[0].String(), + Deposit: depositCoins.String(), Title: l.upgradeName, Summary: l.upgradeName, Expedited: false, }x/wasm/keeper/msg_filter.go (1)
126-133: Consider default‑deny for unknown/future CosmosMsg variants.The final
return nilmeans any future CosmosMsg fields added by wasmvm (beyond Bank/Staking/Distribution/Gov/IBC/IBC2/Custom/Any/Wasm) will automatically be allowed in Phase 1, potentially bypassing policy until the filter is updated. You may want a fail‑secure default that rejects unrecognized message shapes so new variants require an explicit review before being enabled.x/wasm/module.go (1)
92-100: Note on panicking GetQueryCmd/GetTxCmd.Given prior discussion that these panics are intentional, just a heads‑up that any SDK CLI wiring that blindly calls module GetQueryCmd/GetTxCmd will crash the
akashCLI. As long as your root command construction never invokes these for wasm, this is acceptable but a sharp edge to keep in mind.Makefile (1)
56-80: EnsureGORELEASER_LDFLAGStracks the finalldflagsvalue.
GORELEASER_LDFLAGS := $(ldflags)is set before you append-linkmode,-extldflags,-s -w, and any custom$(LDFLAGS). Goreleaser builds will therefore miss those pieces and diverge frommake build, and externalLDFLAGSwon’t propagate into release artifacts.To keep goreleaser in sync with the final
ldflags, either move the assignment after all mutations or make it recursive:-ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ +ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ -X github.com/cosmos/cosmos-sdk/version.AppName=akash \ -X github.com/cosmos/cosmos-sdk/version.BuildTags="$(build_tags_cs)" \ -X github.com/cosmos/cosmos-sdk/version.Version=$(shell git describe --tags | sed 's/^v//') \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_HEAD_COMMIT_LONG) \ -X github.com/cosmos/cosmos-sdk/types.DBBackend=$(DB_BACKEND) - -GORELEASER_LDFLAGS := $(ldflags) - -ldflags += -linkmode=external +ldflags += -linkmode=external @@ ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) -GORELEASER_TAGS := $(BUILD_TAGS) -GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)' +GORELEASER_LDFLAGS = $(ldflags) +GORELEASER_TAGS := $(BUILD_TAGS) +GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)'make/releasing.mk (1)
36-52: Addwasmvm-libsas a prerequisite forakash_docgenand possiblyinstall.
build,$(AKASH),test-bins,docker-image, andreleaseall correctly depend onwasmvm-libs, butakash_docgen(andinstall) do not. Ifdocgenor the installedakashbinary link against wasmvm (as previously verified), a clean checkout will fail at link time becauselibwasmvmhas not been produced.Consider aligning these targets with the others:
-.PHONY: akash_docgen -akash_docgen: $(AKASH_DEVCACHE) - $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgen +.PHONY: akash_docgen +akash_docgen: $(AKASH_DEVCACHE) wasmvm-libs + $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgen + +.PHONY: install -install: +install: wasmvm-libs @echo installing akash $(GO) install $(BUILD_FLAGS) ./cmd/akashTo re‑confirm the dependency, you can reuse a variant of the earlier check:
#!/bin/bash # Verify whether docgen still depends on wasm/wasmvm go list -f '{{join .Deps "\n"}}' ./docgen | grep -E '(cosmwasm|wasmvm|/x/wasm)' && \ echo "⚠ docgen has wasm dependencies" || echo "✓ No wasm dependencies detected for docgen"
🧹 Nitpick comments (16)
script/upgrades.sh (1)
548-564: Optimize: Move valjson read into else branch to avoid unnecessary I/O.The
valjsonvariable is read unconditionally at line 548 but only used in the old code path (lines 555–560). For Akash versions ≥ v1.0.0-rc0, this read is wasted. Defer the read to only when needed.valjson=$(cat "$valdir/validator.json") if [[ $cnt -gt 0 ]]; then if [[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]]; then $AKASH tx staking create-validator "$valdir/validator.json" --home="$rvaldir" --from="validator$cnt" --yes else + valjson=$(cat "$valdir/validator.json") $AKASH tx staking create-validator \ --home="$rvaldir" \ --moniker="$(jq -rc '.moniker' <<<"$valjson")" \app/sim_test.go (1)
150-184: Consider consolidating appB setup for consistency.The test uses
setupSimulationAppfor appA (line 150) but inline setup for appB (lines 171-183). While functional, this duplication makes maintenance harder since setup parameter changes require updates in multiple locations.Consider either:
- Extending
setupSimulationAppto accept optional parameters for custom db names/directories- Extracting a smaller helper for the common app construction logic
The current approach works correctly (appB gets isolated storage via
t.TempDir()at line 182), so this is a maintainability suggestion rather than a functional issue.x/wasm/alias.go (1)
7-11: Minor wording nit in StoreKey commentThe aliasing to
types.StoreKey/types.ModuleNamelooks good. Consider tweaking the StoreKey comment for readability:- // StoreKey represents storekey of wasm module + // StoreKey represents the store key of the wasm modulex/wasm/simulation/proposals.go (1)
32-41: Use govtypes.ModuleName instead of hard-coded "gov"The simulator always builds the authority as
address.Module("gov"). To avoid relying on the literal string and match common Cosmos patterns, consider deriving it from the gov module constant:import ( "math/rand" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk.Msg { // use the default gov module account address as authority - var authority sdk.AccAddress = address.Module("gov") + authority := address.Module(govtypes.ModuleName)If you later want richer simulations, you could also randomize fields in
paramsinstead of always usingDefaultParams().Please confirm that the Cosmos SDK version used here still exposes
govtypes.ModuleNamewith the expected semantics before applying this change.x/market/module.go (1)
197-201: Fix copy/paste references to “take module” in commentsThese comments still mention the “take module”, which is confusing in the market module. Consider updating them to:
-// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for market module's types. @@ -// WeightedOperations doesn't return any take module operation. +// WeightedOperations doesn't return any market module operation.x/escrow/module.go (1)
109-131: Clean up stale audit/provider/take references in escrow commentsSeveral comments still reference other modules, e.g.:
AppModuledescribed as “for the audit module”.Namedocumented as returning the “provider module name”.ExportGenesisand simulation helpers mentioning “audit” or “take” modules.Consider updating these to consistently refer to the escrow module, for example:
-// AppModule implements an application module for the audit module. +// AppModule implements an application module for the escrow module. @@ -// Name returns the provider module name +// Name returns the escrow module name @@ -// ExportGenesis returns the exported genesis state as raw bytes for the audit -// module. +// ExportGenesis returns the exported genesis state as raw bytes for the escrow +// module. @@ -// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for escrow module's types. -// WeightedOperations doesn't return any take module operation. +// WeightedOperations doesn't return any escrow module operation.Also applies to: 178-183, 192-197
x/audit/module.go (2)
94-100: Align RegisterGRPCRoutes comment with audit moduleThe doc comment on
RegisterGRPCRoutesstill says “provider module” even though this is the audit module. Consider updating it to:-// RegisterGRPCRoutes registers the gRPC Gateway routes for the provider module. +// RegisterGRPCRoutes registers the gRPC Gateway routes for the audit module.
131-135: Clean up remaining provider/take references in audit commentsA few comments still reference other modules, for example:
Namedocumented as returning the “provider module name”.RegisterStoreDecoder/WeightedOperationscomments mentioning the “take module”.For clarity, consider updating them to refer to the audit module, e.g.:
-// Name returns the provider module name +// Name returns the audit module name @@ -// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for audit module's types. -// WeightedOperations doesn't return any take module operation. +// WeightedOperations doesn't return any audit module operation.Also applies to: 195-201
x/wasm/genesis.go (1)
20-21: Fix module name in genesis comments.Both DefaultGenesisState and ExportGenesis comments still say “deployment module”; update them to “wasm module” to avoid confusion when navigating genesis code.
Also applies to: 44-45
app/app.go (1)
138-146: Correct typo in wasm options panic message.The panic string says
aptOpts.Get("wasm"); it should beappOpts.Get("wasm")to match the actual source and avoid confusion when this triggers.x/take/module.go (1)
109-112: Fix stale copy‑paste comments in take module.
- Line 109: comment should say “take module name” instead of “provider module name”.
- Line 166: “GenState of the staking module” should likely be “GenState of the take module”.
These don’t affect behavior but tightening them improves maintainability.
Also applies to: 166-168
app/types/app.go (1)
563-582: Use the wasm store‑key constant consistently.kvStoreKeys registers the wasm KV store under
wasmtypes.ModuleName, but the keeper is initialized withapp.keys[wasmtypes.StoreKey]. Today these are the same string in wasmd, but relying on that equality could become brittle if the library ever differentiates ModuleName vs StoreKey. Prefer usingwasmtypes.StoreKeyin both places for clarity and future‑proofing.Please double‑check your wasmd version to confirm ModuleName == StoreKey and that StoreKey is the intended KV store key constant in the upstream types.
Also applies to: 470-473
x/wasm/module.go (1)
110-113: Clean up copy‑paste comments in wasm module.A few doc comments are out of sync with this package:
- Line 110: “provider module name” should be “wasm module name”.
- Line 166: GenerateGenesisState refers to “staking module”.
- Lines 176/179: mention “take module” instead of wasm.
Aligning these with the wasm module will make the file easier to navigate.
Also applies to: 166-168, 176-180
_run/common-commands.mk (1)
1-27: Parameterise multisig signer names instead of hard‑coding.
KEY_NAMEandMULTISIG_SIGNERScentralise key naming, butmultisig-sendstill hard‑codes--from "main"and--from "other". Wiring those through the variables would make changes to signer names less error‑prone.- $(AKASH) tx sign \ + $(AKASH) tx sign \ "$(AKASH_HOME)/multisig-tx.json" \ --multisig "$(shell $(AKASH) $(KEY_OPTS) keys show "$(MULTISIG_KEY)" -a)" \ - --from "main" \ + --from "$(word 1,$(MULTISIG_SIGNERS))" \ @@ - $(AKASH) tx sign \ + $(AKASH) tx sign \ "$(AKASH_HOME)/multisig-tx.json" \ --multisig "$(shell $(AKASH) $(KEY_OPTS) keys show "$(MULTISIG_KEY)" -a)" \ - --from "other" \ + --from "$(word 2,$(MULTISIG_SIGNERS))" \_run/common.mk (2)
31-45: Tidy up unused deposit variable and reuse helpers consistently.
CHAIN_ACCOUNT_DEPOSITis computed but never used, whilenode-init-genesis-account-%hard‑codesCHAIN_MIN_DEPOSIT. Either dropCHAIN_ACCOUNT_DEPOSITor use it for account funding to reflect the intended 10× margin.Similarly,
client-init-key-%calls$(AKASH) keys addwithout$(KEY_OPTS), whereas later key lookups do use$(KEY_OPTS). For consistency and to keep keyring‑backend wiring in one place, consider:-CHAIN_ACCOUNT_DEPOSIT := $(shell echo $$(($(CHAIN_MIN_DEPOSIT) * 10))) +CHAIN_ACCOUNT_DEPOSIT := $(shell echo $$(($(CHAIN_MIN_DEPOSIT) * 10))) @@ client-init-key-%: - $(AKASH) keys add "$(@:client-init-key-%=%)" + $(AKASH) $(KEY_OPTS) keys add "$(@:client-init-key-%=%)" @@ node-init-genesis-account-%: $(AKASH) genesis add-account \ "$(shell $(AKASH) $(KEY_OPTS) keys show "$(@:node-init-genesis-account-%=%)" -a)" \ - "$(CHAIN_MIN_DEPOSIT)$(CHAIN_TOKEN_DENOM)" + "$(CHAIN_ACCOUNT_DEPOSIT)$(CHAIN_TOKEN_DENOM)"Also applies to: 67-77, 106-115
116-119: Avoid hard‑coding denom and gas price innode-init-gentx.
node-init-gentxuses a literal0.025uaktwhileAKASH_GAS_PRICESandCHAIN_TOKEN_DENOMare already exported/configurable. This makes denom or gas‑price changes harder and can drift from the rest of the run config.node-init-gentx: - $(AKASH) genesis gentx validator "$(CHAIN_VALIDATOR_DELEGATE)$(CHAIN_TOKEN_DENOM)" --min-self-delegation=1 --gas=auto --gas-prices=0.025uakt + $(AKASH) genesis gentx validator \ + "$(CHAIN_VALIDATOR_DELEGATE)$(CHAIN_TOKEN_DENOM)" \ + --min-self-delegation=1 \ + --gas=auto \ + --gas-prices="$(AKASH_GAS_PRICES)"
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (39)
.github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)app/app.go(9 hunks)app/sim_test.go(9 hunks)app/types/app.go(8 hunks)app/upgrades.go(2 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/sims/simulation_helpers.go(3 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)wasmvm.go(1 hunks)x/audit/module.go(5 hunks)x/cert/module.go(5 hunks)x/escrow/module.go(5 hunks)x/market/module.go(2 hunks)x/provider/module.go(3 hunks)x/take/module.go(6 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
✅ Files skipped from review due to trivial changes (1)
- wasmvm.go
🚧 Files skipped from review as they are similar to previous changes (13)
- make/test-upgrade.mk
- .github/actions/setup-ubuntu/action.yaml
- make/setup-cache.mk
- app/upgrades.go
- x/cert/module.go
- tests/upgrade/types/types.go
- testutil/sims/simulation_helpers.go
- .github/workflows/tests.yaml
- upgrades/software/v2.0.0/upgrade.go
- make/init.mk
- make/test-integration.mk
- tests/upgrade/test-cases.json
- tests/upgrade/test-config.json
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
Makefile_run/common-commands.mk_run/common.mkmake/releasing.mk
📚 Learning: 2025-11-14T01:24:04.219Z
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
Applied to files:
x/wasm/keeper/msg_filter.gogo.mod
🧬 Code graph analysis (9)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
app/sim_test.go (4)
app/app.go (3)
AppName(83-83)NewApp(110-293)AkashApp(97-107)testutil/sims/simulation_helpers.go (3)
CheckExportSimulation(87-112)PrintStats(115-119)SetupSimulation(26-49)x/wasm/alias.go (1)
StoreKey(9-9)app/config.go (1)
ModuleBasics(72-74)
x/take/module.go (1)
x/audit/module.go (10)
AppModuleBasic(39-41)AppModuleBasic(44-46)AppModuleBasic(49-51)AppModuleBasic(59-61)AppModuleBasic(64-79)AppModuleBasic(87-92)AppModuleBasic(95-100)AppModuleBasic(103-105)AppModuleBasic(108-110)AppModuleBasic(113-115)
x/escrow/module.go (2)
x/audit/module.go (8)
AppModuleBasic(39-41)AppModuleBasic(44-46)AppModuleBasic(49-51)AppModuleBasic(59-61)AppModuleBasic(64-79)AppModuleBasic(87-92)AppModuleBasic(95-100)AppModuleBasic(103-105)x/provider/module.go (8)
AppModuleBasic(43-45)AppModuleBasic(58-60)AppModuleBasic(63-65)AppModuleBasic(73-75)AppModuleBasic(78-85)AppModuleBasic(88-93)AppModuleBasic(96-98)AppModuleBasic(101-103)
app/types/app.go (1)
x/wasm/alias.go (2)
StoreKey(9-9)ModuleName(11-11)
x/audit/module.go (2)
x/cert/module.go (9)
AppModuleBasic(39-41)AppModuleBasic(50-52)AppModuleBasic(55-57)AppModuleBasic(65-67)AppModuleBasic(70-83)AppModuleBasic(86-91)AppModuleBasic(94-96)AppModuleBasic(99-101)AppModuleBasic(104-106)x/provider/module.go (7)
AppModuleBasic(43-45)AppModuleBasic(58-60)AppModuleBasic(63-65)AppModuleBasic(73-75)AppModuleBasic(78-85)AppModuleBasic(88-93)AppModuleBasic(96-98)
x/wasm/genesis.go (1)
x/wasm/alias.go (1)
ModuleName(11-11)
tests/upgrade/workers_test.go (1)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)
x/wasm/module.go (3)
x/wasm/alias.go (1)
ModuleName(11-11)x/wasm/genesis.go (4)
DefaultGenesisState(22-34)ValidateGenesis(16-18)InitGenesis(37-42)ExportGenesis(45-50)x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
⏰ 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). (7)
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: build-macos
- GitHub Check: tests
- GitHub Check: build-bins
🔇 Additional comments (26)
meta.json (1)
48-52: LGTM!The v2.0.0 upgrade entry is properly structured and consistent with previous upgrade entries in the file.
tests/upgrade/sdktypes.go (1)
1-56: LGTM!The SDK types are well-structured for upgrade simulation testing. The comment clearly explains the rationale for defining custom types rather than importing SDK-generated types.
tests/upgrade/upgrade_test.go (1)
641-651: LGTM!The new account types (
baseAccount,moduleAccount,accountResp) are well-structured for parsing JSON responses from the governance module account query.go.mod (5)
17-18: CosmWasm dependencies are correctly specified and compatible.The wasmd v0.61 release is compatible with Cosmos SDK v0.53, and wasmvm/v3 v3.0.2 is the latest stable release in that line. However, note important context: per the retrieved learnings, wasmvm v3 removed the Stargate field from CosmosMsg compared to earlier versions. If your wasm message filter or handler code references
CosmosMsg.Stargate, verify it has been updated accordingly to use the supported field types (Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, IBC2).If x/wasm/keeper code contains message filtering logic, verify it doesn't reference removed Stargate capabilities.
21-22: SDK versions are consistent and stable.Cosmos SDK v0.53.4 is fully API and state-compatible with all v0.53.x releases, providing a stable foundation for the CosmWasm integration.
64-64: Cosmos-sdk fork version verified.The new tag
v0.53.4-akash.10exists in the akash-network/cosmos-sdk fork and points to a valid commit.
1-1: Module path v2 migration is complete and verified.Verification confirms all imports throughout the codebase have been correctly updated to
pkg.akt.dev/node/v2. No references to the old module path remain in the Go files.
81-100: Transitive dependencies are correctly resolved and in sync.Verification confirms go.mod and go.sum are consistent after
go mod tidy. The indirect dependency updates reflect the addition of wasmd v0.61.6 and its dependency tree as expected.app/sim_test.go (6)
8-18: LGTM! Import additions are appropriate.The new imports support wasm integration (
wasmtypes), improved error diagnostics (runtime/debug,strings), context initialization (cmtproto), and flag handling (cflags). All are used appropriately throughout the file.
55-57: LGTM! Module path promotion to v2.The import path updates from v1 to v2 are consistent with the PR's objective to promote the module path to
pkg.akt.dev/node/v2.
186-200: Verify graceful skip on empty validator set is intended behavior.The InitChainer flow correctly uses
AppStateBytesfor import/export testing (lines 189-193). However, the error handling for empty validator sets (lines 194-200) causes the test to pass via early return rather than fail.While this might be expected in simulation testing where validator unbonding can legitimately occur, confirm this graceful skip is intentional rather than masking potential issues with the export/import flow.
The diagnostics (lines 196-197) are helpful, but consider whether certain scenarios should fail the test instead.
182-182: LGTM! Excellent test isolation with t.TempDir().Using
t.TempDir()for each app instance ensures:
- Automatic cleanup after test completion
- Prevention of conflicts between test runs or app instances
- Proper test isolation
This is a best practice improvement for test reliability.
Also applies to: 403-403, 445-445, 491-491
526-552: LGTM! Well-structured helper consolidates simulation setup.The
setupSimulationApphelper successfully consolidates common setup logic:
- Clear signature returning all necessary components
- Uses
t.Cleanup()for automatic resource management (lines 540-543)- Correctly uses
sim.Flag*values (line 534, 547) per the addressed past comments- Proper assertion of
akash.AppName(line 550)The helper improves test maintainability by centralizing configuration and app instantiation patterns.
356-363: Wasm store prefix exclusion is correct and complete.TXCounterPrefix is a transaction-counter namespace key (0x08) used for transient/runtime state that differs between app instances. The exclusion follows the established pattern of other stores (e.g., upgradetypes excludes transient version markers). Code and Contract prefixes represent persistent data and are correctly not excluded, ensuring they are compared between stores as intended.
x/provider/module.go (1)
23-26: v2 imports and provider doc comments look consistentThe updated v2 import paths and the small comment tweaks around
DefaultGenesisandEndBlockkeep this module aligned with the rest of the v2 migration without changing behavior.Also applies to: 72-75, 145-148
x/market/module.go (1)
24-28: v2 audit/escrow/market imports and EndBlock doc are consistentThe move to
pkg.akt.dev/node/v2imports and the EndBlock comment update keep this module aligned with the rest of the v2 migration without altering behavior.Also applies to: 159-163
x/escrow/module.go (1)
23-26: Escrow AppModuleBasic wiring and v2 imports look correctThe new v2 imports (
rest,handler,keeper) and the AppModuleBasic methods (Name,RegisterLegacyAminoCodec,DefaultGenesis,RegisterRESTRoutes,GetQueryClient) match the patterns used in other modules and keep escrow wiring consistent.Also applies to: 40-63, 81-84, 104-107
x/audit/module.go (1)
38-61: Audit AppModuleBasic genesis wiring looks solidThe AppModuleBasic comments,
DefaultGenesis, andValidateGenesisimplementation mirror the patterns in other modules (e.g., cert/provider), correctly handling optional genesis (bz == nil) and delegating toValidateGenesis.Also applies to: 63-79
app/app.go (2)
160-172: Wasm config + keeper init wiring looks coherent.Reading wasm node config, overriding cache/query/debug fields, and threading
(wasmDir, wasmConfig, wasmOpts)into InitNormalKeepers is internally consistent and matches the new keeper signature.Also applies to: 182-192
295-327: Begin/End blocker ordering for awasm/wasm is reasonable.Placing the Akash wasm module (
awasm.ModuleName) before the upstream wasm module (wasmtypes.ModuleName) and keeping wasm after IBC/transfer fits the documented intent and shouldn’t cause ordering regressions.Also applies to: 330-360
app/types/app.go (1)
451-491: Wasm keeper + Akash filter + IBC routing look correctly wired.
- Akash’s
Wasmkeeper is created with its own store key and gov authority.- Message filter decorator from
app.Keepers.Akash.Wasm.NewMsgFilterDecorator()is appended intowOpts, so all wasm messages go through the Phase 1 filter.- wasmCapabilities extend the built‑ins with
"akash", and wasmkeeper.NewKeeper wiring (account/bank/staking, distr querier, IBC channel(s), transfer, msg/grpc routers, wasmDir/config, VMConfig, capabilities, authority, options) is coherent.- IBC router v1/v2 both register wasm handlers alongside transfer and are set on the IBC keeper.
Overall this keeper + router wiring looks solid.
Also applies to: 492-509
x/wasm/keeper/msg_filter.go (1)
32-61: Phase 1 filter + messenger decorator look correct and cover all wasmvm v3 variants.DispatchMsg wraps the messenger cleanly, emitting EventMsgBlocked and logging on rejection. FilterMessage + filterBankMessage correctly:
- Restrict Bank sends to non‑blocked addresses and forbid burns.
- Block Staking, Distribution, Gov, IBC, IBC2, Custom, and Any.
- Allow only Wasm (contract‑to‑contract) messages.
getMessageType aligns with wasmvm v3’s CosmosMsg fields (Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, IBC2) and avoids any obsolete Stargate handling, matching the current wasmvm layout.
Based on learningsAlso applies to: 64-133, 135-165, 167-205
_run/common-commands.mk (1)
29-47: Node‑ready probe loop and CLI invocation look correct.The bash loop now correctly uses
$$counter/$$max_retry, and$(CHAIN_OPTS)is no longer quoted as a single argument in the broadcast call. The readiness check and exit paths are sound.Makefile (1)
29-47: DB backend and static‑link defaults are consistent.Defaulting
BUILD_OPTIONStostatic-linkon non‑Darwin and derivingDB_BACKENDfromBUILD_OPTIONS(with goleveldb as a sane default) gives predictable builds and clear override semantics..goreleaser.yaml (1)
19-28: Goreleaser build and docker configs align with the new build flow.Using
BUILD_LDFLAGSplus explicit-s -w,-linkmode=external, and architecture‑specific-extldflagsfor wasmvm, and wiringBUILD_TAGS/static_wasmconsistently into the flags, keeps goreleaser outputs in step with the Makefile’s build semantics. The switch to_build/akash.Dockerfilefor both amd64 and arm64 images also looks correct.Also applies to: 39-48, 64-86, 124-157
make/releasing.mk (1)
64-85: Goreleaser docker/test/release invocations are wired correctly.
test-bins,docker-image, andreleasenow all depend onwasmvm-libsand exportMOD,STABLE,BUILD_TAGS,BUILD_LDFLAGS, andGOWORKinto the goreleaser container, matching the new Makefile variables. OnceGORELEASER_LDFLAGStracks the finalldflags(see Makefile comment), these flows should produce binaries consistent with local builds.Also applies to: 87-107, 115-137
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
x/cert/module.go (3)
85-91: Fix inconsistent error message.The comment was updated to reference the "cert module" but the error message on line 89 still says "provider grpc routes" instead of "cert grpc routes".
Apply this diff to fix the error message:
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { - panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register cert grpc routes: %s", err.Error())) } }
116-119: Fix inconsistent comment.The comment for
AppModuleBasic.Name()on line 49 was updated to reference "cert module" but this comment still says "provider module name".Apply this diff to fix the comment:
-// Name returns the provider module name +// Name returns the cert module name func (AppModule) Name() string { return types.ModuleName }
152-158: Fix inconsistent comment.The comment references "audit module" but this is the cert module's
ExportGenesismethod.Apply this diff to fix the comment:
-// ExportGenesis returns the exported genesis state as raw bytes for the audit -// module. +// ExportGenesis returns the exported genesis state as raw bytes for the cert +// module. func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { gs := ExportGenesis(ctx, am.keeper) return cdc.MustMarshalJSON(gs) }x/audit/module.go (2)
86-92: Fix copy-paste error in panic message.The panic message on line 90 says "provider grpc routes" but should say "audit grpc routes" since this is the audit module.
Apply this diff:
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { - panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register audit grpc routes: %s", err.Error())) } }
94-100: Fix copy-paste error in comment.The comment on line 94 says "provider module" but should say "audit module" to match the actual context of this file.
Apply this diff:
-// RegisterGRPCRoutes registers the gRPC Gateway routes for the provider module. +// RegisterGRPCRoutes registers the gRPC Gateway routes for the audit module. func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { panic(fmt.Sprintf("couldn't register audit grpc routes: %s", err.Error())) } }
♻️ Duplicate comments (6)
tests/upgrade/upgrade_test.go (3)
695-704: Remove commented-out code.This commented-out timer/sleep block should be removed to keep the codebase clean, as previously noted in past reviews.
Apply this diff:
- //tm := time.NewTimer(30 * time.Second) - //select { - //case <-l.ctx.Done(): - // if !tm.Stop() { - // <-tm.C - // } - // err = l.ctx.Err() - // return err - //case <-tm.C: - //} - cmdRes, err = l.cmdr.execute(l.ctx, "query gov params")
742-765: Handle multi-denom governance deposits correctly.The code uses
params.DepositParams.MinDeposit[0].String()at line 761, which assumes the deposit array has at least one entry and ignores additional denoms. If the chain config supplies more than one coin or none, this will either panic or submit an insufficient deposit.Apply this diff:
+ depositCoins := params.DepositParams.MinDeposit + if depositCoins.Empty() { + return fmt.Errorf("min deposit parameter is empty") + } + prop := &ProposalMsg{ Messages: []json.RawMessage{ jup, }, - Deposit: params.DepositParams.MinDeposit[0].String(), + Deposit: depositCoins.String(), Title: l.upgradeName, Summary: l.upgradeName, Expedited: false, }
791-792: Fix misleading comment about block timeout.The comment says "give it two blocks" but the timeout is 18 seconds, which equals 3 blocks at 6-second block time. Also contains typo "commited" → "committed".
Apply this diff:
- // give it two blocks to make sure a proposal has been commited + // give it three blocks to make sure a proposal has been committed tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second)Or if two blocks is intended:
- // give it two blocks to make sure a proposal has been commited - tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second) + // give it two blocks to make sure a proposal has been committed + tmctx, cancel := context.WithTimeout(l.ctx, 12*time.Second)tests/upgrade/workers_test.go (1)
128-136: Remove redundant account unpacking.The account is unpacked twice: first into
sdk.AccountIwith type assertion tomacc(lines 128-132), then redundantly unpacked again (lines 134-136). After the type assertion at line 132,maccalready contains the correct module account.Apply this diff:
var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()make/releasing.mk (1)
51-52: Add wasmvm-libs prerequisite to akash_docgen target.Verification confirms that
akash_docgenhas wasm dependencies (github.com/CosmWasm/wasmvm/v3and related packages), yet it's the only build target in this makefile that lacks thewasmvm-libsprerequisite. All other wasm-dependent targets (build,$(AKASH),test-bins,docker-image,release) include this dependency..PHONY: akash_docgen -akash_docgen: $(AKASH_DEVCACHE) +akash_docgen: $(AKASH_DEVCACHE) wasmvm-libs $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgenapp/app.go (1)
138-146: Tighten wasm options extraction and fix panic string typoThe
wasmoptions extraction looks structurally fine—appOpts.Get("wasm")is type‑asserted to[]wasmkeeper.Optionand safely appended intowasmOpts. However, the panic message still refers toaptOpts.Get("wasm"), which is misleading given the actual variable name isappOpts.Recommend updating the format string to use
appOptsfor clarity and to stay consistent with the surrounding code, e.g.:- panic(fmt.Sprintf("invalid type for aptOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(val).String())) + panic(fmt.Sprintf("invalid type for appOpts.Get(\"wasm\"). expected %s, actual %s", reflect.TypeOf(wasmOpts).String(), reflect.TypeOf(val).String()))This keeps the runtime diagnostics accurate now that the earlier
vlscoping issue is resolved.
🧹 Nitpick comments (17)
x/take/module.go (4)
37-40:AppModuleBasic.cdcappears unused; consider simplifying if not needed
AppModuleBasicstores acdc codec.Codec, andNewAppModuleinitializes it, but this field isn’t referenced anywhere in this file. If it isn’t used elsewhere in thetakepackage, it’s just noise and can be removed to simplify the module struct.For example:
-type AppModuleBasic struct { - cdc codec.Codec -} +type AppModuleBasic struct{}and
- return AppModule{ - AppModuleBasic: AppModuleBasic{cdc: cdc}, - keeper: k, - } + return AppModule{ + AppModuleBasic: AppModuleBasic{}, + keeper: k, + }If there are references to
AppModuleBasic.cdcin other files underx/take, keep it, but consider adding a brief comment to clarify its purpose.Also applies to: 101-106
84-89: Improve panic message inRegisterGRPCGatewayRoutesfor diagnosticsRight now failures here produce a bare
panic(err), which makes logs less searchable and doesn’t indicate which module failed. Consider including the module name in the panic for easier debugging, similar to the pattern inx/audit/module.go:-func (AppModuleBasic) RegisterGRPCGatewayRoutes(cctx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(cctx)); err != nil { - panic(err) - } -} +func (AppModuleBasic) RegisterGRPCGatewayRoutes(cctx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(cctx)); err != nil { + panic(fmt.Sprintf("couldn't register take grpc routes: %s", err)) + } +}
91-99: Confirm returningnilCLI commands is intentional
GetQueryCmdandGetTxCmdboth returnnil, which is fine if the take module intentionally exposes no CLI surface. Just double‑check that there isn’t an expectation elsewhere (docs, operators) to have tx/query commands for this module; if there is, these should be wired instead of returningnil.
109-112: Fix stale “provider” wording inNamedoc-commentThe comment says “provider module name” while this is the
takemodule. To avoid confusion in GoDoc and when scanning the code, it should match the module:-// Name returns the provider module name +// Name returns the take module nameupgrades/software/v2.0.0/upgrade.go (3)
84-84: Return nil explicitly for clarity.At this point in the code,
erris guaranteed to benilbecause any non-nil error fromSetParams(line 79) would have already caused an early return at line 81. Returningnilexplicitly improves code clarity.Apply this diff:
- return toVM, err + return toVM, nil
72-74: Use predefined constant for code upload access.The
wasmtypes.AllowNobodyconstant is already used elsewhere in the codebase and should be used here instead of manually constructing theAccessConfigstruct. This improves readability and consistency.- params.CodeUploadAccess = wasmtypes.AccessConfig{ - Permission: wasmtypes.AccessTypeNobody, - } + params.CodeUploadAccess = wasmtypes.AllowNobody
5-18: Context handling is correct for Cosmos SDK v0.53.4; original review concern does not apply.Cosmos SDK v0.53.4 keeper methods accept
context.Contextnatively. The current code correctly passescontext.Contextdirectly toRunMigrations()(line 53),GetParams()(line 58), andSetParams()(line 69) without unwrapping. The past review's concern about needingsdk.UnwrapSDKContextis not applicable to this SDK version.Minor optional improvements:
- Lines 65-67: Use
wasmtypes.AllowNobodyconstant instead of manually constructingAccessConfig{Permission: wasmtypes.AccessTypeNobody}- Line 80: The returned
erris guaranteed nil at this point; consider returningnildirectly for claritymake/setup-cache.mk (1)
62-64: Consider adding error handling for partial downloads.The current implementation relies on verification to catch corrupted files, which works but can lead to confusing error messages. If
wgetis interrupted and leaves a partial file, the nextmakerun will skip the download (file exists) and fail later at verification with a checksum mismatch.Adding explicit error handling improves the user experience:
$(AKASH_DEVCACHE_LIB)/%: - wget -q --show-progress https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/$* -O $@ + wget -q --show-progress https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/$* -O $@ || (rm -f $@ && false) @rm -f $(AKASH_DEVCACHE_LIB)/.wasmvm_verifiedThis ensures failed downloads are cleaned up and retried, giving clearer error messages on network failures rather than cryptic checksum errors later.
app/upgrades.go (1)
8-11: Upgrade wiring looks good; consider fixing the error message typo.The switch to
pkg.akt.dev/node/v2/upgradesand theCommitMultiStorenil-guard both look correct and makeregisterUpgradeHandlersmore robust. The only nit is the error message at Line 37:"unable to unitialize upgrade"has a typo.Consider correcting it to
"unable to initialize upgrade"for clearer logging:- return fmt.Errorf("unable to unitialize upgrade `%s`: %w", name, err) + return fmt.Errorf("unable to initialize upgrade `%s`: %w", name, err)Also applies to: 23-29, 35-38
_run/common-commands.mk (1)
1-27: Multisig flow is fine; consider deriving signer names fromMULTISIG_SIGNERS.The
multisig-sendtarget works for the default setup, but--from "main"/--from "other"are effectively duplicated configuration forMULTISIG_SIGNERS := main other. If you expect people to tweak signers, you could derive the signer names from$(MULTISIG_SIGNERS)instead of hard-coding them, so the multisig key creation and signing stay in sync.Not urgent, just a maintainability tweak.
x/wasm/module.go (1)
38-47: Clean up remaining copy‑paste doc comments to say “wasm module”.A few comments still refer to other modules and could be updated for clarity:
- Line 110:
// Name returns the provider module name→ should say “wasm module name”.- Line 166:
// GenerateGenesisState creates a randomized GenState of the staking module.→ this is wasm’s genesis state.- Line 176:
// RegisterStoreDecoder registers a decoder for take module's types.→ should reference the wasm module.- Line 179:
// WeightedOperations doesn't return any take module operation.→ same.Behavior is fine; this is just documentation hygiene so future readers aren’t confused about which module is being described.
Also applies to: 110-113, 166-169, 176-181
.goreleaser.yaml (2)
25-28: Confirm BUILD_LDFLAGS wiring matches final ldflags used by Makefile buildsHere you rely on
{{ .Env.BUILD_LDFLAGS }}as the base for all platforms and then append-s -w,-linkmode=external, and platform‐specific-extldflags. In the Makefile, however, onlyGORELEASER_LDFLAGS := $(ldflags)is visible; there’s no direct definition ofBUILD_LDFLAGS, andGORELEASER_LDFLAGSis set before laterldflagsmutations (linkmode/extldflags/nostrip/custom$(LDFLAGS)).Please double‑check that:
- CI or
make releaseactually exportBUILD_LDFLAGS(not justGORELEASER_LDFLAGS), and- The value bound to
BUILD_LDFLAGSreflects the finalldflagsstring you expect (including version/commit/DBBackend and any custom$(LDFLAGS)).If not, you may want to derive
BUILD_LDFLAGSfrom the fully assembledldflagsto keep goreleaser and localmakebuilds in sync.Also applies to: 45-48, 64-68, 83-86
123-157: Verify renamed Dockerfile path_build/akash.Dockerfileis wired everywhereBoth docker entries now point at
_build/akash.Dockerfileinstead of the previous_build/Dockerfile.akash. That’s fine, but any leftover references (Makefile targets, CI workflows, local scripts) to the old name would break image builds.Please check that:
_build/akash.Dockerfileactually exists and is the canonical Dockerfile, and- There are no remaining references to
_build/Dockerfile.akashin the repo or CI configs.If you’d like, I can suggest a small
fd/rgscript to scan for stale paths.app/app.go (1)
160-173: Wasm config wiring looks correct; consider whether hard‑coded limits should be configurable
wasmDirandwasmConfigare initialized once inNewAppand threaded intoInitNormalKeepers, which is the right place to wire CosmWasm in. OverridingMemoryCacheSize,SmartQueryGasLimit, andContractDebugModedirectly on the config is also a reasonable pattern for node‑level defaults.The only design point to consider is whether the hard‑coded values:
MemoryCacheSize = 100(commented as “100 MB max”),SmartQueryGasLimit = 3_000_000, andContractDebugMode = falseshould eventually be surfaced via app options / config files (especially for testnets and local testing), rather than being fixed literals in
NewApp. Not a blocker, but worth keeping in mind as more networks start tuning wasm performance and debugging settings.Also applies to: 182-192
Makefile (1)
31-37: Align Makefile ldflags and goreleaser BUILD_LDFLAGS usageThis block nicely centralizes build options (static-link default on non‑Darwin, DB backend selection, base ldflags with Name/AppName/BuildTags/Version/Commit/DBBackend, and nostrip/trimpath). One thing to double‑check is how this interacts with goreleaser:
GORELEASER_LDFLAGS := $(ldflags)is set beforeldflagsis extended with-linkmode=external,-extldflags ...,-s -w, and any custom$(LDFLAGS)..goreleaser.yamluses{{ .Env.BUILD_LDFLAGS }}rather thanGORELEASER_LDFLAGSdirectly.To avoid divergence between
makebuilds and goreleaser builds:
- Ensure
BUILD_LDFLAGS(the env seen by goreleaser) is derived from the finalldflagshere (for example by assigning it after theldflags := $(strip $(ldflags))line, or by makingGORELEASER_LDFLAGSrecursive and mapping it to BUILD_LDFLAGS inmake/releasing.mk), and- Confirm that any static linking behavior you expect in release artifacts (especially for Linux
static-linkbuilds) is either encoded inBUILD_LDFLAGSor explicitly in.goreleaser.yaml(as you’ve started doing for wasmvm muslc).This is mostly about keeping the build story predictable across local and release builds.
Also applies to: 41-47, 53-55, 56-63, 65-71, 75-77, 82-86
app/sim_test.go (2)
149-203: Import/export simulation flow and wasm store comparison look correctThe refactor to use
setupSimulationAppplus an InitChainer-based import/export path inTestAppImportExportis a solid improvement:
setupSimulationAppbuilds asim.Config, encoding config, DB, andAppOptionsMap(includingcflags.FlagHomeandcflags.FlagInvCheckPeriod), then constructs the app withakash.NewApp.TestAppImportExportruns a full simulation onappA, exports state and validators, then initializesappBwith a fresh DB and home (viat.TempDir) and callsInitChainerwithexported.AppState. Consensus params are applied viaStoreConsensusParams.- The special‐case handling for
"validator set is empty after InitGenesis"avoids failing the test when simulation unbonds all validators, while logging a stack trace for debugging.- The store comparison list now includes
wasmtypes.StoreKeyscoping towasmtypes.TXCounterPrefix, which is appropriate for validating wasm state without over‑comparing internal counters.Two minor notes:
- The string match on the error message is a bit brittle; if the upstream message ever changes, the test will stop skipping and start failing. If the SDK exposes a sentinel error or well-known error type for this condition in the future, it’d be worth switching to that.
- Reusing
appOptsbetweenappAandappBis fine given you resetcflags.FlagHomebefore constructingappB, but keeping the “new app” options in a fresh map would make the data flow slightly clearer.Neither point is blocking; the overall logic and wasm coverage look good.
Also applies to: 356-383, 526-551
106-147: Home directory handling in tests is mostly robust; consider standardizing oncflags.FlagHomeThe updated tests now consistently give each simulation run its own home directory via
t.TempDir()(e.g., inTestAppSimulationAfterImportandTestAppStateDeterminism), which is important to avoid cross-test interference in wasm and DB state.There’s a small inconsistency in how the home key is set:
- In
TestFullAppSimulationandTestAppSimulationAfterImport, you useappOpts.Set("home", ...).- In
setupSimulationAppandTestAppImportExport, you useappOpts[cflags.FlagHome] = ....Assuming
cflags.FlagHomeresolves to"home", both are equivalent today, but standardizing on the constant everywhere (including the viper-backed tests) would make this more future-proof if the flag name ever changes.Not a correctness issue, just a minor cleanup opportunity.
Also applies to: 386-410, 491-499
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (39)
.github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser.yaml(6 hunks)Makefile(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)app/app.go(9 hunks)app/sim_test.go(9 hunks)app/types/app.go(8 hunks)app/upgrades.go(2 hunks)go.mod(12 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/sdktypes.go(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/sims/simulation_helpers.go(3 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)wasmvm.go(1 hunks)x/audit/module.go(5 hunks)x/cert/module.go(5 hunks)x/escrow/module.go(5 hunks)x/market/module.go(2 hunks)x/provider/module.go(3 hunks)x/take/module.go(6 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (1)
- tests/upgrade/config-v0.24.0.tmpl.json
✅ Files skipped from review due to trivial changes (2)
- wasmvm.go
- meta.json
🚧 Files skipped from review as they are similar to previous changes (15)
- .github/actions/setup-ubuntu/action.yaml
- testutil/sims/simulation_helpers.go
- x/provider/module.go
- x/escrow/module.go
- x/wasm/genesis.go
- make/test-upgrade.mk
- tests/upgrade/types/types.go
- x/wasm/simulation/proposals.go
- script/upgrades.sh
- x/market/module.go
- make/test-integration.mk
- make/init.mk
- tests/upgrade/test-config.json
- .github/workflows/tests.yaml
- x/wasm/alias.go
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
📚 Learning: 2025-11-14T01:24:04.219Z
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
Applied to files:
go.modx/wasm/keeper/msg_filter.go
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
Makefilemake/setup-cache.mk_run/common-commands.mkmake/releasing.mk_run/common.mk
🧬 Code graph analysis (10)
upgrades/software/v2.0.0/upgrade.go (3)
app/types/app.go (1)
App(131-142)upgrades/types/types.go (1)
IUpgrade(32-37)x/wasm/alias.go (1)
StoreKey(9-9)
tests/upgrade/upgrade_test.go (1)
tests/upgrade/sdktypes.go (2)
SoftwareUpgradeProposal(42-46)ProposalMsg(48-56)
x/audit/module.go (2)
x/cert/module.go (9)
AppModuleBasic(39-41)AppModuleBasic(50-52)AppModuleBasic(55-57)AppModuleBasic(65-67)AppModuleBasic(70-83)AppModuleBasic(86-91)AppModuleBasic(94-96)AppModuleBasic(99-101)AppModuleBasic(104-106)x/provider/module.go (7)
AppModuleBasic(43-45)AppModuleBasic(58-60)AppModuleBasic(63-65)AppModuleBasic(73-75)AppModuleBasic(78-85)AppModuleBasic(88-93)AppModuleBasic(96-98)
app/types/app.go (1)
x/wasm/alias.go (2)
StoreKey(9-9)ModuleName(11-11)
x/cert/module.go (2)
x/cert/alias.go (2)
Keeper(18-18)ModuleName(13-13)x/cert/keeper/keeper.go (1)
Keeper(12-22)
app/sim_test.go (4)
app/app.go (3)
AppName(83-83)NewApp(110-293)AkashApp(97-107)testutil/sims/simulation_helpers.go (2)
CheckExportSimulation(87-112)SetupSimulation(26-49)x/wasm/alias.go (1)
StoreKey(9-9)app/config.go (1)
ModuleBasics(72-74)
app/app.go (1)
x/wasm/alias.go (1)
ModuleName(11-11)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
x/take/module.go (2)
x/audit/module.go (10)
AppModuleBasic(39-41)AppModuleBasic(44-46)AppModuleBasic(49-51)AppModuleBasic(59-61)AppModuleBasic(64-79)AppModuleBasic(87-92)AppModuleBasic(95-100)AppModuleBasic(103-105)AppModuleBasic(108-110)AppModuleBasic(113-115)x/take/alias.go (1)
ModuleName(11-11)
x/wasm/module.go (2)
x/wasm/genesis.go (4)
DefaultGenesisState(22-34)ValidateGenesis(16-18)InitGenesis(37-42)ExportGenesis(45-50)x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
⏰ 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). (7)
- GitHub Check: network-upgrade
- GitHub Check: lint-go
- GitHub Check: tests
- GitHub Check: coverage
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: build-bins
🔇 Additional comments (31)
x/cert/module.go (2)
21-23: LGTM!The import path updates to
pkg.akt.dev/node/v2/x/cert/...are consistent with the v2 module migration objective.
38-67: LGTM!The doc comments have been correctly updated to reference the cert module consistently.
Also applies to: 138-142
x/audit/module.go (3)
22-23: LGTM! Import paths correctly updated for v2 migration.The import paths have been updated to reference the v2 module namespace, which aligns with the broader v2 migration in this PR.
38-41: LGTM! Comments properly updated to reference the audit module.The documentation strings have been correctly updated to reference the audit module context consistently throughout the file.
Also applies to: 43-46, 48-51, 58-61, 168-172
63-79: LGTM! ValidateGenesis implementation is correct.The new genesis validation method properly handles the nil case, unmarshals the genesis data, and delegates to the package-level ValidateGenesis function. The implementation follows the expected pattern for the module.HasGenesisBasics interface.
x/take/module.go (2)
20-22: v2 import migration for take module looks correctUpdating handler, keeper, and simulation imports to
pkg.akt.dev/node/v2/x/take/...is consistent with the repo-wide v2 path migration and keeps this module aligned with the new layout.
137-141: EndBlock comment and implementation are consistent with no-op behaviorThe updated comment correctly reflects that
EndBlockis a no-op and returns no validator updates, matching the implementation that just returnsnil. No issues here.tests/upgrade/upgrade_test.go (7)
210-210: LGTM: cacheDir initialization from first validator.The
cacheDirfield is properly initialized from the first validator's home directory and correctly wired through to theupgradeTeststruct. This provides a consistent location for caching upgrade artifacts.Also applies to: 349-355, 515-515
234-234: LGTM: SourceDir parameter properly integrated.The
sourcesdirflag is properly validated, normalized, and passed topostUpgradeParams.SourceDir, enabling post-upgrade tests to access source files like test WASM contracts.Also applies to: 271-271, 287-287, 398-398
641-651: LGTM: Gov module account query for authority.The new account structs and gov module account query correctly retrieve the governance module's address to use as the authority in the upgrade proposal, aligning with Cosmos SDK governance requirements.
Also applies to: 683-693
719-722: LGTM: Vote period parsing.Correctly parses the voting period as a duration for use in upgrade height calculation.
735-740: LGTM: Upgrade height calculation.The upgrade height is correctly calculated from the current block height plus an offset derived from the voting period, ensuring the upgrade occurs after governance voting completes.
772-776: LGTM: Proposal file creation.The proposal is correctly marshaled to JSON and written to a file in the cache directory for submission.
817-819: LGTM: Proposal lookup by title.The proposal lookup correctly searches for the most recent proposal matching the upgrade name.
tests/upgrade/workers_test.go (6)
34-37: LGTM: v2.0.0 upgrade registration.The post-upgrade worker is correctly registered for the v2.0.0 upgrade with an updated struct definition.
42-86: LGTM: Client setup with proper encoding config.The encoding configuration, keyring, and client are properly initialized. The explicit nil check on the client at line 86 is good defensive programming.
88-98: LGTM: WASM file loading and compression.The WASM file is correctly loaded from the source directory and gzipped if needed, with proper validation using
ioutils.IsWasmandioutils.IsGzip.
100-114: LGTM: Direct WASM deployment failure test.The test correctly verifies that direct WASM contract deployment fails with
ErrUnauthorized, establishing the baseline security posture before testing the governance path.
115-123: LGTM: Governance proposal failure test.The test correctly verifies that a governance proposal with an incorrect sender (user address instead of gov module) fails, validating the authorization checks.
138-146: LGTM: Governance proposal success test.After setting the sender to the gov module account address, the governance proposal correctly succeeds, validating the complete governance-based WASM deployment flow with gas simulation.
tests/upgrade/test-cases.json (1)
2-9: LGTM: v2.0.0 test case with WASM modules.The v2.0.0 test case entry correctly declares the addition of the
wasmandawasmmodules, aligning with the PR's goal of enabling smart contracts on Akash.tests/upgrade/sdktypes.go (1)
1-56: LGTM: SDK type definitions for upgrade testing.This file provides well-structured type definitions for simulating upgrade behavior without importing potentially conflicting Cosmos SDK generated types. All structs have appropriate JSON tags and the comment at lines 10-11 clearly explains the rationale for defining these types locally.
make/setup-cache.mk (1)
70-80: Checksum verification implementation looks solid.The verification flow correctly:
- Downloads checksums from the official release
- Verifies all libraries against published checksums using
sha256sum -c- Uses a marker file (
.wasmvm_verified) to track verification status- Invalidates verification when libraries or checksums are re-downloaded
- Prevents parallel downloads with
.NOTPARALLELThis addresses the security concerns from the earlier review and ensures library integrity.
make/releasing.mk (2)
40-45: Build targets correctly depend on wasmvm-libs.The
buildand$(AKASH)targets now properly depend onwasmvm-libs, ensuring the native wasmvm library is available before linking. This addresses the linker errors on clean checkouts mentioned in previous reviews.
64-70: Consistent wasmvm-libs integration across build pipeline.The
test-bins,docker-image, andreleasetargets all correctly includewasmvm-libsas a prerequisite. The environment variable refactoring (BUILD_TAGS→GORELEASER_TAGS, consolidated ldflags) maintains consistency across all goreleaser invocations.Also applies to: 87-93, 115-121
_run/common-commands.mk (1)
29-47:akash-node-readyloop looks solid after variable escaping fixes.The readiness probe now correctly uses
$$counter/$$max_retryand unquoted$(CHAIN_OPTS)was already addressed in this file’s sibling PR. The loop behavior (15 retries, 1s sleep, success onlatest_block_height >= 1, failure otherwise) is reasonable for local usage; no functional issues from this snippet.go.mod (1)
1-2: v2 module path and dependency wiring look consistent.The move to
module pkg.akt.dev/node/v2together with the CosmWasm, Cosmos SDK, and IBC-Go versions and thegithub.com/cosmos/cosmos-sdk => github.com/akash-network/cosmos-sdk v0.53.4-akash.10replace align with the rest of the v2 wiring in this PR. I don’t see structural issues ingo.moditself.Please double-check locally that
go mod tidyhas been run and that a full build/test pass against these versions is green, since I can’t execute the Go toolchain here.Also applies to: 17-18, 22-25, 34-41, 64-65
x/wasm/keeper/msg_filter.go (1)
16-61: Phase‑1 wasm message filter is correctly default‑deny and observability-friendly.The
FilterMessengerwrapper +FilterMessage/filterBankMessagecombo looks solid:
- Only Bank (via
filterBankMessage) and Wasm messages are allowed; Staking, Distribution, Gov, IBC, IBC2, Custom, Any, and unknown variants are all explicitly rejected withErrUnauthorized, which gives you a proper default‑deny posture even if wasmvm adds new variants later.- Bank filtering correctly blocks transfers to configured
BlockedAddressesand denies burns while allowing regular sends, matching the genesis defaults fromx/wasm/genesis.go.- On block, you both emit a typed
EventMsgBlockedand log withgetMessageType(msg), which should make debugging and monitoring straightforward.I don’t see functional issues in this file; the behavior matches the stated Phase‑1 restrictions.
Also applies to: 63-137, 139-169, 171-208
app/types/app.go (1)
17-20: Wasm keeper wiring, IBC routing, and store keys look consistent with the new module.The new wasm integration in
InitNormalKeepersandAppKeepersis well put together:
- Cosmos and Akash keepers now expose
Wasmfields, withAkash.Wasmused to inject theNewMsgFilterDecorator()into the CosmWasm keeper options viaWithMessageHandlerDecorator, cleanly composing your Phase‑1 filter.- The
wasmkeeper.NewKeepercall wires in the expected dependencies (account/bank/staking, distribution querier, IBC channel keepers + v2, transfer keeper, msg/grpc routers, wasmDir/NodeConfig/VMConfig, builtin capabilities +"akash", authority) in the correct order for wasmd v0.61.x.- IBC routing is extended appropriately:
- v1 router adds a wasm IBC handler alongside transfer.
- v2 router adds transfer v2 and the wasm IBC2 handler under
PortIDPrefixV2.kvStoreKeys()now includeswasmtypes.ModuleName(after ibc transfer), andakashKVStoreKeys()includesawasm.StoreKey, matching the aliases defined inx/wasm/alias.go.I don’t see functional problems in this wiring from the snippet; it reads as consistent and complete.
Also applies to: 54-55, 63-74, 94-113, 115-124, 244-252, 451-491, 492-509, 563-587, 589-600
_run/common.mk (1)
1-143: Init/genesis pipeline and helper targets look coherent for local runs.The new
_run/common.mknicely orchestrates a local Akash network:
initchains through client key setup andnode-init, withAKASH_HOME/ run dirs created up front.node-initis serialized via.NOTPARALLELand sequences genesis creation, account funding, cert publishing, gentx, and finalization in a predictable way.- The jq-based genesis rewrite (voting period + all denom fields) plus backup of the original genesis is clean and easy to reason about.
- Runtime helpers (
node-run,node-status,rest-server-run,rosetta-run) are straightforward and consistent with the exported AKASH_* env vars.From this snippet, I don’t see functional issues; looks good as a reusable local env scaffold.
app/app.go (1)
323-327: Begin/EndBlocker ordering for awasm/wasmtypes is consistent with the commentsAdding:
awasm.ModuleNamebeforewasmtypes.ModuleName, and- placing both after
transfertypes.ModuleName(and other IBC modules)in both
orderBeginBlockersandOrderEndBlockersmatches the intent in the comments (“akash wasm module must be prior wasm”, “wasm after ibc transfer”). This should keep awasm’s hooks ahead of the generic wasm module while ensuring wasm runs after IBC transfer logic.No changes needed here.
Also applies to: 356-359
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/app.go(8 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.219Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
🧬 Code graph analysis (1)
app/app.go (1)
x/wasm/alias.go (1)
ModuleName(11-11)
⏰ 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). (16)
- GitHub Check: network-upgrade
- GitHub Check: sims
- GitHub Check: network-upgrade-names
- GitHub Check: lint-go
- GitHub Check: tests
- GitHub Check: release-dry-run
- GitHub Check: coverage
- GitHub Check: build-macos
- GitHub Check: build-bins
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: tests
- GitHub Check: build-macos
- GitHub Check: build-bins
🔇 Additional comments (5)
app/app.go (5)
28-30: LGTM! Standard CosmWasm imports.The wasm integration imports are correct and necessary for enabling smart contract support.
157-169: LGTM! Secure wasm configuration with appropriate defaults.The wasm configuration properly handles errors and sets secure production defaults with clear comments explaining the security rationale (DoS prevention, expensive query prevention, production debug mode).
184-186: LGTM! Wasm parameters correctly passed to InitNormalKeepers.The wasm directory, configuration, and options are properly passed to the keeper initialization.
228-231: LGTM! Proper error handling for service registration.The error from
RegisterServicesis now properly captured and handled with a panic, preventing the app from starting in an invalid state.
320-323: LGTM! Module ordering correctly implements wasm processing requirements.The begin and end blocker ordering properly sequences awasm before wasm, and wasm after IBC transfer, as documented in the comments. This ensures correct processing order for smart contract operations.
Also applies to: 353-356
|
Marked as stale; will be closed in five days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 17
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
x/take/module.go (1)
109-109: Fix inconsistent comment referencing "provider module".The comment incorrectly references "provider module" when it should reference "take module", creating inconsistency with other comments in the file (lines 37, 48, 53, 63, 84, 137).
Apply this diff to fix the comment:
-// Name returns the provider module name +// Name returns the take module namex/audit/keeper/key.go (1)
13-44: Import path migration looks fine; minor panic message formatting bugThe switch to
pkg.akt.dev/node/v2/util/validationis consistent with the v2 module migration and is non‑functional.While you’re here, the panic message in
ParseIDFromKeyhas two small issues:
expectedvsactualare swapped in the format args.types.PrefixProviderID()is a[]byteprinted with%s, whilekey[:1]only shows the first byte (and also as%s).A more accurate/consistent version would be:
- if !bytes.HasPrefix(key, types.PrefixProviderID()) { - panic(fmt.Sprintf("invalid key prefix. expected 0x%s, actual 0x%s", hex.EncodeToString(key[:1]), types.PrefixProviderID())) - } + if !bytes.HasPrefix(key, types.PrefixProviderID()) { + prefix := types.PrefixProviderID() + panic(fmt.Sprintf( + "invalid key prefix. expected 0x%s, actual 0x%s", + hex.EncodeToString(prefix), + hex.EncodeToString(key[:len(prefix)]), + )) + }This keeps behavior the same (still panics) while making the error easier to read/debug.
x/provider/handler/handler.go (1)
32-34: Fix the copy-paste error in the error message.The error message incorrectly refers to "bank message type" instead of "provider message type".
Apply this diff:
default: - return nil, sdkerrors.ErrUnknownRequest.Wrapf("unrecognized bank message type: %T", msg) + return nil, sdkerrors.ErrUnknownRequest.Wrapf("unrecognized provider message type: %T", msg) }x/provider/module.go (1)
183-184: Fix the copy-paste error in the comment.The comment incorrectly refers to "take module's types" instead of "provider module's types".
Apply this diff:
-// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for provider module's types. func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {}x/escrow/module.go (1)
86-92: Fix inconsistent error message in RegisterGRPCGatewayRoutes.The error message references "provider grpc routes" but this is the escrow module. This appears to be a copy-paste artifact from the provider module.
Apply this diff:
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := v1.RegisterQueryHandlerClient(context.Background(), mux, v1.NewQueryClient(clientCtx)) if err != nil { - panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register escrow grpc routes: %s", err.Error())) } }app/modules.go (1)
228-254: Duplicate authzmodule.NewAppModule in appSimModules.The
authzmodule.NewAppModuleis instantiated twice (lines 228-234 and 248-254). This duplication could cause issues during simulation initialization.Remove the duplicate entry:
bank.NewAppModule( app.cdc, app.Keepers.Cosmos.Bank, app.Keepers.Cosmos.Acct, app.GetSubspace(banktypes.ModuleName), ), feegrantmodule.NewAppModule( app.cdc, app.Keepers.Cosmos.Acct, app.Keepers.Cosmos.Bank, app.Keepers.Cosmos.FeeGrant, app.interfaceRegistry, ), - authzmodule.NewAppModule( - app.cdc, - app.Keepers.Cosmos.Authz, - app.Keepers.Cosmos.Acct, - app.Keepers.Cosmos.Bank, - app.interfaceRegistry, - ), gov.NewAppModule(
♻️ Duplicate comments (3)
make/test-integration.mk (1)
21-23: Missingwasmvm-libsprerequisite ontest-integration.All other test targets (
test,test-nocache,test-full,test-coverage,test-vet) depend onwasmvm-libs, buttest-integrationdoes not. This inconsistency could cause integration test failures when wasm libraries aren't available..PHONY: test-integration -test-integration: +test-integration: wasmvm-libs $(GO_TEST) -v -tags="e2e.integration" -ldflags '$(ldflags)' $(TEST_MODULES)tests/upgrade/workers_test.go (1)
127-135: Remove redundant account unpacking.The account is unpacked twice: first into
sdk.AccountIwith type assertion tosdk.ModuleAccountI(lines 127-131), then immediately unpacked again intomacc(lines 133-134). After the first unpacking and type assertion,maccalready contains the correct module account.var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()make/releasing.mk (1)
51-52: Inconsistency: akash_docgen missing wasmvm-libs prerequisite.Past review comment indicated that
akash_docgenshould depend onwasmvm-libs(marked as addressed in commit dd65357), yet line 51 still only lists$(AKASH_DEVCACHE)as a prerequisite. All other build targets in this file ($(AKASH)at line 44,buildat line 40,test-binsat line 64,docker-imageat line 87, andreleaseat line 115) now explicitly depend onwasmvm-libs. If docgen imports wasm-dependent code (as previously verified), it will fail at link time.Apply this diff to restore consistency:
-.PHONY: akash_docgen -akash_docgen: $(AKASH_DEVCACHE) +.PHONY: akash_docgen +akash_docgen: $(AKASH_DEVCACHE) wasmvm-libs $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgen
🧹 Nitpick comments (22)
contracts/price-oracle/Cargo.toml (1)
1-41: CosmWasm contract manifest looks well-configured overall.The manifest properly configures a production-ready CosmWasm contract with appropriate optimization settings for WASM and well-scoped dependencies. A few minor items to consider:
- Line 25 (commented-out backtraces): Remove the commented code unless it serves as documentation for maintainers.
- Version 1.0.0 (line 3): For a newly-integrated smart contract, confirm this is intentional. Most CosmWasm contracts start at 0.1.0 during initial development/beta phases and increment to 1.0.0 only after production hardening and audit.
- Dependency versions: Verify that cosmwasm-schema and cosmwasm-std v3.0.2 are the intended stable versions. If this PR targets a specific Akash release cycle, confirm alignment with the broader codebase dependency strategy.
Apply this diff to remove the commented-out feature:
[features] default = [] -#backtraces = ["cosmwasm-std/backtraces"] library = []x/market/client/rest/params.go (1)
3-12: v2 import path update is fine; consider cleaning up or documenting this commented-out helperThe switch of
dresttopkg.akt.dev/node/v2/x/deployment/client/restaligns with the v2 module layout and is safe here, especially since the entire block is commented out. If this file is intentionally obsolete, consider deleting it to avoid confusion; if you plan to re-enable these helpers later, a brief comment (e.g.,// legacy v1 REST helpers kept for referenceor a TODO about reintroducing v2 equivalents) would clarify its status.x/cert/alias.go (1)
3-24: Alias now correctly re‑exports the v2 cert keeper under the cert packageUpdating the keeper import to
pkg.akt.dev/node/v2/x/cert/keeperwhile keeping:type ( Keeper = keeper.Keeper ) var ( NewKeeper = keeper.NewKeeper )means external code that depends on
cert.Keeper/cert.NewKeeperwill transparently start using the v2 keeper without any call‑site changes, which is exactly what you want for this module‑path migration.Optional nit: the comments still mention “provider module” even though this is the
certmodule; if you’re touching this file anyway, consider updating those doc comments for clarity.contracts/price-oracle/src/bin/schema.rs (1)
4-10: Consider addingMigrateMsgto the schema.The contract defines a
migrateentry point withMigrateMsg, but the schema generation omits it. This may result in incomplete API documentation for contract migrations.use cosmwasm_schema::write_api; -use akt_pyth_oracle::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use akt_pyth_oracle::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; fn main() { write_api! { instantiate: InstantiateMsg, execute: ExecuteMsg, query: QueryMsg, + migrate: MigrateMsg, } }contracts/price-oracle/src/msg.rs (3)
4-13: InstantiateMsg shape is solid; consider avoiding empty-string sentinel forprice_feed_idThe field choices and types make sense for instantiate, and using
Uint256for a fee in uakt is compatible with CosmWasm 3.x. One improvement to consider (while the contract API is still new) is replacing the “empty string means use chain params” convention with something typed, e.g.:pub struct InstantiateMsg { pub admin: String, pub update_fee: Uint256, pub price_feed_id: Option<String>, // None => use chain oracle params }This removes a string sentinel and makes downstream logic more explicit. If you keep the current API, maybe tighten the doc comment to spell out that
""is the only accepted “unset” value.
30-78: Query schema and response types are consistent; a couple of minor clarity nitsThe
QueryMsg+#[returns(...)]annotations and the response structs are well-structured and align with typical CosmWasm patterns. A few optional polish ideas:
PriceFeedResponse’ssymbolfield is the only one without a doc comment; adding one (e.g., “human-readable pair likeAKT/USD”) would help schema consumers.- Since
update_feeis documented as “in uakt”, you might either (a) reflect that in the field name (update_fee_uakt) or (b) mention the unit in theConfigResponsefield comment as well, so clients don’t need to cross-readInstantiateMsg’s docs.These are non-blocking; the current schema is already usable.
80-81: Empty MigrateMsg is fine; consider a brief doc commentHaving an explicit, empty
MigrateMsgis a good forward-compatibility hook. To make intent obvious to future maintainers, you might add a short comment like:/// Currently no migration options; reserved for future upgrades. pub struct MigrateMsg {}Not required, but it can prevent people from wondering whether this was left incomplete.
_run/node/Makefile (1)
1-5: Emptyclean-nodetarget may be confusing to callersRight now
clean-nodeis declared.PHONYbut does nothing. If that’s intentional as a placeholder, consider adding a brief comment; otherwise, you might want to delegate to shared clean logic or add node‑specific cleanup steps so callers ofmake clean-nodeget a meaningful effect.For example:
.PHONY: clean-node clean-node: $(MAKE) clean(or similar, depending on how
../common-commands.mkstructures clean targets).x/wasm/handler/server.go (1)
20-21: Fix the doc comment: this is the wasm module, not staking.The doc comment incorrectly references "akash staking MsgServer interface". This should reference the wasm module.
-// NewMsgServerImpl returns an implementation of the akash staking MsgServer interface +// NewMsgServerImpl returns an implementation of the wasm MsgServer interface // for the provided Keeper.x/oracle/handler/server.go (1)
20-21: Fix the doc comment: this is the oracle module, not staking.The doc comment incorrectly references "akash staking MsgServer interface". This should reference the oracle module.
-// NewMsgServerImpl returns an implementation of the akash staking MsgServer interface +// NewMsgServerImpl returns an implementation of the oracle MsgServer interface // for the provided Keeper.upgrades/software/v2.0.0/upgrade.go (1)
70-76: Redundant struct initialization forCodeUploadAccess.Lines 74-76 create an
AccessConfigstruct with justPermission: wasmtypes.AccessTypeNobody. This can be simplified using the predefinedwasmtypes.AllowNobodyconstant.params := up.Keepers.Cosmos.Wasm.GetParams(ctx) // Configure code upload access - RESTRICTED TO GOVERNANCE ONLY // Only governance proposals can upload contract code // This provides maximum security for mainnet deployment - params.CodeUploadAccess = wasmtypes.AccessConfig{ - Permission: wasmtypes.AccessTypeNobody, - } + params.CodeUploadAccess = wasmtypes.AllowNobodyx/oracle/keeper/keeper.go (4)
36-37: Fix doc comment: this is the oracle keeper, not take keeper.The comment references "take keeper" but this is the oracle module.
-// NewKeeper creates and returns an instance of take keeper +// NewKeeper creates and returns an instance of oracle keeper func NewKeeper(cdc codec.BinaryCodec, skey storetypes.StoreKey, authority string) Keeper {
58-61: Fix doc comment: this is the oracle module, not mint.-// GetAuthority returns the x/mint module's authority. +// GetAuthority returns the x/oracle module's authority. func (k *keeper) GetAuthority() string {
63-79: Fix doc comments: these reference x/take instead of x/oracle.Lines 63 and 81 reference "x/take module parameters" but should reference "x/oracle".
-// SetParams sets the x/take module parameters. +// SetParams sets the x/oracle module parameters. func (k *keeper) SetParams(ctx sdk.Context, p types.Params) error {-// GetParams returns the current x/take module parameters. +// GetParams returns the current x/oracle module parameters. func (k *keeper) GetParams(ctx sdk.Context) (p types.Params) {
13-21: Keeper interface missingAddOnSetParamsHookmethod.The
AddOnSetParamsHookmethod is implemented on the concretekeepertype (line 94) but not declared in theKeeperinterface. This means callers using the interface cannot add hooks. If this is intentional (hooks only set during initialization), consider documenting this. Otherwise, add it to the interface.If hooks should be accessible via the interface:
type Keeper interface { StoreKey() storetypes.StoreKey Codec() codec.BinaryCodec GetParams(ctx sdk.Context) (params types.Params) SetParams(ctx sdk.Context, params types.Params) error NewQuerier() Querier GetAuthority() string + AddOnSetParamsHook(SetParamsHook) Keeper }x/oracle/genesis.go (1)
10-39: Genesis helpers look fine; a couple of minor polish nitsThe genesis wiring (validate → params, default params, init/export via keeper) is in line with typical Cosmos module patterns and looks correct. Two optional cleanups:
- Line 15/33: comments still say "deployment module" — consider updating to "oracle module" to avoid confusion when skimming.
- Lines 26–30: if
SetParamscan fail in multiple ways, wrapping the panic with a bit more context (e.g. module name / operation) can make future debugging easier.upgrades/software/v2.0.0/init.go (1)
1-3: Fix the nolint directive format.The nolint directive on line 2 should use a colon separator for the linter name.
Apply this diff:
// Package v2_0_0 -// nolint revive +//nolint:revive package v2_0_0x/escrow/module.go (1)
216-240: Remove commented-out dead code.This block contains commented-out simulation methods that clutter the codebase. If these are needed in the future, they can be retrieved from version control history.
x/oracle/simulation/proposals.go (1)
14-19: Consider usinggovtypes.ModuleNameinstead of hard‑coded"gov".The simulation wiring and default‑params usage look correct. To make the authority construction more robust against future renames, you might prefer:
+ govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ - var authority sdk.AccAddress = address.Module("gov") + var authority sdk.AccAddress = address.Module(govtypes.ModuleName)Purely a readability/maintainability win; behavior is unchanged.
Also applies to: 21-42
app/app.go (1)
28-31: Wasm config and keeper initialization are wired correctly; type mismatch onappOpts["wasm"]is silently ignored.Reading
wasmDir,wasmConfigviawasm.ReadNodeConfig, and passing(wasmDir, wasmConfig, wasmOpts)intoInitNormalKeepersmatches the expected wasmd integration, and the cache/query/debug settings are sane defaults for production. One thing to be aware of: ifappOpts.Get("wasm")is present but not a[]wasmkeeper.Option, it’s currently ignored without any log, which can make misconfiguration harder to diagnose. If that becomes an operational issue, consider logging a warning in theelsebranch of the type assertion.Also applies to: 64-75, 137-143, 158-171, 172-190, 228-232
x/wasm/simulation/proposals.go (1)
14-19: Align authority construction with gov module constant for clarity.This simulation helper is fine functionally, but as with the oracle module it would be a bit clearer/safer to use the gov module constant instead of the raw string:
+ govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ - var authority sdk.AccAddress = address.Module("gov") + var authority sdk.AccAddress = address.Module(govtypes.ModuleName)This keeps things consistent with the rest of the codebase and avoids stringly‑typed module names.
Also applies to: 21-42
Makefile (1)
24-26: Redundant variable definitions.Several variables are defined twice:
GOMODis defined at line 24 and again at line 35BUILD_TAGSis defined at line 25 and overwritten at line 41The first definitions appear to be leftover from the original code structure.
Consider removing the redundant definitions at lines 24-26:
GO_LINKMODE ?= external -GOMOD ?= readonly -BUILD_TAGS ?= osusergo,netgo,hidraw,ledger GORELEASER_STRIP_FLAGS ?=Also applies to: 35-36, 41-42
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
contracts/price-oracle/Cargo.lockis excluded by!**/*.lockcontracts/price-oracle/artifacts/price_oracle.wasmis excluded by!**/*.wasmgo.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (175)
.env(1 hunks).envrc(1 hunks).github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser-docker.yaml(3 hunks).goreleaser-test-bins.yaml(4 hunks).goreleaser.yaml(6 hunks)Makefile(2 hunks)_run/.env(1 hunks)_run/.envrc(1 hunks)_run/.envrc_run(1 hunks)_run/common-base.mk(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)_run/node/.envrc(1 hunks)_run/node/.gitignore(1 hunks)_run/node/Makefile(1 hunks)app/app.go(8 hunks)app/app_configure.go(4 hunks)app/config.go(2 hunks)app/modules.go(4 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(9 hunks)app/testnet.go(1 hunks)app/types/app.go(7 hunks)app/upgrades.go(2 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/config.go(1 hunks)cmd/akash/cmd/root.go(5 hunks)cmd/akash/cmd/testnetify/config.go(1 hunks)cmd/akash/cmd/testnetify/testnetify.go(1 hunks)cmd/akash/cmd/testnetify/utils.go(1 hunks)cmd/akash/main.go(1 hunks)contracts/price-oracle/Cargo.toml(1 hunks)contracts/price-oracle/artifacts/checksums.txt(1 hunks)contracts/price-oracle/src/bin/schema.rs(1 hunks)contracts/price-oracle/src/contract.rs(1 hunks)contracts/price-oracle/src/error.rs(1 hunks)contracts/price-oracle/src/lib.rs(1 hunks)contracts/price-oracle/src/msg.rs(1 hunks)contracts/price-oracle/src/querier.rs(1 hunks)contracts/price-oracle/src/state.rs(1 hunks)docgen/main.go(1 hunks)go.mod(13 hunks)make/cosmwasm.mk(1 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(1 hunks)meta.json(1 hunks)pubsub/bus_test.go(1 hunks)tests/e2e/certs_cli_test.go(1 hunks)tests/e2e/certs_grpc_test.go(1 hunks)tests/e2e/cli_test.go(1 hunks)tests/e2e/deployment_cli_test.go(1 hunks)tests/e2e/deployment_grpc_test.go(1 hunks)tests/e2e/grpc_test.go(1 hunks)tests/e2e/market_cli_test.go(1 hunks)tests/e2e/market_grpc_test.go(1 hunks)tests/e2e/provider_cli_test.go(1 hunks)tests/e2e/provider_grpc_test.go(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/upgrade_test.go(1 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/network/network.go(1 hunks)testutil/network_suite.go(1 hunks)testutil/sims/simulation_helpers.go(3 hunks)testutil/state/suite.go(1 hunks)testutil/types.go(1 hunks)tools/upgrade-info/main.go(1 hunks)upgrades/software/v1.0.0/audit.go(0 hunks)upgrades/software/v1.0.0/cert.go(0 hunks)upgrades/software/v1.0.0/deployment.go(0 hunks)upgrades/software/v1.0.0/escrow.go(0 hunks)upgrades/software/v1.0.0/init.go(0 hunks)upgrades/software/v1.0.0/market.go(0 hunks)upgrades/software/v1.0.0/provider.go(0 hunks)upgrades/software/v1.0.0/take.go(0 hunks)upgrades/software/v1.0.0/upgrade.go(0 hunks)upgrades/software/v2.0.0/init.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)upgrades/types/types.go(1 hunks)upgrades/upgrades.go(1 hunks)upgrades/upgrades_test.go(1 hunks)util/partialord/internal/dag/dag_test.go(1 hunks)util/partialord/partialord.go(1 hunks)util/partialord/partialord_test.go(1 hunks)util/query/pagination.go(1 hunks)wasmvm.go(1 hunks)x/audit/alias.go(1 hunks)x/audit/genesis.go(1 hunks)x/audit/handler/handler.go(1 hunks)x/audit/handler/handler_test.go(1 hunks)x/audit/handler/msg_server.go(1 hunks)x/audit/keeper/grpc_query_test.go(2 hunks)x/audit/keeper/keeper_test.go(1 hunks)x/audit/keeper/key.go(1 hunks)x/audit/module.go(5 hunks)x/cert/alias.go(1 hunks)x/cert/genesis.go(1 hunks)x/cert/handler/handler.go(1 hunks)x/cert/handler/handler_test.go(1 hunks)x/cert/handler/msg_server.go(1 hunks)x/cert/keeper/grpc_query.go(1 hunks)x/cert/keeper/grpc_query_test.go(1 hunks)x/cert/keeper/keeper_test.go(1 hunks)x/cert/keeper/key.go(1 hunks)x/cert/module.go(5 hunks)x/cert/utils/key_pair_manager.go(1 hunks)x/cert/utils/utils.go(1 hunks)x/deployment/alias.go(1 hunks)x/deployment/genesis.go(1 hunks)x/deployment/handler/handler.go(1 hunks)x/deployment/handler/handler_test.go(1 hunks)x/deployment/handler/server.go(1 hunks)x/deployment/keeper/grpc_query.go(1 hunks)x/deployment/keeper/grpc_query_test.go(1 hunks)x/deployment/keeper/keeper_test.go(1 hunks)x/deployment/module.go(1 hunks)x/deployment/simulation/operations.go(1 hunks)x/escrow/genesis.go(1 hunks)x/escrow/handler/handler.go(1 hunks)x/escrow/handler/server.go(1 hunks)x/escrow/keeper/grpc_query.go(1 hunks)x/escrow/keeper/grpc_query_test.go(1 hunks)x/escrow/keeper/keeper_test.go(1 hunks)x/escrow/module.go(5 hunks)x/escrow/query/querier.go(1 hunks)x/market/alias.go(1 hunks)x/market/client/rest/params.go(1 hunks)x/market/client/rest/rest.go(1 hunks)x/market/genesis.go(1 hunks)x/market/handler/handler_test.go(1 hunks)x/market/handler/keepers.go(1 hunks)x/market/keeper/grpc_query.go(1 hunks)x/market/keeper/grpc_query_test.go(1 hunks)x/market/keeper/keeper.go(1 hunks)x/market/keeper/keeper_test.go(1 hunks)x/market/module.go(2 hunks)x/market/query/path.go(1 hunks)x/market/simulation/operations.go(1 hunks)x/market/simulation/utils.go(1 hunks)x/oracle/alias.go(1 hunks)x/oracle/genesis.go(1 hunks)x/oracle/handler/server.go(1 hunks)x/oracle/keeper/grpc_query.go(1 hunks)x/oracle/keeper/keeper.go(1 hunks)x/oracle/module.go(1 hunks)x/oracle/simulation/decoder.go(1 hunks)x/oracle/simulation/genesis.go(1 hunks)x/oracle/simulation/proposals.go(1 hunks)x/provider/alias.go(1 hunks)x/provider/genesis.go(1 hunks)x/provider/handler/handler.go(1 hunks)x/provider/handler/handler_test.go(1 hunks)x/provider/handler/server.go(1 hunks)x/provider/keeper/grpc_query_test.go(1 hunks)x/provider/keeper/keeper_test.go(1 hunks)x/provider/module.go(3 hunks)x/provider/simulation/operations.go(1 hunks)x/take/genesis.go(1 hunks)x/take/handler/server.go(1 hunks)x/take/module.go(6 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/handler/server.go(1 hunks)x/wasm/keeper/grpc_query.go(1 hunks)x/wasm/keeper/keeper.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/decoder.go(1 hunks)x/wasm/simulation/genesis.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (10)
- upgrades/software/v1.0.0/take.go
- tests/upgrade/config-v0.24.0.tmpl.json
- upgrades/software/v1.0.0/upgrade.go
- upgrades/software/v1.0.0/init.go
- upgrades/software/v1.0.0/market.go
- upgrades/software/v1.0.0/escrow.go
- upgrades/software/v1.0.0/cert.go
- upgrades/software/v1.0.0/provider.go
- upgrades/software/v1.0.0/audit.go
- upgrades/software/v1.0.0/deployment.go
✅ Files skipped from review due to trivial changes (6)
- cmd/akash/cmd/testnetify/config.go
- _run/node/.envrc
- contracts/price-oracle/artifacts/checksums.txt
- x/cert/utils/utils.go
- x/cert/module.go
- x/cert/keeper/grpc_query_test.go
🚧 Files skipped from review as they are similar to previous changes (81)
- x/cert/handler/msg_server.go
- make/test-upgrade.mk
- x/escrow/keeper/grpc_query_test.go
- x/audit/genesis.go
- x/market/query/path.go
- app/testnet.go
- x/escrow/genesis.go
- x/cert/keeper/key.go
- x/take/handler/server.go
- tests/upgrade/upgrade_test.go
- pubsub/bus_test.go
- testutil/network_suite.go
- tests/e2e/certs_cli_test.go
- x/deployment/keeper/keeper_test.go
- .env
- x/provider/simulation/operations.go
- x/deployment/handler/handler_test.go
- docgen/main.go
- testutil/state/suite.go
- x/provider/handler/handler_test.go
- testutil/sims/simulation_helpers.go
- wasmvm.go
- x/audit/keeper/grpc_query_test.go
- x/market/client/rest/rest.go
- cmd/akash/cmd/app_creator.go
- x/cert/genesis.go
- x/cert/handler/handler_test.go
- tests/e2e/deployment_cli_test.go
- util/partialord/partialord.go
- app/sim/sim_utils.go
- x/audit/handler/handler_test.go
- cmd/akash/main.go
- x/cert/keeper/grpc_query.go
- x/market/keeper/keeper.go
- x/provider/handler/server.go
- x/escrow/query/querier.go
- tests/e2e/deployment_grpc_test.go
- util/query/pagination.go
- x/market/module.go
- _run/common-commands.mk
- x/market/handler/handler_test.go
- _run/.envrc_run
- _run/common-base.mk
- x/audit/handler/handler.go
- x/audit/keeper/keeper_test.go
- x/escrow/handler/handler.go
- tests/e2e/market_grpc_test.go
- _run/node/.gitignore
- upgrades/types/types.go
- testutil/network/network.go
- x/market/handler/keepers.go
- tests/e2e/market_cli_test.go
- x/take/genesis.go
- x/audit/module.go
- x/deployment/simulation/operations.go
- x/wasm/simulation/decoder.go
- x/escrow/keeper/grpc_query.go
- cmd/akash/cmd/testnetify/utils.go
- x/provider/alias.go
- tests/e2e/provider_grpc_test.go
- x/market/simulation/operations.go
- x/market/keeper/grpc_query.go
- make/setup-cache.mk
- util/partialord/internal/dag/dag_test.go
- x/audit/handler/msg_server.go
- tests/e2e/certs_grpc_test.go
- x/deployment/handler/handler.go
- x/cert/utils/key_pair_manager.go
- make/init.mk
- x/deployment/alias.go
- x/cert/keeper/keeper_test.go
- tools/upgrade-info/main.go
- meta.json
- x/market/alias.go
- x/deployment/keeper/grpc_query.go
- util/partialord/partialord_test.go
- _run/common.mk
- cmd/akash/cmd/config.go
- x/escrow/keeper/keeper_test.go
- .github/actions/setup-ubuntu/action.yaml
- x/deployment/genesis.go
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-14T01:24:04.227Z
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.227Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
Applied to files:
x/wasm/keeper/msg_filter.gogo.modcontracts/price-oracle/src/msg.rsapp/types/app.go
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
make/cosmwasm.mkMakefile.envrcmake/releasing.mk_run/node/Makefile
🧬 Code graph analysis (15)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(134-146)upgrades/types/types.go (1)
IUpgrade(32-37)
x/escrow/module.go (2)
x/audit/module.go (8)
AppModuleBasic(39-41)AppModuleBasic(44-46)AppModuleBasic(49-51)AppModuleBasic(59-61)AppModuleBasic(64-79)AppModuleBasic(87-92)AppModuleBasic(95-100)AppModuleBasic(103-105)x/deployment/module.go (8)
AppModuleBasic(44-46)AppModuleBasic(60-62)AppModuleBasic(65-67)AppModuleBasic(78-80)AppModuleBasic(83-90)AppModuleBasic(93-98)AppModuleBasic(101-103)AppModuleBasic(106-108)
contracts/price-oracle/src/bin/schema.rs (1)
contracts/price-oracle/src/contract.rs (2)
instantiate(41-76)query(222-229)
x/wasm/simulation/proposals.go (1)
cmd/akash/cmd/testnetify/config.go (1)
AccAddress(32-34)
contracts/price-oracle/src/contract.rs (1)
contracts/price-oracle/src/state.rs (2)
new(32-41)default(45-47)
app/app.go (4)
x/cert/alias.go (1)
ModuleName(13-13)x/deployment/alias.go (1)
ModuleName(13-13)x/market/alias.go (1)
ModuleName(13-13)x/provider/alias.go (1)
ModuleName(13-13)
app/sim_test.go (2)
app/app.go (3)
AppName(82-82)NewApp(109-291)AkashApp(96-106)app/config.go (1)
ModuleBasics(72-74)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
x/oracle/simulation/proposals.go (1)
cmd/akash/cmd/testnetify/config.go (1)
AccAddress(32-34)
x/oracle/module.go (2)
x/escrow/module.go (1)
AppModuleSimulation(205-207)x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
x/take/module.go (2)
x/cert/module.go (6)
AppModuleBasic(39-41)AppModuleBasic(50-52)AppModuleBasic(55-57)AppModuleBasic(65-67)AppModuleBasic(70-83)AppModuleBasic(86-91)x/take/alias.go (1)
ModuleName(11-11)
x/oracle/keeper/keeper.go (1)
x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
cmd/akash/cmd/root.go (2)
app/app.go (1)
DefaultHome(86-86)cmd/akash/cmd/config.go (1)
InitAppConfig(20-31)
x/wasm/keeper/keeper.go (1)
x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
x/wasm/module.go (2)
x/escrow/module.go (1)
AppModuleSimulation(205-207)x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
🪛 checkmake (0.2.2)
_run/node/Makefile
[warning] 4-4: Missing required phony target "all"
(minphony)
[warning] 4-4: Missing required phony target "clean"
(minphony)
[warning] 4-4: Missing required phony target "test"
(minphony)
🪛 dotenv-linter (4.0.0)
_run/.env
[warning] 2-2: [UnorderedKey] The AKASH_GAS_ADJUSTMENT key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 3-3: [UnorderedKey] The AKASH_CHAIN_ID key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 5-5: [UnorderedKey] The AKASH_GAS_PRICES key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 6-6: [UnorderedKey] The AKASH_GAS key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 7-7: [UnorderedKey] The AKASH_NODE key should go before the AKASH_YES key
(UnorderedKey)
🪛 golangci-lint (2.5.0)
x/oracle/keeper/grpc_query.go
[error] 11-11: could not import pkg.akt.dev/go/node/oracle/v1 (-: # pkg.akt.dev/go/node/oracle/v1
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:51:44: cannot use m (variable of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to xxx_messageInfo_Params.Marshal: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String)
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:62:31: cannot use m (variable of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to xxx_messageInfo_Params.Merge: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String)
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:68:40: cannot use m (variable of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to xxx_messageInfo_Params.DiscardUnknown: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String)
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:215:21: cannot use (*Params)(nil) (value of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to proto.RegisterType: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String))
(typecheck)
⏰ 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). (8)
- GitHub Check: network-upgrade
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: build-bins
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: build-macos
- GitHub Check: tests
| // Check staleness | ||
| let current_time = env.block.time.seconds() as i64; | ||
| if current_time - publish_time > MAX_STALENESS { | ||
| return Err(ContractError::StalePriceData { | ||
| current_time, | ||
| publish_time, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing validation for future timestamps.
The staleness check only prevents prices that are too old but doesn't reject prices with future publish_time. An attacker could submit a price with a very large future timestamp, which would:
- Pass the staleness check (the subtraction would be negative or very small)
- Block all future legitimate updates since
publish_timemust be strictly increasing (line 154)
Add a check to reject future timestamps:
// Check staleness
let current_time = env.block.time.seconds() as i64;
+ if publish_time > current_time {
+ return Err(ContractError::InvalidPriceData {
+ reason: format!("Publish time {} is in the future (current: {})", publish_time, current_time),
+ });
+ }
if current_time - publish_time > MAX_STALENESS {
return Err(ContractError::StalePriceData {
current_time,
publish_time,
});
}Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In contracts/price-oracle/src/contract.rs around lines 133 to 140, add a
validation to reject publish_time values in the future: after computing
current_time, if publish_time > current_time return a ContractError (e.g.,
ContractError::FuturePriceData { current_time, publish_time }) instead of
proceeding; keep this check before the staleness check so that future timestamps
are rejected early and do not interfere with the strict increasing publish_time
invariant.
| #[test] | ||
| fn test_instantiate_with_provided_id() { | ||
| let mut deps = mock_dependencies(); | ||
| let msg = InstantiateMsg { | ||
| admin: "admin".to_string(), | ||
| update_fee: Uint256::from(1000u128), | ||
| price_feed_id: "0xabc123def456".to_string(), | ||
| }; | ||
| let info = message_info(&deps.api.addr_make("creator"), &[]); | ||
| let env = mock_env(); | ||
|
|
||
| let res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); | ||
| assert_eq!(4, res.attributes.len()); | ||
|
|
||
| let config: ConfigResponse = | ||
| from_json(&query(deps.as_ref(), env, QueryMsg::GetConfig {}).unwrap()).unwrap(); | ||
| assert_eq!("admin", config.admin); | ||
| assert_eq!("0xabc123def456", config.price_feed_id); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, search for custom mock implementations related to AkashQuery
rg -n "mock.*AkashQuery|AkashQuery.*mock|MockQuerier" contracts/price-oracle/src/Repository: akash-network/node
Length of output: 44
🏁 Script executed:
# Check the instantiate function signature to see if it's generic
rg -n "fn instantiate" contracts/price-oracle/src/contract.rs -A 3Repository: akash-network/node
Length of output: 163
🏁 Script executed:
# Look for mock_dependencies usage and any custom setup in the test module
rg -n "mock_dependencies\|use mock" contracts/price-oracle/src/contract.rs | head -20Repository: akash-network/node
Length of output: 44
🏁 Script executed:
# Check if there are any trait implementations or type definitions for mocking
rg -n "impl.*Querier\|struct.*Mock" contracts/price-oracle/src/ -A 2Repository: akash-network/node
Length of output: 44
🏁 Script executed:
# Search entire price-oracle module for test-related files and utilities
find contracts/price-oracle -type f -name "*.rs" | head -20Repository: akash-network/node
Length of output: 319
🏁 Script executed:
# Look for any test module or mod.rs that might define mocks
rg -n "mod.*test\|#\[cfg(test)\]" contracts/price-oracle/src/ -A 5Repository: akash-network/node
Length of output: 44
🏁 Script executed:
# Check for custom Querier trait implementations
rg -n "impl.*Querier\|type.*Querier" contracts/price-oracle/src/Repository: akash-network/node
Length of output: 44
🏁 Script executed:
# Search for type aliases or custom mock setups
rg -n "type.*Mock\|MockDeps\|fn mock_" contracts/price-oracle/src/Repository: akash-network/node
Length of output: 44
🏁 Script executed:
# Check imports at top of contract.rs
head -40 contracts/price-oracle/src/contract.rsRepository: akash-network/node
Length of output: 1433
🏁 Script executed:
# Look at the test module structure and surrounding context of the test
sed -n '270,310p' contracts/price-oracle/src/contract.rsRepository: akash-network/node
Length of output: 1400
🏁 Script executed:
# Search for all test functions in contract.rs
rg -n "#\[test\]" contracts/price-oracle/src/contract.rsRepository: akash-network/node
Length of output: 125
Fix type mismatch in test: mock_dependencies() returns Empty query type, but instantiate() requires AkashQuery.
The test uses mock_dependencies() which creates OwnedDeps<Empty>, but the instantiate() function signature expects DepsMut<AkashQuery>. This type mismatch will prevent compilation. Either create a custom mock that returns OwnedDeps<AkashQuery>, or ensure the test works by providing price_feed_id in the message (avoiding the fetch_price_feed_id_from_chain path that requires the custom querier).
🤖 Prompt for AI Agents
In contracts/price-oracle/src/contract.rs around lines 284-302 the unit test
calls mock_dependencies() which yields OwnedDeps<Empty> but instantiate()
expects DepsMut<AkashQuery>, causing a type mismatch; fix by replacing the
test's mock creation with a mock that uses the AkashQuery concrete query type
(e.g. add or use a helper like
mock_dependencies_with_akash_querier/mock_querier_that_returns_AkashQuery or
construct OwnedDeps<AkashQuery> with a custom querier) so the deps type matches
instantiate(), or alternatively adjust the test to avoid invoking any code path
that requires the custom querier by ensuring the provided InstantiateMsg
includes a valid price_feed_id and the instantiate signature is called with a
deps value matching its generic; update the test to call the matching mock
helper so compilation succeeds.
| @@ -0,0 +1,12 @@ | |||
| package wasm | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix package declaration to match directory.
The package is declared as wasm but the file is located in x/oracle/. This will cause compilation errors.
Apply this diff to fix the package declaration:
-package wasm
+package oracle📝 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.
| package wasm | |
| package oracle |
🤖 Prompt for AI Agents
In x/oracle/alias.go around line 1, the file declares package "wasm" but resides
in the x/oracle directory causing compile failures; change the package
declaration to "oracle" (i.e., replace "package wasm" with "package oracle") so
the package name matches the directory, and ensure any file-level comments or
build tags remain valid after the change.
| func (k Querier) PriceFeedConfig(ctx context.Context, request *types.QueryPriceFeedConfigRequest) (*types.QueryPriceFeedConfigResponse, error) { | ||
| //TODO implement me | ||
| panic("implement me") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unimplemented PriceFeedConfig will panic if called.
This method contains panic("implement me") which will crash the node if any client calls this RPC endpoint. Either implement the method or return a proper gRPC Unimplemented error.
func (k Querier) PriceFeedConfig(ctx context.Context, request *types.QueryPriceFeedConfigRequest) (*types.QueryPriceFeedConfigResponse, error) {
- //TODO implement me
- panic("implement me")
+ return nil, status.Errorf(codes.Unimplemented, "method PriceFeedConfig not implemented")
}📝 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.
| func (k Querier) PriceFeedConfig(ctx context.Context, request *types.QueryPriceFeedConfigRequest) (*types.QueryPriceFeedConfigResponse, error) { | |
| //TODO implement me | |
| panic("implement me") | |
| } | |
| func (k Querier) PriceFeedConfig(ctx context.Context, request *types.QueryPriceFeedConfigRequest) (*types.QueryPriceFeedConfigResponse, error) { | |
| return nil, status.Errorf(codes.Unimplemented, "method PriceFeedConfig not implemented") | |
| } |
🤖 Prompt for AI Agents
In x/oracle/keeper/grpc_query.go around lines 19-22, the PriceFeedConfig method
currently panics ("implement me"); replace the panic with a proper
implementation or at minimum return a gRPC Unimplemented error. Implement by
retrieving the price feed config from keeper/store using the context and request
(validate request if needed), construct and return a
types.QueryPriceFeedConfigResponse with the config and nil error; if you don't
have the implementation yet, return status.Error(codes.Unimplemented,
"PriceFeedConfig not implemented") to avoid crashing the node.
| // GetAuthority returns the x/mint module's authority. | ||
| func (k *keeper) GetAuthority() string { | ||
| return k.authority | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix misleading comment.
The comment incorrectly references "x/mint module's authority" instead of "x/wasm module's authority".
-// GetAuthority returns the x/mint module's authority.
+// GetAuthority returns the x/wasm module's authority.
func (k *keeper) GetAuthority() string {📝 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.
| // GetAuthority returns the x/mint module's authority. | |
| func (k *keeper) GetAuthority() string { | |
| return k.authority | |
| } | |
| // GetAuthority returns the x/wasm module's authority. | |
| func (k *keeper) GetAuthority() string { | |
| return k.authority | |
| } |
🤖 Prompt for AI Agents
In x/wasm/keeper/keeper.go around lines 62 to 65, the function comment for
GetAuthority incorrectly refers to the "x/mint module's authority"; update the
GoDoc comment to correctly reference the "x/wasm module's authority" (e.g.,
"GetAuthority returns the x/wasm module's authority.") ensuring the comment
still starts with the function name for proper GoDoc formatting.
| // SetParams sets the x/take module parameters. | ||
| func (k *keeper) SetParams(ctx sdk.Context, p types.Params) error { | ||
| if err := p.Validate(); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| store := ctx.KVStore(k.skey) | ||
| bz := k.cdc.MustMarshal(&p) | ||
| store.Set(types.ParamsPrefix(), bz) | ||
|
|
||
| // call hooks | ||
| for _, hook := range k.hooks.onSetParams { | ||
| hook(ctx, p) | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| // GetParams returns the current x/take module parameters. | ||
| func (k *keeper) GetParams(ctx sdk.Context) (p types.Params) { | ||
| store := ctx.KVStore(k.skey) | ||
| bz := store.Get(types.ParamsPrefix()) | ||
| if bz == nil { | ||
| return p | ||
| } | ||
|
|
||
| k.cdc.MustUnmarshal(bz, &p) | ||
|
|
||
| return p | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix misleading comments in SetParams/GetParams.
Both comments incorrectly reference "x/take module" instead of "x/wasm module".
-// SetParams sets the x/take module parameters.
+// SetParams sets the x/wasm module parameters.
func (k *keeper) SetParams(ctx sdk.Context, p types.Params) error {-// GetParams returns the current x/take module parameters.
+// GetParams returns the current x/wasm module parameters.
func (k *keeper) GetParams(ctx sdk.Context) (p types.Params) {📝 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.
| // SetParams sets the x/take module parameters. | |
| func (k *keeper) SetParams(ctx sdk.Context, p types.Params) error { | |
| if err := p.Validate(); err != nil { | |
| return err | |
| } | |
| store := ctx.KVStore(k.skey) | |
| bz := k.cdc.MustMarshal(&p) | |
| store.Set(types.ParamsPrefix(), bz) | |
| // call hooks | |
| for _, hook := range k.hooks.onSetParams { | |
| hook(ctx, p) | |
| } | |
| return nil | |
| } | |
| // GetParams returns the current x/take module parameters. | |
| func (k *keeper) GetParams(ctx sdk.Context) (p types.Params) { | |
| store := ctx.KVStore(k.skey) | |
| bz := store.Get(types.ParamsPrefix()) | |
| if bz == nil { | |
| return p | |
| } | |
| k.cdc.MustUnmarshal(bz, &p) | |
| return p | |
| } | |
| // SetParams sets the x/wasm module parameters. | |
| func (k *keeper) SetParams(ctx sdk.Context, p types.Params) error { | |
| if err := p.Validate(); err != nil { | |
| return err | |
| } | |
| store := ctx.KVStore(k.skey) | |
| bz := k.cdc.MustMarshal(&p) | |
| store.Set(types.ParamsPrefix(), bz) | |
| // call hooks | |
| for _, hook := range k.hooks.onSetParams { | |
| hook(ctx, p) | |
| } | |
| return nil | |
| } | |
| // GetParams returns the current x/wasm module parameters. | |
| func (k *keeper) GetParams(ctx sdk.Context) (p types.Params) { | |
| store := ctx.KVStore(k.skey) | |
| bz := store.Get(types.ParamsPrefix()) | |
| if bz == nil { | |
| return p | |
| } | |
| k.cdc.MustUnmarshal(bz, &p) | |
| return p | |
| } |
🤖 Prompt for AI Agents
In x/wasm/keeper/keeper.go around lines 67 to 96, the function comments for
SetParams and GetParams incorrectly reference the "x/take module"; update both
comments to correctly reference the "x/wasm module" (e.g., "SetParams sets the
x/wasm module parameters." and "GetParams returns the current x/wasm module
parameters.") so the doc comments accurately describe the module.
| // RegisterStoreDecoder registers a decoder for take module's types. | ||
| func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} | ||
|
|
||
| // WeightedOperations doesn't return any take module operation. | ||
| func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix copy-paste errors in simulation comments.
Lines 176 and 179 incorrectly reference "take module" instead of "wasm module".
Apply this diff:
-// RegisterStoreDecoder registers a decoder for take module's types.
+// RegisterStoreDecoder registers a decoder for wasm module's types.
func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {}
-// WeightedOperations doesn't return any take module operation.
+// WeightedOperations doesn't return any wasm module operation.
func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation {
return nil
}📝 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.
| // RegisterStoreDecoder registers a decoder for take module's types. | |
| func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} | |
| // WeightedOperations doesn't return any take module operation. | |
| func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { | |
| return nil | |
| } | |
| // RegisterStoreDecoder registers a decoder for wasm module's types. | |
| func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} | |
| // WeightedOperations doesn't return any wasm module operation. | |
| func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { | |
| return nil | |
| } |
🤖 Prompt for AI Agents
In x/wasm/module.go around lines 176 to 182, update the copy-pasted comments
that incorrectly reference "take module" to instead reference "wasm module";
specifically change the comment above RegisterStoreDecoder and the comment above
WeightedOperations so they accurately describe the wasm module functionality and
purpose.
| // RandomizedGenState generates a random GenesisState for supply | ||
| func RandomizedGenState(simState *module.SimulationState) { | ||
| takeGenesis := &types.GenesisState{ | ||
| Params: types.DefaultParams(), | ||
| } | ||
|
|
||
| simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(takeGenesis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix copy-paste artifacts in comment and variable name.
The function comment and variable name appear to be copied from another module:
- Comment says "for supply" but this is the wasm module
- Variable is named
takeGenesisbut should reflect wasm module
Apply this diff:
-// RandomizedGenState generates a random GenesisState for supply
+// RandomizedGenState generates a random GenesisState for the wasm module
func RandomizedGenState(simState *module.SimulationState) {
- takeGenesis := &types.GenesisState{
+ wasmGenesis := &types.GenesisState{
Params: types.DefaultParams(),
}
- simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(takeGenesis)
+ simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(wasmGenesis)
}🤖 Prompt for AI Agents
In x/wasm/simulation/genesis.go around lines 9 to 15, the function comment and
local variable are leftover copy-paste artifacts (comment says "for supply" and
variable is named takeGenesis); update the comment to correctly describe the
wasm module (e.g., "RandomizedGenState generates a random GenesisState for
wasm") and rename the variable to a wasm-appropriate name (e.g., wasmGenesis) so
the code and comment reflect the wasm module semantics; keep the same
initialization and assignment to simState.GenState.
Signed-off-by: Artur Troian <[email protected]>
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
testutil/sims/simulation_helpers.go (1)
179-223:getDiffFromKVPaircan emit duplicate/misleading diffs for keys with different valuesWhen a key exists in both stores but with different values, it’s:
- First added to
diffA/diffBinside the loop (the intended behavior), but- Its entry is left in
index, so the finalfor key, value := range indexloop treats it as “missing in kvAs” and appends a second, incorrect diff entry.Result: changed keys appear twice in the output, and the second entry incorrectly suggests the key is absent from
kvAs.You can fix this by removing the key from
indexin the “values differ” branch as well (pre-existing bug; change is localized and backward-compatible with the intended API):- for _, kvA := range kvAs { - if kvBValue, ok := index[string(kvA.Key)]; !ok { - diffA = append(diffA, kvA) - diffB = append(diffB, kv.Pair{Key: kvA.Key}) // the key is missing from kvB so we append a pair with an empty value - } else if !bytes.Equal(kvA.Value, kvBValue) { - diffA = append(diffA, kvA) - diffB = append(diffB, kv.Pair{Key: kvA.Key, Value: kvBValue}) - } else { - // values are equal, so we remove the key from the index - delete(index, string(kvA.Key)) - } - } + for _, kvA := range kvAs { + if kvBValue, ok := index[string(kvA.Key)]; !ok { + diffA = append(diffA, kvA) + diffB = append(diffB, kv.Pair{Key: kvA.Key}) // the key is missing from kvB so we append a pair with an empty value + } else if !bytes.Equal(kvA.Value, kvBValue) { + diffA = append(diffA, kvA) + diffB = append(diffB, kv.Pair{Key: kvA.Key, Value: kvBValue}) + delete(index, string(kvA.Key)) + } else { + // values are equal, so we remove the key from the index + delete(index, string(kvA.Key)) + } + }This keeps
indexcontaining only keys that are truly “only in kvBs”, so the trailing loop correctly handles “kvBs-only” keys without duplicating existing diffs.x/audit/module.go (1)
86-92: Inconsistent error message references "provider" instead of "audit".Line 90 still says "couldn't register provider grpc routes" but this is the audit module. The error message at line 98 correctly says "audit".
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { - panic(fmt.Sprintf("couldn't register provider grpc routes: %s", err.Error())) + panic(fmt.Sprintf("couldn't register audit grpc routes: %s", err.Error())) } }app/modules.go (1)
228-254: Duplicateauthzmodule.NewAppModuleregistration in simulation modules.The
authzmodule.NewAppModuleis registered twice inappSimModules:
- Lines 228-234
- Lines 248-254
This appears to be a copy-paste error and could cause issues during simulation initialization.
authzmodule.NewAppModule( app.cdc, app.Keepers.Cosmos.Authz, app.Keepers.Cosmos.Acct, app.Keepers.Cosmos.Bank, app.interfaceRegistry, ), bank.NewAppModule( app.cdc, app.Keepers.Cosmos.Bank, app.Keepers.Cosmos.Acct, app.GetSubspace(banktypes.ModuleName), ), feegrantmodule.NewAppModule( app.cdc, app.Keepers.Cosmos.Acct, app.Keepers.Cosmos.Bank, app.Keepers.Cosmos.FeeGrant, app.interfaceRegistry, ), - authzmodule.NewAppModule( - app.cdc, - app.Keepers.Cosmos.Authz, - app.Keepers.Cosmos.Acct, - app.Keepers.Cosmos.Bank, - app.interfaceRegistry, - ), gov.NewAppModule(
♻️ Duplicate comments (18)
x/oracle/simulation/decoder.go (1)
1-17: Remove placeholder decoder or implement real oracle simulation decoderThis file is still just a package declaration plus commented‑out mint‑module decoder code (Minter/MinterKey), which is wrong for the oracle module and provides no actual functionality. Keeping this around as a stub adds noise and can mislead readers about oracle simulation support.
I’d suggest either:
- deleting
x/oracle/simulation/decoder.goentirely until an oracle decoder is needed, or- replacing the commented skeleton with a real
NewDecodeStorethat switches on oracle module keys and unmarshals into oracle types (using the oracle codec), with no references to mint types.x/oracle/simulation/genesis.go (1)
9-15: Fix oracle‑specific naming and comment copy‑paste artifacts.The comment and
takeGenesisname still look copy‑pasted from another module and don’t match the oracle context. This hurts readability, especially across multiple modules’ simulation helpers.You can align them with the oracle module like this:
-// RandomizedGenState generates a random GenesisState for supply +// RandomizedGenState generates a random GenesisState for the oracle module func RandomizedGenState(simState *module.SimulationState) { - takeGenesis := &types.GenesisState{ + oracleGenesis := &types.GenesisState{ Params: types.DefaultParams(), } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(takeGenesis) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(oracleGenesis) }tests/upgrade/upgrade_test.go (3)
696-705: Remove stale commented-out timer block around proposal submissionThe fully commented timer/select block before querying gov params is dead code and adds noise to an already complex upgrade test. It was previously flagged for removal and still appears unchanged; deleting it will simplify the flow without changing behavior.
- //tm := time.NewTimer(30 * time.Second) - //select { - //case <-l.ctx.Done(): - // if !tm.Stop() { - // <-tm.C - // } - // err = l.ctx.Err() - // return err - //case <-tm.C: - //}
758-766: Handle empty/multi-denom gov min-deposit safely when building the proposal
params.DepositParams.MinDeposit[0]assumes at least one coin and silently ignores additional denoms, so it can panic on an emptyMinDepositor submit an insufficient deposit when multiple denoms are configured. This was noted earlier and still persists in the current code; use the fullsdk.Coinsvalue and guard the empty case.- prop := &ProposalMsg{ - Messages: []json.RawMessage{ - jup, - }, - Deposit: params.DepositParams.MinDeposit[0].String(), - Title: l.upgradeName, - Summary: l.upgradeName, - Expedited: false, - } + depositCoins := params.DepositParams.MinDeposit + if depositCoins.Empty() { + return fmt.Errorf("min deposit parameter is empty") + } + + prop := &ProposalMsg{ + Messages: []json.RawMessage{ + jup, + }, + Deposit: depositCoins.String(), + Title: l.upgradeName, + Summary: l.upgradeName, + Expedited: false, + }
792-799: Align “two blocks” comment with the 18s timeout and fix typoThe comment says “give it two blocks” but the timeout is 18 seconds, which corresponds to ~3 blocks at 6s/block, and “commited” is misspelled. This mismatch was previously flagged and remains; either adjust the timeout or, more simply, correct the comment to match the current 18s value.
- // give it two blocks to make sure a proposal has been commited - tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second) + // give it three blocks to make sure a proposal has been committed + tmctx, cancel := context.WithTimeout(l.ctx, 18*time.Second)x/oracle/keeper/grpc_query.go (1)
19-22: UnimplementedPriceFeedConfigwill panic if called.This issue was previously flagged. The method should return a proper gRPC
Unimplementederror instead of panicking.func (k Querier) PriceFeedConfig(ctx context.Context, request *types.QueryPriceFeedConfigRequest) (*types.QueryPriceFeedConfigResponse, error) { - //TODO implement me - panic("implement me") + return nil, status.Errorf(codes.Unimplemented, "method PriceFeedConfig not implemented") }x/wasm/simulation/genesis.go (1)
9-15: Copy-paste artifacts still present.This was flagged in a previous review: the comment says "for supply" and variable is named
takeGenesis, but this is the wasm module. These should be corrected to reflect the wasm module context.make/releasing.mk (1)
50-53: Restorewasmvm-libsprerequisite forakash_docgen.
akash_docgennow only depends on$(AKASH_DEVCACHE)(Line 51). Given docgen pulls in wasm/wasmvm code, it still needswasmvm-libsto ensurelibwasmvmis present on a clean checkout; otherwise you’ll hit linker errors again.Recommend restoring the previous pattern:
-.PHONY: akash_docgen -akash_docgen: $(AKASH_DEVCACHE) - $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgen +.PHONY: akash_docgen +akash_docgen: $(AKASH_DEVCACHE) wasmvm-libs + $(GO_BUILD) $(BUILD_FLAGS) -o $(AKASH_DEVCACHE_BIN)/akash_docgen ./docgenThis keeps docgen consistent with other wasm-dependent targets like
build,test-bins,docker-image, andrelease.tests/upgrade/workers_test.go (1)
127-136: Remove redundantUnpackAnyof gov module account.After unpacking into
accand assertingmaccassdk.ModuleAccountI(Lines 127–131), the secondUnpackAnyintomacc(Lines 133–134) is unnecessary and just repeats work.You can simplify:
var acc sdk.AccountI err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) require.NoError(t, err) macc, ok := acc.(sdk.ModuleAccountI) require.True(t, ok) - - err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()This keeps the logic and assertions intact while avoiding redundant decoding.
x/wasm/keeper/keeper.go (1)
40-96: Fix copy‑paste doc comments and consider default Params on empty store.Several comments still reference other modules:
- Line 40: “take keeper”.
- Line 62: “x/mint module's authority”.
- Lines 67 & 85: “x/take module parameters”.
Suggest updating to accurately say “wasm” everywhere, e.g.:
-// NewKeeper creates and returns an instance of take keeper +// NewKeeper creates and returns an instance of wasm keeper @@ -// GetAuthority returns the x/mint module's authority. +// GetAuthority returns the x/wasm module's authority. @@ -// SetParams sets the x/take module parameters. +// SetParams sets the x/wasm module parameters. @@ -// GetParams returns the current x/take module parameters. +// GetParams returns the current x/wasm module parameters.Optionally, you might also treat a missing params key in
GetParamsas “use defaults” instead of returning a zero struct, e.g.return types.DefaultParams()whenbz == nil, to be extra defensive ifGetParamsis called beforeInitGenesis.x/wasm/module.go (1)
110-181: Align AppModule comments with wasm module (fix copy‑paste text).A few doc comments are still out of sync with the actual module:
- Line 110: “returns the provider module name”.
- Line 166: “staking module”.
- Line 176: “take module's types”.
- Line 179: “take module operation”.
Recommend tightening them to reflect wasm, for example:
-// Name returns the provider module name +// Name returns the wasm module name @@ -// GenerateGenesisState creates a randomized GenState of the staking module. +// GenerateGenesisState creates a randomized GenState of the wasm module. @@ -// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for wasm module's types. @@ -// WeightedOperations doesn't return any take module operation. +// WeightedOperations doesn't return any wasm module operation.This keeps the documentation consistent and avoids confusion when navigating modules.
Makefile (1)
62-91: FixGORELEASER_LDFLAGSto capture finalldflags(static linking & strip flags).
GORELEASER_LDFLAGSis assigned beforeldflagsis mutated with-linkmode,-extldflags,-s -w, and custom$(LDFLAGS)(Lines 69–86). As a result, goreleaser builds won’t get the static-link/extldflags/strip behavior that localgo builduses.Move the assignment after all
ldflagsmutations and use a recursive=so it always reflects the final value:-ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ +ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=akash \ -X github.com/cosmos/cosmos-sdk/version.AppName=akash \ -X github.com/cosmos/cosmos-sdk/version.BuildTags="$(build_tags_cs)" \ -X github.com/cosmos/cosmos-sdk/version.Version=$(shell git describe --tags | sed 's/^v//') \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(GIT_HEAD_COMMIT_LONG) \ -X github.com/cosmos/cosmos-sdk/types.DBBackend=$(DB_BACKEND) - -GORELEASER_LDFLAGS := $(ldflags) - -ldflags += -linkmode=external +ldflags += -linkmode=external @@ ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) -GORELEASER_TAGS := $(BUILD_TAGS) -GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)' +GORELEASER_LDFLAGS = $(ldflags) +GORELEASER_TAGS := $(BUILD_TAGS) +GORELEASER_FLAGS := $(BUILD_FLAGS) -mod=$(GOMOD) -tags='$(build_tags)'This keeps goreleaser artifacts consistent with local builds and preserves static-link expectations.
x/oracle/module.go (4)
1-1: Fix package name to match module directory.This file is under
x/oraclebut declarespackage wasm, which will break compilation and module wiring. It must beoracle.Apply this diff:
-package wasm +package oracle
110-113: Correct copy‑paste inNamemethod comment.The comment still says "provider module name" while this is the oracle module.
Apply this diff:
-// Name returns the provider module name +// Name returns the oracle module name func (AppModule) Name() string { return types.ModuleName }
166-169: Fix module reference inGenerateGenesisStatecomment.The comment incorrectly mentions the staking module instead of oracle.
Apply this diff:
-// GenerateGenesisState creates a randomized GenState of the staking module. +// GenerateGenesisState creates a randomized GenState of the oracle module. func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) }
176-182: Fix module references in simulation helper comments.Both comments here still reference the "take" module instead of oracle.
Apply this diff:
-// RegisterStoreDecoder registers a decoder for take module's types. +// RegisterStoreDecoder registers a decoder for oracle module's types. func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} -// WeightedOperations doesn't return any take module operation. +// WeightedOperations doesn't return any oracle module operation. func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil }contracts/price-oracle/src/contract.rs (2)
133-161: Still missing validation for futurepublish_timevalues (blocks future updates)The staleness check only rejects prices that are too old:
let current_time = env.block.time.seconds() as i64; if current_time - publish_time > MAX_STALENESS { // ... }If
publish_timeis far in the future,current_time - publish_timeis negative, so the price is accepted, andprice_feed.publish_timeis set to that future value. Because you later enforcepublish_time > price_feed.publish_time, any legitimate update with a realistic timestamp then fails.Add an explicit future-timestamp guard before the staleness check, for example:
- // Check staleness - let current_time = env.block.time.seconds() as i64; + // Check that publish_time is not in the future and not too stale + let current_time = env.block.time.seconds() as i64; + if publish_time > current_time { + return Err(ContractError::InvalidPriceData { + reason: format!( + "Publish time {} is in the future (current: {})", + publish_time, current_time + ), + }); + } if current_time - publish_time > MAX_STALENESS { return Err(ContractError::StalePriceData { current_time, publish_time, }); }
278-382: Tests still usemock_dependencies()(Empty query type) while contract expectsDeps<AkashQuery>The test module creates deps via
mock_dependencies():let mut deps = mock_dependencies();but
instantiate,execute, andqueryall requireDepsMut<AkashQuery>/Deps<AkashQuery>. As previously noted,mock_dependencies()producesOwnedDeps<Empty>so these calls won’t type-check.You have two main options:
- Provide a custom mock that uses
AkashQueryas the custom query type (e.g., a helper that returnsOwnedDeps<MockStorage, MockApi, MockQuerier<AkashQuery>, AkashQuery>), and use that everywhere in these tests instead ofmock_dependencies(); or- Migrate these tests to
cw-multi-testand construct anApp<AkashQuery>(or similar) that matches the contract’s query type.Until you switch to a matching mock, this test module will not compile.
#!/bin/bash # Inspect the mock helpers currently available for this contract crate rg -n "mock_dependencies" contracts/price-oracle/src -n -A3 -B3 || true
🧹 Nitpick comments (20)
app/sim_test.go (2)
189-204: Refactor error handling to use error types instead of string matching.The empty validator set handling at line 195 relies on fragile string matching. If the error message changes, this check will break.
Consider checking for a specific error type or using
errors.Is()if cosmos-sdk provides a sentinel error for this condition. If string matching is unavoidable, add a comment explaining why:- if strings.Contains(err.Error(), "validator set is empty after InitGenesis") { + // TODO: Replace with error type check if/when cosmos-sdk provides a sentinel error + if strings.Contains(err.Error(), "validator set is empty after InitGenesis") {
426-426: Suggest consistent test logging.For consistency with
TestAppImportExport(lines 165, 169, 206), consider replacingfmt.Printlnandfmt.Printfwitht.Log/t.Logfto keep test output properly associated with the test run.- fmt.Println("can't export or import a zero-validator genesis, exiting test...") + t.Log("can't export or import a zero-validator genesis, exiting test...")- fmt.Printf("exporting genesis...\n") + t.Log("exporting genesis...")- fmt.Printf("importing genesis...\n") + t.Log("importing genesis...")Also applies to: 430-430, 435-435
_run/node/Makefile (1)
1-5:clean-nodeis currently a no-op targetRight now
clean-nodeis defined but has no recipe, so invoking it does nothing. If this is meant as a node-specific cleanup hook, consider either wiring it to the shared clean logic or adding a brief comment/TODO so it’s clear that the empty body is intentional. Also be aware that tools likecheckmakemay warn about missingall/clean/testin this file even though they are likely provided via the included common makefiles.x/wasm/handler/server.go (1)
14-39:MsgUpdateParamsimplementation looks correct; fix stale comment wordingThe MsgServer checks the configured authority before calling
SetParamsand unwraps the SDK context correctly; returning an emptyMsgUpdateParamsResponsematches the proto. Only nit is the comment still says “akash staking MsgServer interface” even though this is the wasm module, which can be misleading—consider updating the wording.-// NewMsgServerImpl returns an implementation of the akash staking MsgServer interface -// for the provided Keeper. +// NewMsgServerImpl returns an implementation of the wasm MsgServer interface +// for the provided Keeper.x/oracle/keeper/keeper.go (4)
23-24: Fix copy-paste error in comment.The comment says "Keeper of the deployment store" but this is the oracle keeper.
-// Keeper of the deployment store +// keeper is the unexported implementation of the oracle Keeper interface type keeper struct {
36-37: Fix copy-paste error in constructor comment.The comment refers to "take keeper" but this creates an oracle keeper.
-// NewKeeper creates and returns an instance of take keeper +// NewKeeper creates and returns an instance of oracle keeper func NewKeeper(cdc codec.BinaryCodec, skey storetypes.StoreKey, authority string) Keeper {
58-61: Fix copy-paste error in GetAuthority comment.The comment references "x/mint module's authority" but this is the oracle module.
-// GetAuthority returns the x/mint module's authority. +// GetAuthority returns the x/oracle module's authority. func (k *keeper) GetAuthority() string {
63-79: Fix copy-paste errors in SetParams/GetParams comments.Both comments reference "x/take module" but these are oracle module methods.
-// SetParams sets the x/take module parameters. +// SetParams sets the x/oracle module parameters. func (k *keeper) SetParams(ctx sdk.Context, p types.Params) error {-// GetParams returns the current x/take module parameters. +// GetParams returns the current x/oracle module parameters. func (k *keeper) GetParams(ctx sdk.Context) (p types.Params) {x/escrow/query/querier.go (1)
3-12: Consider removing this commented-out code.This entire file contains only commented-out code. If the querier is not needed, consider removing this file entirely rather than maintaining commented code with updated import paths.
_run/node/.envrc (1)
1-1: Ensure shared run config is actually sourcedWith
.envrcexecuted as a shell script, a bare../.envrc_runruns that script in a subprocess; anyexport/env changes there won’t propagate back into this shell. If the intent is to reuse the shared run environment, consider sourcing instead:-../.envrc_run +. ../.envrc_run(or
source ../.envrc_run).x/wasm/simulation/decoder.go (1)
1-17: Remove dead code or implement the decoder properly.This file contains only a package declaration and commented-out code copied from the mint module (references
types.MinterKeyandtypes.Minter). If a store decoder is needed for wasm simulation, it should be implemented with the correct wasm types. Otherwise, consider removing this file to avoid dead code.x/cert/alias.go (1)
10-23: Stale comments reference "provider module" instead of "cert module".The comments on lines 10, 13, 17, and 22 reference "provider module" but this file is in the cert module. This appears to be a pre-existing copy-paste issue but could be cleaned up for clarity.
const ( - // StoreKey represents storekey of provider module + // StoreKey represents storekey of cert module StoreKey = types.StoreKey - // ModuleName represents current module name + // ModuleName represents current module name for cert ModuleName = types.ModuleName ) type ( - // Keeper defines keeper of provider module + // Keeper defines keeper of cert module Keeper = keeper.Keeper ) var ( - // NewKeeper creates new keeper instance of provider module + // NewKeeper creates new keeper instance of cert module NewKeeper = keeper.NewKeeper )_run/.envrc (1)
3-9: Consider resetting terminal color after error messages.The ANSI escape sequences set the text to red but don't reset it afterward, which could affect subsequent terminal output if the script is sourced in a context where execution continues.
if ! has grpcurl ; then - echo -e "\033[31mgrpcurl is not installed"; exit 1 + echo -e "\033[31mgrpcurl is not installed\033[0m"; exit 1 fi if ! has tqdm ; then - echo -e "\033[31mtqdm is not installed. https://github.com/tqdm/tqdm"; exit 1 + echo -e "\033[31mtqdm is not installed. https://github.com/tqdm/tqdm\033[0m"; exit 1 fi_run/.envrc_run (1)
1-8: LGTM for run-scoped environment setup.The script correctly establishes run-specific paths and exports them for downstream use. The naming convention and directory structure are clear.
Consider adding a guard to verify
AKASH_RUNis set before using it, to provide a clearer error if the parent environment isn't properly configured:source_up .envrc +if [ -z "${AKASH_RUN:-}" ]; then + echo "AKASH_RUN is not set"; exit 1 +fi + AKASH_RUN_NAME=$(basename "$(pwd)") AKASH_RUN_DIR="${AKASH_RUN}/${AKASH_RUN_NAME}"upgrades/software/v2.0.0/upgrade.go (1)
74-79: Consider usingwasmtypes.AllowNobodyfor cleaner code.The
AccessConfigstruct withPermission: wasmtypes.AccessTypeNobodyis functionally correct, but wasmd provides a convenience constantwasmtypes.AllowNobodythat is more idiomatic.- params.CodeUploadAccess = wasmtypes.AccessConfig{ - Permission: wasmtypes.AccessTypeNobody, - } + params.CodeUploadAccess = wasmtypes.AllowNobodymake/init.mk (1)
104-109: Consider adding continuation backslashes for readability.The
WASMVM_LIBSvariable spans multiple lines but lacks line continuation backslashes after each entry except the last. While Make may handle this depending on how it's used, adding explicit backslashes improves clarity.-WASMVM_LIBS := libwasmvm_muslc.x86_64.a \ -libwasmvm_muslc.aarch64.a \ -libwasmvmstatic_darwin.a \ -libwasmvm.aarch64.so \ -libwasmvm.dylib \ -libwasmvm.x86_64.so +WASMVM_LIBS := libwasmvm_muslc.x86_64.a \ + libwasmvm_muslc.aarch64.a \ + libwasmvmstatic_darwin.a \ + libwasmvm.aarch64.so \ + libwasmvm.dylib \ + libwasmvm.x86_64.sox/wasm/keeper/msg_filter.go (1)
63-169: Phase 1 filter correctly covers all current CosmosMsg variants; consider hard-failing unknown Bank ops.The top-level filter is solid: all wasmvm v3
CosmosMsgvariants (Bank, Staking, Distribution, Gov, IBC, IBC2, Custom, Any, Wasm) are explicitly handled, and unknown top-level types are rejected, which is a good fail-secure default. Based on learnings, this matches the current wasmvm v3 field set.One optional hardening: inside
filterBankMessage, any futureBankMsgfields (beyond Send/Burn) would currently pass due to the finalreturn nil. If you want the same fail-secure posture for new Bank operations, you could instead return an error in the finalelse/fallback branch once you’re sure onlySendandBurnexist today.Based on learnings, …
contracts/price-oracle/src/error.rs (1)
4-32: Consider decoupling the error message from a hard-coded exponent
InvalidExponent’s display string bakes inexpected -8, while the actual expected value lives inEXPECTED_EXPOincontract.rs. If you ever change the exponent constant, it’s easy to forget to update this string.You could either:
- Make the message generic (e.g.
"Invalid exponent: {expo}"), or- Define the “expected” value in a shared place and reference it in both the contract logic and error message construction.
contracts/price-oracle/src/querier.rs (1)
1-35: Akash custom query wiring is idiomatic
AkashQuery+CustomQuery+ theAkashQuerierextension onQuerierWrapper<'_, AkashQuery>is a clean pattern and fits well with CosmWasm’s custom query model. No correctness issues detected.One tiny style tweak you could consider is calling
fetch_price_feed_id_from_chainwith&deps.querierdirectly instead of&deps.querier.into()since the latter doesn’t add value here.contracts/price-oracle/src/msg.rs (1)
15-28: UpdatePriceFeed is correctly permissionless per Pyth's pull-oracle design — no security change needed.Pyth's CosmWasm integration uses a permissionless update model: any actor can submit valid signed price update data (from Hermes/Wormhole) and pay the update fee; security is enforced through on-chain signature/merkle proof verification and fee collection, not access control. This is the intended architecture, not a vulnerability.
The documentation inconsistency is valid: add an explicit "permissionless" or "anyone can call" note to
UpdatePriceFeedto match the clarity of the admin-only markers onUpdateFeeandTransferAdmin. This clarifies intent without requiring code changes.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
contracts/price-oracle/Cargo.lockis excluded by!**/*.lockcontracts/price-oracle/artifacts/price_oracle.wasmis excluded by!**/*.wasmgo.sumis excluded by!**/*.sumtests/upgrade/testdata/hackatom.wasmis excluded by!**/*.wasm
📒 Files selected for processing (176)
.env(1 hunks).envrc(1 hunks).github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/tests.yaml(1 hunks).goreleaser-docker.yaml(3 hunks).goreleaser-test-bins.yaml(4 hunks).goreleaser.yaml(6 hunks)Makefile(2 hunks)_run/.env(1 hunks)_run/.envrc(1 hunks)_run/.envrc_run(1 hunks)_run/common-base.mk(1 hunks)_run/common-commands.mk(1 hunks)_run/common.mk(1 hunks)_run/node/.envrc(1 hunks)_run/node/.gitignore(1 hunks)_run/node/Makefile(1 hunks)app/app.go(8 hunks)app/app_configure.go(4 hunks)app/config.go(2 hunks)app/modules.go(4 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(9 hunks)app/testnet.go(1 hunks)app/types/app.go(7 hunks)app/upgrades.go(2 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/config.go(1 hunks)cmd/akash/cmd/root.go(5 hunks)cmd/akash/cmd/testnetify/config.go(1 hunks)cmd/akash/cmd/testnetify/testnetify.go(1 hunks)cmd/akash/cmd/testnetify/utils.go(1 hunks)cmd/akash/main.go(1 hunks)contracts/price-oracle/Cargo.toml(1 hunks)contracts/price-oracle/artifacts/checksums.txt(1 hunks)contracts/price-oracle/src/bin/schema.rs(1 hunks)contracts/price-oracle/src/contract.rs(1 hunks)contracts/price-oracle/src/error.rs(1 hunks)contracts/price-oracle/src/lib.rs(1 hunks)contracts/price-oracle/src/msg.rs(1 hunks)contracts/price-oracle/src/querier.rs(1 hunks)contracts/price-oracle/src/state.rs(1 hunks)docgen/main.go(1 hunks)go.mod(12 hunks)make/cosmwasm.mk(1 hunks)make/init.mk(3 hunks)make/releasing.mk(4 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(1 hunks)make/test-upgrade.mk(1 hunks)meta.json(1 hunks)pubsub/bus_test.go(1 hunks)tests/e2e/certs_cli_test.go(1 hunks)tests/e2e/certs_grpc_test.go(1 hunks)tests/e2e/cli_test.go(1 hunks)tests/e2e/deployment_cli_test.go(1 hunks)tests/e2e/deployment_grpc_test.go(1 hunks)tests/e2e/grpc_test.go(1 hunks)tests/e2e/market_cli_test.go(1 hunks)tests/e2e/market_grpc_test.go(1 hunks)tests/e2e/provider_cli_test.go(1 hunks)tests/e2e/provider_grpc_test.go(1 hunks)tests/upgrade/config-v0.24.0.tmpl.json(0 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/upgrade_test.go(1 hunks)tests/upgrade/workers_test.go(1 hunks)testutil/network/network.go(1 hunks)testutil/network_suite.go(1 hunks)testutil/sims/simulation_helpers.go(3 hunks)testutil/state/suite.go(1 hunks)testutil/types.go(1 hunks)tools/upgrade-info/main.go(1 hunks)upgrades/software/v1.0.0/audit.go(0 hunks)upgrades/software/v1.0.0/cert.go(0 hunks)upgrades/software/v1.0.0/deployment.go(0 hunks)upgrades/software/v1.0.0/escrow.go(0 hunks)upgrades/software/v1.0.0/init.go(0 hunks)upgrades/software/v1.0.0/market.go(0 hunks)upgrades/software/v1.0.0/provider.go(0 hunks)upgrades/software/v1.0.0/take.go(0 hunks)upgrades/software/v1.0.0/upgrade.go(0 hunks)upgrades/software/v1.1.0/upgrade.go(0 hunks)upgrades/software/v2.0.0/init.go(1 hunks)upgrades/software/v2.0.0/upgrade.go(1 hunks)upgrades/types/types.go(1 hunks)upgrades/upgrades.go(1 hunks)upgrades/upgrades_test.go(1 hunks)util/partialord/internal/dag/dag_test.go(1 hunks)util/partialord/partialord.go(1 hunks)util/partialord/partialord_test.go(1 hunks)util/query/pagination.go(1 hunks)wasmvm.go(1 hunks)x/audit/alias.go(1 hunks)x/audit/genesis.go(1 hunks)x/audit/handler/handler.go(1 hunks)x/audit/handler/handler_test.go(1 hunks)x/audit/handler/msg_server.go(1 hunks)x/audit/keeper/grpc_query_test.go(2 hunks)x/audit/keeper/keeper_test.go(1 hunks)x/audit/keeper/key.go(1 hunks)x/audit/module.go(5 hunks)x/cert/alias.go(1 hunks)x/cert/genesis.go(1 hunks)x/cert/handler/handler.go(1 hunks)x/cert/handler/handler_test.go(1 hunks)x/cert/handler/msg_server.go(1 hunks)x/cert/keeper/grpc_query.go(1 hunks)x/cert/keeper/grpc_query_test.go(1 hunks)x/cert/keeper/keeper_test.go(1 hunks)x/cert/keeper/key.go(1 hunks)x/cert/module.go(5 hunks)x/cert/utils/key_pair_manager.go(1 hunks)x/cert/utils/utils.go(1 hunks)x/deployment/alias.go(1 hunks)x/deployment/genesis.go(1 hunks)x/deployment/handler/handler.go(1 hunks)x/deployment/handler/handler_test.go(1 hunks)x/deployment/handler/server.go(1 hunks)x/deployment/keeper/grpc_query.go(1 hunks)x/deployment/keeper/grpc_query_test.go(1 hunks)x/deployment/keeper/keeper_test.go(1 hunks)x/deployment/module.go(1 hunks)x/deployment/simulation/operations.go(1 hunks)x/escrow/genesis.go(1 hunks)x/escrow/handler/handler.go(1 hunks)x/escrow/handler/server.go(1 hunks)x/escrow/keeper/grpc_query.go(1 hunks)x/escrow/keeper/grpc_query_test.go(1 hunks)x/escrow/keeper/keeper_test.go(1 hunks)x/escrow/module.go(5 hunks)x/escrow/query/querier.go(1 hunks)x/market/alias.go(1 hunks)x/market/client/rest/params.go(1 hunks)x/market/client/rest/rest.go(1 hunks)x/market/genesis.go(1 hunks)x/market/handler/handler_test.go(1 hunks)x/market/handler/keepers.go(1 hunks)x/market/keeper/grpc_query.go(1 hunks)x/market/keeper/grpc_query_test.go(1 hunks)x/market/keeper/keeper.go(1 hunks)x/market/keeper/keeper_test.go(1 hunks)x/market/module.go(2 hunks)x/market/query/path.go(1 hunks)x/market/simulation/operations.go(1 hunks)x/market/simulation/utils.go(1 hunks)x/oracle/alias.go(1 hunks)x/oracle/genesis.go(1 hunks)x/oracle/handler/server.go(1 hunks)x/oracle/keeper/grpc_query.go(1 hunks)x/oracle/keeper/keeper.go(1 hunks)x/oracle/module.go(1 hunks)x/oracle/simulation/decoder.go(1 hunks)x/oracle/simulation/genesis.go(1 hunks)x/oracle/simulation/proposals.go(1 hunks)x/provider/alias.go(1 hunks)x/provider/genesis.go(1 hunks)x/provider/handler/handler.go(1 hunks)x/provider/handler/handler_test.go(1 hunks)x/provider/handler/server.go(1 hunks)x/provider/keeper/grpc_query_test.go(1 hunks)x/provider/keeper/keeper_test.go(1 hunks)x/provider/module.go(3 hunks)x/provider/simulation/operations.go(1 hunks)x/take/genesis.go(1 hunks)x/take/handler/server.go(1 hunks)x/take/module.go(6 hunks)x/wasm/alias.go(1 hunks)x/wasm/genesis.go(1 hunks)x/wasm/handler/server.go(1 hunks)x/wasm/keeper/grpc_query.go(1 hunks)x/wasm/keeper/keeper.go(1 hunks)x/wasm/keeper/msg_filter.go(1 hunks)x/wasm/module.go(1 hunks)x/wasm/simulation/decoder.go(1 hunks)x/wasm/simulation/genesis.go(1 hunks)x/wasm/simulation/proposals.go(1 hunks)
💤 Files with no reviewable changes (11)
- tests/upgrade/config-v0.24.0.tmpl.json
- upgrades/software/v1.0.0/audit.go
- upgrades/software/v1.0.0/deployment.go
- upgrades/software/v1.0.0/market.go
- upgrades/software/v1.0.0/init.go
- upgrades/software/v1.0.0/cert.go
- upgrades/software/v1.1.0/upgrade.go
- upgrades/software/v1.0.0/upgrade.go
- upgrades/software/v1.0.0/provider.go
- upgrades/software/v1.0.0/escrow.go
- upgrades/software/v1.0.0/take.go
✅ Files skipped from review due to trivial changes (3)
- x/market/client/rest/rest.go
- x/cert/keeper/key.go
- _run/node/.gitignore
🚧 Files skipped from review as they are similar to previous changes (91)
- x/provider/keeper/grpc_query_test.go
- wasmvm.go
- x/market/keeper/grpc_query.go
- x/deployment/module.go
- x/cert/handler/msg_server.go
- x/market/simulation/utils.go
- app/testnet.go
- x/provider/handler/server.go
- tests/upgrade/test-cases.json
- x/audit/handler/handler_test.go
- util/query/pagination.go
- .github/actions/setup-ubuntu/action.yaml
- x/wasm/alias.go
- x/escrow/keeper/grpc_query_test.go
- cmd/akash/cmd/testnetify/utils.go
- x/audit/handler/msg_server.go
- app/sim/sim_utils.go
- x/audit/genesis.go
- testutil/state/suite.go
- x/market/module.go
- x/escrow/genesis.go
- util/partialord/partialord_test.go
- x/deployment/handler/server.go
- tests/e2e/deployment_cli_test.go
- util/partialord/internal/dag/dag_test.go
- x/cert/keeper/grpc_query.go
- x/audit/keeper/key.go
- x/audit/alias.go
- x/cert/utils/utils.go
- x/deployment/handler/handler.go
- x/market/genesis.go
- .env
- tests/e2e/certs_cli_test.go
- tests/e2e/market_grpc_test.go
- contracts/price-oracle/artifacts/checksums.txt
- x/escrow/keeper/keeper_test.go
- x/oracle/handler/server.go
- x/market/client/rest/params.go
- cmd/akash/main.go
- x/oracle/alias.go
- .github/workflows/tests.yaml
- make/test-integration.mk
- _run/common-commands.mk
- x/deployment/simulation/operations.go
- x/market/keeper/keeper_test.go
- x/audit/keeper/keeper_test.go
- make/cosmwasm.mk
- x/market/query/path.go
- tests/e2e/market_cli_test.go
- app/config.go
- x/deployment/handler/handler_test.go
- x/oracle/simulation/proposals.go
- docgen/main.go
- .goreleaser-test-bins.yaml
- upgrades/software/v2.0.0/init.go
- tests/e2e/certs_grpc_test.go
- x/provider/handler/handler_test.go
- x/deployment/keeper/keeper_test.go
- contracts/price-oracle/src/state.rs
- cmd/akash/cmd/app_creator.go
- meta.json
- x/market/handler/keepers.go
- _run/common-base.mk
- x/provider/handler/handler.go
- testutil/types.go
- tests/e2e/provider_grpc_test.go
- .goreleaser-docker.yaml
- .envrc
- x/take/module.go
- testutil/network_suite.go
- make/setup-cache.mk
- x/deployment/genesis.go
- x/provider/keeper/keeper_test.go
- x/audit/handler/handler.go
- util/partialord/partialord.go
- _run/common.mk
- x/market/keeper/keeper.go
- x/market/handler/handler_test.go
- upgrades/types/types.go
- x/provider/module.go
- upgrades/upgrades_test.go
- x/market/alias.go
- x/provider/simulation/operations.go
- app/upgrades.go
- x/cert/genesis.go
- x/provider/genesis.go
- upgrades/upgrades.go
- x/escrow/module.go
- contracts/price-oracle/src/bin/schema.rs
- x/deployment/keeper/grpc_query_test.go
- x/cert/module.go
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.227Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
Repo: akash-network/node PR: 2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.441Z
Learning: In make/releasing.mk, the $(AKASH) target is intentionally marked as .PHONY to force a rebuild every time, even though it produces the akash binary file. This is a deliberate design choice by the maintainers.
Applied to files:
_run/node/Makefilemake/test-upgrade.mkmake/releasing.mkmake/init.mkMakefile
📚 Learning: 2025-11-14T01:24:04.227Z
Learnt from: troian
Repo: akash-network/node PR: 2015
File: x/wasm/keeper/msg_filter.go:0-0
Timestamp: 2025-11-14T01:24:04.227Z
Learning: In wasmvm v3 (v3.0.0+), the CosmosMsg type does NOT contain a Stargate field. The Stargate capability was removed/deprecated in the v3 release. The actual fields in wasmvm v3.0.2 CosmosMsg are: Bank, Custom, Distribution, Gov, IBC, Staking, Any, Wasm, and IBC2.
Applied to files:
x/wasm/keeper/msg_filter.gogo.modcontracts/price-oracle/src/msg.rs
🧬 Code graph analysis (11)
tests/upgrade/workers_test.go (2)
tests/upgrade/types/types.go (3)
RegisterPostUpgradeWorker(38-44)TestWorker(21-23)TestParams(11-19)app/config.go (1)
ModuleBasics(72-74)
cmd/akash/cmd/root.go (2)
app/app.go (1)
DefaultHome(86-86)cmd/akash/cmd/config.go (1)
InitAppConfig(20-31)
x/audit/keeper/grpc_query_test.go (1)
app/export.go (1)
Setup(282-347)
app/sim_test.go (2)
app/app.go (3)
AppName(82-82)NewApp(109-291)AkashApp(96-106)app/config.go (1)
ModuleBasics(72-74)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(134-146)upgrades/types/types.go (1)
IUpgrade(32-37)
x/oracle/keeper/keeper.go (1)
x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
app/app.go (4)
x/cert/alias.go (1)
ModuleName(13-13)x/deployment/alias.go (1)
ModuleName(13-13)x/market/alias.go (1)
ModuleName(13-13)x/provider/alias.go (1)
ModuleName(13-13)
contracts/price-oracle/src/contract.rs (2)
script/semver_funcs.sh (1)
error(22-25)contracts/price-oracle/src/state.rs (2)
new(32-41)default(45-47)
x/wasm/keeper/keeper.go (1)
x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
x/oracle/module.go (2)
x/escrow/module.go (1)
AppModuleSimulation(205-207)x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
x/wasm/module.go (2)
x/escrow/module.go (1)
AppModuleSimulation(205-207)x/escrow/keeper/querier.go (1)
NewQuerier(7-9)
🪛 checkmake (0.2.2)
_run/node/Makefile
[warning] 4-4: Missing required phony target "all"
(minphony)
[warning] 4-4: Missing required phony target "clean"
(minphony)
[warning] 4-4: Missing required phony target "test"
(minphony)
🪛 dotenv-linter (4.0.0)
_run/.env
[warning] 2-2: [UnorderedKey] The AKASH_GAS_ADJUSTMENT key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 3-3: [UnorderedKey] The AKASH_CHAIN_ID key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 5-5: [UnorderedKey] The AKASH_GAS_PRICES key should go before the AKASH_KEYRING_BACKEND key
(UnorderedKey)
[warning] 6-6: [UnorderedKey] The AKASH_GAS key should go before the AKASH_GAS_ADJUSTMENT key
(UnorderedKey)
[warning] 7-7: [UnorderedKey] The AKASH_NODE key should go before the AKASH_YES key
(UnorderedKey)
🪛 golangci-lint (2.5.0)
x/oracle/keeper/grpc_query.go
[error] 11-11: could not import pkg.akt.dev/go/node/oracle/v1 (-: # pkg.akt.dev/go/node/oracle/v1
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:51:44: cannot use m (variable of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to xxx_messageInfo_Params.Marshal: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String)
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:62:31: cannot use m (variable of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to xxx_messageInfo_Params.Merge: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String)
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:68:40: cannot use m (variable of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to xxx_messageInfo_Params.DiscardUnknown: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String)
/tmp/go/.go-mod-cache/pkg.akt.dev/[email protected]/node/oracle/v1/params.pb.go:215:21: cannot use (*Params)(nil) (value of type *Params) as "github.com/cosmos/gogoproto/proto".Message value in argument to proto.RegisterType: *Params does not implement interface{ProtoMessage(); Reset(); String() string} (missing method String))
(typecheck)
⏰ 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). (8)
- GitHub Check: network-upgrade
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: release-dry-run
- GitHub Check: build-bins
- GitHub Check: build-macos
- GitHub Check: coverage
- GitHub Check: tests
| func setupSimulationApp(t *testing.T, msg string) (simtypes.Config, sdkutil.EncodingConfig, dbm.DB, simtestutil.AppOptionsMap, log.Logger, *akash.AkashApp) { | ||
| config := sim.NewConfigFromFlags() | ||
| config.ChainID = AppChainID | ||
|
|
||
| encodingConfig := sdkutil.MakeEncodingConfig() | ||
|
|
||
| akash.ModuleBasics().RegisterInterfaces(encodingConfig.InterfaceRegistry) | ||
|
|
||
| db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", sim.FlagVerboseValue, sim.FlagEnabledValue) | ||
| if skip { | ||
| t.Skip(msg) | ||
| } | ||
| require.NoError(t, err, "simulation setup failed") | ||
|
|
||
| t.Cleanup(func() { | ||
| require.NoError(t, db.Close()) | ||
| require.NoError(t, os.RemoveAll(dir)) | ||
| }) | ||
|
|
||
| appOpts := make(simtestutil.AppOptionsMap) | ||
| appOpts[cflags.FlagHome] = dir // ensure a unique folder | ||
| appOpts[cflags.FlagInvCheckPeriod] = sim.FlagPeriodValue | ||
| app := akash.NewApp(logger, db, nil, true, sim.FlagPeriodValue, map[int64]bool{}, encodingConfig, appOpts, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID)) | ||
|
|
||
| require.Equal(t, akash.AppName, app.Name()) | ||
| return config, encodingConfig, db, appOpts, logger, app | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Search for NewApp function definition in the codebase
fd -e "\.go$" | xargs grep -l "func NewApp" | head -20Repository: akash-network/node
Length of output: 44
🏁 Script executed:
# Search more broadly for NewApp definition
rg "func NewApp" --type go -A 20Repository: akash-network/node
Length of output: 11220
🏁 Script executed:
# Get the NewApp function implementation
sed -n '/^func NewApp(/,/^func [A-Z]/p' app/app.go | head -100Repository: akash-network/node
Length of output: 3294
🏁 Script executed:
# Search for FlagInvCheckPeriod usage
rg "FlagInvCheckPeriod" --type go -B 2 -A 2Repository: akash-network/node
Length of output: 1127
Remove the redundant appOpts[cflags.FlagInvCheckPeriod] assignment.
The setupSimulationApp helper sets invCheckPeriod both in appOpts (line 547) and as a direct parameter to NewApp (line 548), but NewApp only uses the direct parameter. Remove line 547 to eliminate the redundant assignment. The production code pattern (app_creator.go) reads from appOpts before passing to NewApp, but in this test helper, the value is passed directly and the appOpts entry is unused.
🤖 Prompt for AI Agents
In app/sim_test.go around lines 526 to 552, the test helper redundantly sets
appOpts[cflags.FlagInvCheckPeriod] = sim.FlagPeriodValue and also passes
sim.FlagPeriodValue directly to akash.NewApp; remove the
appOpts[cflags.FlagInvCheckPeriod] assignment (line setting invCheckPeriod in
appOpts) so the value is only provided via the direct NewApp parameter, and
ensure no other test code relies on that appOpts entry before running.
| pub fn execute_update_price_feed( | ||
| deps: DepsMut<AkashQuery>, | ||
| env: Env, | ||
| info: MessageInfo, | ||
| price: Uint128, | ||
| conf: Uint128, | ||
| expo: i32, | ||
| publish_time: i64, | ||
| ) -> Result<Response, ContractError> { | ||
| let config = CONFIG.load(deps.storage)?; | ||
|
|
||
| // Check if sufficient fee was paid (CosmWasm 3.x uses Uint256 for coin amounts) | ||
| let sent_amount = info | ||
| .funds | ||
| .iter() | ||
| .find(|coin| coin.denom == "uakt") | ||
| .map(|coin| coin.amount) | ||
| .unwrap_or_else(Uint256::zero); | ||
|
|
||
| if sent_amount < config.update_fee { | ||
| return Err(ContractError::InsufficientFunds { | ||
| required: config.update_fee.to_string(), | ||
| sent: sent_amount.to_string(), | ||
| }); | ||
| } | ||
|
|
||
| // Validate price data | ||
| if price.is_zero() { | ||
| return Err(ContractError::ZeroPrice {}); | ||
| } | ||
|
|
||
| // Validate exponent | ||
| if expo != EXPECTED_EXPO { | ||
| return Err(ContractError::InvalidExponent { expo }); | ||
| } | ||
|
|
||
| // Check staleness | ||
| let current_time = env.block.time.seconds() as i64; | ||
| if current_time - publish_time > MAX_STALENESS { | ||
| return Err(ContractError::StalePriceData { | ||
| current_time, | ||
| publish_time, | ||
| }); | ||
| } | ||
|
|
||
| // Validate confidence interval (should not exceed 5% of price) | ||
| let max_conf = price.multiply_ratio(5u128, 100u128); | ||
| if conf > max_conf { | ||
| return Err(ContractError::HighConfidence { | ||
| conf: conf.to_string(), | ||
| }); | ||
| } | ||
|
|
||
| // Load existing price feed to get previous publish time | ||
| let mut price_feed = PRICE_FEED.load(deps.storage)?; | ||
|
|
||
| // Ensure new price is not older than current price | ||
| if publish_time <= price_feed.publish_time { | ||
| return Err(ContractError::InvalidPriceData { | ||
| reason: format!( | ||
| "New publish time {} is not newer than current publish time {}", | ||
| publish_time, price_feed.publish_time | ||
| ), | ||
| }); | ||
| } | ||
|
|
||
| // Update price feed | ||
| price_feed.prev_publish_time = price_feed.publish_time; | ||
| price_feed.price = price; | ||
| price_feed.conf = conf; | ||
| price_feed.expo = expo; | ||
| price_feed.publish_time = publish_time; | ||
|
|
||
| PRICE_FEED.save(deps.storage, &price_feed)?; | ||
|
|
||
| Ok(Response::new() | ||
| .add_attribute("method", "update_price_feed") | ||
| .add_attribute("price", price.to_string()) | ||
| .add_attribute("conf", conf.to_string()) | ||
| .add_attribute("publish_time", publish_time.to_string()) | ||
| .add_attribute("updater", info.sender)) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, find the contract.rs file and understand the CONFIG structure
cd contracts/price-oracle/src && grep -n "CONFIG" contract.rs | head -20Repository: akash-network/node
Length of output: 696
🏁 Script executed:
# Search for the Config struct definition
cd contracts/price-oracle/src && rg "struct Config" -A 10Repository: akash-network/node
Length of output: 743
🏁 Script executed:
# Check the instantiate function to see if admin is set
cd contracts/price-oracle/src && rg "fn instantiate" -A 30Repository: akash-network/node
Length of output: 1387
🏁 Script executed:
# Check if there's an execute function that routes to execute_update_price_feed
cd contracts/price-oracle/src && rg "fn execute" -B 5 -A 20 | head -80Repository: akash-network/node
Length of output: 3384
🏁 Script executed:
# Search for any admin or publisher checks in the entire contract
cd contracts/price-oracle/src && rg "admin|publisher|whitelist|sender.*config" -iRepository: akash-network/node
Length of output: 1657
🏁 Script executed:
# Check test files for access control testing
cd contracts/price-oracle && find . -name "*.rs" -type f | xargs grep -l "execute_update_price_feed" | head -5Repository: akash-network/node
Length of output: 79
🏁 Script executed:
# Check test files to understand intended behavior
cd contracts/price-oracle && find . -name "*.rs" -type f | xargs grep -l "test" | head -3Repository: akash-network/node
Length of output: 79
🏁 Script executed:
# Search test file for execute_update_price_feed tests
cd contracts/price-oracle/src && rg "execute_update_price_feed|UpdatePriceFeed" -B 5 -A 15Repository: akash-network/node
Length of output: 3067
🌐 Web query:
CosmWasm oracle contract access control best practices price feed updates
💡 Result:
Here are concise, actionable best practices for access control and safe price-feed updates in CosmWasm oracle contracts.
High-level design
- Use clear roles: immutable readers vs privileged writers (reporters/relayers), an admin/guardian (multisig or timelock), and governance for upgrades. Enforce least privilege. [1][2]
- Keep oracle logic minimal on-chain; separate aggregation/validation from storage to reduce attack surface. [1][4]
Writer/submitter controls
- Require a signer set or threshold signatures (multi-reporter quorum) to accept an update rather than a single key. This reduces single-key compromise risk. [2]
- Gate writer permissions behind a multisig or timelock for administrative powers (add/remove reporters, change thresholds). [1][2]
Sanity checks & validation
- Use anchor or cross-check feeds (TWAP, DEX-derived anchor, or independent providers) and reject updates outside an allowed deviation window. [1][2]
- Validate timestamps and freshness: reject stale updates and require monotonically increasing rounds/epochs. [1][3]
- Always check units/decimals and normalize values before storing/returning. [1]
Update mechanics & safety
- Require explicit update message guarded by access-control checks; separate update execution and read paths. Use try/catch-equivalent defensive reads on callers. [1][4]
- Rate-limit updates (min interval, max change per update) to mitigate flash-manipulation. Implement TWAP or medianization for smoothing. [1][3]
- Provide an emergency failover / pause that can be triggered only by a multisig/timelock; implement a safe fallback oracle. [1][2]
Governance & upgradeability
- Manage sensitive config via timelock-controlled multisig and on-chain governance where appropriate; log and emit events for admin actions. [1][2]
- Minimize immutable trust: if possible use governance to add/remove reporter keys rather than single private keys. [2]
Implementation patterns in CosmWasm
- Use Addr validation (deps.api.addr_validate) and store admin/reporters in storage maps; check caller (env.message.sender) in Execute handlers. Follow CosmWasm execution/message patterns for role-based checks. [4][5]
- Write unit and integration tests with cw-multi-test / cw-simulate and fuzz critical flows (replay, stale updates, decimal edge cases). [4][6]
Operational best practices
- Use multiple independent sources (on-chain & off-chain) and require a quorum or median to accept values. [2][3]
- Regular audits, monitoring, and on-call alerting for abnormal update patterns or large price deviations. [1][3]
References
- Open Price/Oracle patterns (anchor/TWAP, reporters, failover, multisig/timelock controls). [1]
- General DeFi oracle best practices: multi-source aggregation, quorum/threshold, sanity checks. [2][3]
- CosmWasm contract design / execution patterns and examples (access checks, Addr validation, testing tools). [4][5][6]
Sources
[1] OpenZeppelin / Compound-style oracle discussion and recommendations.
[2] Oracle best-practices summaries (multi-source, threshold signatures, anchor checks).
[3] Research on oracle/TWAP robustness and alternatives (medianization, smoothing).
[4] CosmWasm docs & repo (execution patterns, instantiate/execute examples).
[5] CosmWasm examples and cw-plus patterns.
[6] cw-simulate / cw-multi-test testing tooling documentation.
If you want, I can: (a) sketch a minimal CosmWasm execute/instantiate pattern that enforces a reporter quorum and timelocked admin, or (b) review a specific contract snippet and point out access-control gaps. Which would you prefer?
Anyone can arbitrarily update the oracle price as long as they pay the fee
execute_update_price_feed does not restrict the caller (no admin/whitelist check, no signature verification), so any account that pays at least config.update_fee in uakt can overwrite the stored AKT/USD price. This is a notable gap: execute_update_fee and execute_transfer_admin both enforce info.sender == config.admin, but execute_update_price_feed omits this check entirely.
For a price oracle this is a significant integrity risk: a single malicious transaction can push an arbitrary price and block or reverse economic positions downstream, even if honest updaters are active.
Consider tightening this path by:
- Requiring
info.sender == config.adminor a dedicated "publisher" address; or - Maintaining a whitelist of authorized reporters and checking against it; or
- Verifying some form of signed / attested price data on-chain before accepting updates.
CosmWasm oracle best practices recommend access-controlled update paths, multi-source validation, and rate-limiting to mitigate single-sender price manipulation.
| // DefaultGenesisState returns default genesis state as raw bytes for the deployment | ||
| // module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments incorrectly reference "deployment module" instead of "oracle module".
The doc comments at lines 15-16 and 33 reference the deployment module, but this is the oracle module's genesis handling.
-// DefaultGenesisState returns default genesis state as raw bytes for the deployment
-// module.
+// DefaultGenesisState returns default genesis state as raw bytes for the oracle
+// module.
func DefaultGenesisState() *types.GenesisState {-// ExportGenesis returns genesis state for the deployment module
+// ExportGenesis returns genesis state for the oracle module
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {Also applies to: 33-34
🤖 Prompt for AI Agents
In x/oracle/genesis.go around lines 15-16 and 33-34, the doc comments mistakenly
reference the "deployment module" instead of the "oracle module"; update those
comment lines to say "oracle module" (and any nearby occurrences) so the
comments accurately describe the genesis handling for the oracle module.
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.md