-
Notifications
You must be signed in to change notification settings - Fork 255
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds CosmWasm (wasm & awasm) support and wasmvm integration, promotes module path to pkg.akt.dev/node/v2, introduces a v2.0.0 upgrade with wasm store/param migrations, removes many v1.0.0 migrations, adds wasmvm lib caching and build/release changes, and adds run/test scaffolding plus repo-wide import-path migration. Changes
Sequence Diagram(s)sequenceDiagram
participant AppInit as App Init
participant Keeper as Wasm Keeper
participant Module as Wasm AppModule
participant MsgDec as MsgFilter Decorator
participant VM as wasmvm Engine
AppInit->>Keeper: NewKeeper(cdc, storeKey, authority)
AppInit->>Keeper: SetParams(params) / AddOnSetParamsHook(hook)
AppInit->>Module: Register AppModule (Msg & Query servers)
rect rgb(220,235,250)
note right of MsgDec: Phase‑1 message filtering (new path)
end
VM->>MsgDec: DispatchMsg(contractAddr, CosmosMsg)
MsgDec->>MsgDec: FilterMessage(msg)
alt allowed
MsgDec->>VM: forward message
VM-->>MsgDec: events, data
else blocked
MsgDec-->>VM: return error + emit EventMsgBlocked
end
Estimated code review effort🎯 5 (Critical) | ⏱️ ~150 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 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.
Signed-off-by: Artur Troian <[email protected]>
Signed-off-by: Artur Troian <[email protected]>
Signed-off-by: Artur Troian <[email protected]>
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 (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
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 (6)
app/types/app.go (1)
470-490: Fix distribution keeper argument to match wasmd v0.61.6 API.Line 476 wraps the distribution keeper in
distrkeeper.NewQuerier(), but wasmd v0.61.6'swasmkeeper.NewKeeperexpects the concretetypes.DistributionKeeperdirectly, not a querier wrapper. This was flagged in a previous review and appears to remain unaddressed.Apply this diff to fix the distribution keeper argument:
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.Keepers.Cosmos.Transfer, bApp.MsgServiceRouter(), bApp.GRPCQueryRouter(), wasmDir, wasmConfig, wasmtypes.VMConfig{}, wasmCapabilities, authtypes.NewModuleAddress(govtypes.ModuleName).String(), wOpts..., )make/test-integration.mk (2)
22-23: Critical inconsistency:test-integrationmissingwasmvm-libsprerequisite.All other test targets (
test,test-nocache,test-full,test-coverage,test-vet) depend onwasmvm-libs, buttest-integrationdoes not. Since-ldflagsis being used to link the binary, integration tests will likely fail with linker errors if they depend on wasmvm functionality.Apply this diff to add the missing prerequisite:
.PHONY: test-integration -test-integration: +test-integration: wasmvm-libs $(GO_TEST) -v -tags="e2e.integration" -ldflags '$(ldflags)' $(TEST_MODULES)
33-34: Remove-ldflagsfromgo vetcommand.The
-ldflagsflag has no effect ongo vetsince it's a static analysis tool that examines source code without building or linking binaries. Including ldflags here is semantically incorrect.Apply this diff to remove the unnecessary ldflags:
.PHONY: test-vet test-vet: wasmvm-libs - $(GO_VET) -ldflags '$(ldflags)' ./... + $(GO_VET) ./...Note: The
wasmvm-libsprerequisite should remain if vet analyzes code importing wasmvm packages.make/releasing.mk (1)
39-41: Restorewasmvm-libsprerequisite onbuildtarget.The
buildtarget compiles all packages but doesn't ensure wasmvm libraries are available first. On a clean checkout, the linker will fail withld: cannot find -lwasmvm. This is inconsistent with other build targets ($(AKASH),test-bins,docker-image,release) that correctly depend onwasmvm-libs.Apply this diff to add the missing prerequisite:
.PHONY: build -build: +build: wasmvm-libs $(GO_BUILD) -a $(BUILD_FLAGS) ./...Makefile (1)
56-71: 🔴 CRITICAL: GORELEASER_LDFLAGS captures ldflags before all mutations are applied.Line 63 in Makefile assigns
GORELEASER_LDFLAGS := $(ldflags)using immediate evaluation (:=), capturing only the initial version/commit/name flags before ldflags receives:
- Line 65:
-linkmode=external- Lines 68/70:
-extldflags(static linking configuration)- Line 75:
-s -w(strip flags)- Line 79:
$(LDFLAGS)custom flagsGORELEASER_LDFLAGS is then passed to goreleaser docker containers in three targets (make/releasing.mk lines 70, 93, 121) as
BUILD_LDFLAGSenvironment variable. This causes release binaries to lack external linking mode, static linkage flags, and symbol stripping, diverging from local builds.Fix: Change line 63 to use recursive assignment:
-GORELEASER_LDFLAGS := $(ldflags) +GORELEASER_LDFLAGS = $(ldflags)Or move the assignment to after line 80 (after all ldflags mutations complete).
tests/upgrade/upgrade_test.go (1)
757-765: Handle MinDeposit coins safely.This still indexes
MinDeposit[0]. If the chain config ever supplies an empty list or multiple denoms, the test will panic or submit an insufficient deposit, causing the proposal to be rejected. Please guard the empty case and serialize the fullsdk.Coinsvalue instead of a single element.- 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(),
📜 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 (23)
.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)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)
- .github/workflows/tests.yaml
- tests/upgrade/types/types.go
- script/upgrades.sh
- make/init.mk
- upgrades/software/v2.0.0/upgrade.go
- tests/upgrade/test-cases.json
- x/wasm/module.go
- .goreleaser.yaml
- tests/upgrade/test-config.json
- meta.json
- app/app.go
- .github/actions/setup-ubuntu/action.yaml
- make/test-upgrade.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:
make/setup-cache.mkmake/releasing.mkMakefile
🧬 Code graph analysis (2)
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)
⏰ 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: network-upgrade
- 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-macos
- GitHub Check: build-bins
🔇 Additional comments (26)
go.mod (4)
17-18: ✓ CosmWasm dependencies verified correct; smart contract support successfully integrated.The CosmWasm dependencies (
wasmd v0.61.6andwasmvm/v3 v3.0.2) were verified in the previous review to be the latest available versions as of November 5, 2025, with no known HIGH severity vulnerabilities. This enables the smart contract functionality outlined in the PR objectives.
55-79: Akash fork replacements are appropriately maintained for v2 alignment.The updated replace directives for Akash forks (
cometbft,cosmos-sdk,gogoproto) are aligned with the v2 module migration and maintain version compatibility with the ecosystem updates. The version pins (v0.38.19-akash.1,v0.53.4-akash.10,v1.7.0-akash.2) appear consistent with the primary dependency versions.
1-1: Module path migration to v2 is complete; no further action needed.The codebase has been properly updated with all internal imports using the new
pkg.akt.dev/node/v2path. Verification confirms no references to the old module path remain, and go.sum entries are consistent with the go.mod changes.
81-292: Module state is verified and consistent—no action required.The verification confirms that:
- go.mod/go.sum alignment:
go mod verifypassed with "all modules verified," confirming go.sum is already in sync with the 200+ indirect dependency updates.- Transitive dependency resolution: The dependency graph clearly shows CosmWasm dependencies ([email protected] and wasmvm/[email protected]) with no apparent conflicts or unused transitive dependencies.
- Module path migration: The v2→v3 migration for wasmvm is properly integrated and tracked in the dependency graph.
The codebase is in a stable, verified state.
app/types/app.go (6)
17-19: LGTM!The wasm-related imports are correctly added to support both CosmWasm integration and Akash-specific wasm functionality.
Also applies to: 54-54, 58-58, 67-67, 73-74, 84-85
112-112: LGTM!The wasm keeper fields are correctly added to expose both the CosmWasm keeper and the Akash-specific wasm keeper in the application structure.
Also applies to: 123-123
249-251: LGTM!The signature expansion correctly adds the necessary wasm configuration parameters that are standard for CosmWasm integration.
451-455: LGTM!The Akash wasm keeper initialization follows the standard keeper pattern with appropriate parameters.
492-509: LGTM!The IBC routing setup correctly integrates wasm support into both the v1 and v2 IBC routers, with proper module registration for transfer and wasm handlers.
582-582: LGTM!The wasm store keys are correctly added to both the Cosmos and Akash KV store key lists.
Also applies to: 599-599
make/setup-cache.mk (1)
5-5: LGTM!The library cache directory creation is consistent with the existing cache structure and properly integrates with the new wasmvm-libs workflow.
make/test-integration.mk (4)
10-11: LGTM!Correctly adds
wasmvm-libsprerequisite and-ldflagsfor linking with wasmvm libraries.
14-15: LGTM!Correctly adds
wasmvm-libsprerequisite and-ldflagsfor linking with wasmvm libraries.
18-19: LGTM!Correctly adds
wasmvm-libsprerequisite and-ldflagsfor linking with wasmvm libraries.
26-30: LGTM!Correctly adds
wasmvm-libsprerequisite and-ldflagsfor linking with wasmvm libraries.make/releasing.mk (6)
37-37: LGTM!The
binstarget now correctly depends on$(AKASH), which transitively includes thewasmvm-libsprerequisite.
44-45: LGTM!The
$(AKASH)target correctly depends onwasmvm-libsand usesBUILD_FLAGSfor linking with wasmvm libraries.
64-84: LGTM!The
test-binstarget correctly depends onwasmvm-libsand uses standardizedGORELEASER_TAGSandGORELEASER_LDFLAGSenvironment variables.
87-107: LGTM!The
docker-imagetarget correctly depends onwasmvm-libsand uses standardizedGORELEASER_TAGSandGORELEASER_LDFLAGSenvironment variables.
115-138: LGTM!The
releasetarget correctly depends onwasmvm-libs(in addition togen-changelog) and uses standardizedGORELEASER_TAGSandGORELEASER_LDFLAGSenvironment variables.
52-52:akash_docgencorrectly does not requirewasmvm-libsdependency.Verification confirms the code is correct:
docgen/main.gois a pure documentation generator that only importscobra/docand loads the root CLI command to generate markdown. It contains no wasmvm dependencies or business logic that would require wasmvm linking. The line 52 target appropriately omits thewasmvm-libsprerequisite (unlike the main$(AKASH)target at line 44), which is the correct behavior.Makefile (5)
29-39: BUILD_OPTIONS and BUILD_TAGS initialization looks sound.The conditional BUILD_OPTIONS gating on non-Darwin platforms and expanded BUILD_TAGS for cross-platform compatibility are appropriate. Database backend defaulting to goleveldb is reasonable.
41-47: DB_BACKEND conditional logic is correct.The three-way chain properly prioritizes and falls back to goleveldb. No issues here.
49-54: cgotrace and build_tags derivation are correct.The conditional cgotrace append and the space-to-comma conversion for build_tags_cs follow standard Go build patterns. Logic is sound.
74-77: nostrip handling is correct.The default-to-strip behavior (strip symbols/DWARF when nostrip is absent) and addition of -trimpath for reproducibility are appropriate. No issues.
82-85: ****The review comment is factually incorrect. While it claims
GORELEASER_FLAGSlacks ldflags, causing goreleaser to receive incomplete flags, the actual code correctly passes ldflags to goreleaser through a different mechanism.
GORELEASER_FLAGSis indeed dead code—it's never used anywhere. The actualreleasetarget inmake/releasing.mkdoes not reference it. Instead, goreleaser correctly receives ldflags via theBUILD_LDFLAGSenvironment variable, which is set to$(GORELEASER_LDFLAGS)(defined at Makefile line 63). The.goreleaser.yamlconfig consumes this as{{ .Env.BUILD_LDFLAGS }}, ensuring version info, commit hash, and DB backend metadata are all properly included in released binaries.The code is correct as-is; no fixes are required.
Likely an incorrect or invalid review comment.
3699bf9 to
89f9d6e
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 (13)
upgrades/software/v2.0.0/upgrade.go (3)
5-18: Add missing SDK import for context unwrapping.The SDK types import is still missing and is required for properly unwrapping the
context.Contexttosdk.Contextin theUpgradeHandlermethod (see comment below on lines 63, 68, 79).Apply this diff to add the required 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" )
50-66: Unwrap the SDK context before calling keeper and module manager methods.The
RunMigrationsmethod expects ansdk.Context, but the code is passing the rawcontext.Contextfrom the upgrade handler signature. This will cause a runtime panic.Apply this diff to unwrap the context:
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 }
68-85: Use unwrapped SDK context for wasm keeper calls.The
GetParamsandSetParamscalls on lines 68 and 79 are receiving the rawcontext.Context, but they expect ansdk.Context.Apply this diff to use the unwrapped context:
- 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 }Note: The wasm parameter configuration (governance-only code upload with public instantiation) aligns with the security comments and appears intentional.
tests/upgrade/workers_test.go (1)
134-136: Drop the secondUnpackAny.
maccis already obtained from the first unpack + type assertion; callingUnpackAnyagain is redundant noise.Apply this diff:
- err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &macc) - require.NoError(t, err) msg.Sender = macc.GetAddress().String()tests/upgrade/upgrade_test.go (1)
761-765: Guard against empty/multi-denom governance deposits.
params.DepositParams.MinDeposit[0]will panic if the chain config ever setsmin_depositto an empty slice, and it silently drops any additional denoms when multiple are required. Cosmos SDK treatsmin_depositas a fullsdk.Coinslist, so we need to validate non-emptiness and submit the entire set.(docs.cosmos.network)Apply this diff:
- 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(),make/setup-cache.mk (1)
62-66: Add checksum verification for wasmvm library downloads.Downloading prebuilt native libraries without integrity verification poses a security risk. Compromised releases or MITM attacks could inject malicious code into the build.
CosmWasm releases include checksum files. Add verification after download:
$(AKASH_DEVCACHE_LIB)/%: - wget -q --show-progress https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/$* -O $(AKASH_DEVCACHE_LIB)/$* + wget -q --show-progress https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/$* -O $@ || (rm -f $@ && false) + wget -q --show-progress https://github.com/CosmWasm/wasmvm/releases/download/$(WASMVM_VERSION)/checksums.txt -O $(AKASH_DEVCACHE_LIB)/checksums.txt + cd $(AKASH_DEVCACHE_LIB) && sha256sum -c --ignore-missing checksums.txtBased on learnings
make/test-integration.mk (2)
22-23: Add missing wasmvm-libs prerequisite to test-integration.The
test-integrationtarget is inconsistent with other test targets (test,test-nocache,test-full,test-coverage,test-vet) which all depend onwasmvm-libs. Since integration tests may exercise smart contract functionality and the target uses-ldflags, it should also depend onwasmvm-libs..PHONY: test-integration -test-integration: +test-integration: wasmvm-libs $(GO_TEST) -v -tags="e2e.integration" -ldflags '$(ldflags)' $(TEST_MODULES)
33-34: Remove ldflags from go vet - static analysis doesn't link.
go vetperforms static code analysis without building or linking binaries. The-ldflagsflag has no effect here and should be removed to avoid confusion..PHONY: test-vet test-vet: wasmvm-libs - $(GO_VET) -ldflags '$(ldflags)' ./... + $(GO_VET) ./...Note: The
wasmvm-libsprerequisite may still be appropriate if vet analyzes code that imports wasmvm packages.app/app.go (1)
138-146: Fix undefined variable in panic message.Line 144 references
vlin the panic message, butvlis only defined within theifblock scope (line 141). This will cause a compilation error when the panic executes. Use the in-scope variablevalinstead.- 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 note the typo:
aptOptsshould beappOpts.x/wasm/module.go (2)
38-38: Fix copy-paste documentation errors.Multiple comments incorrectly reference "provider module" instead of "wasm module."
Apply this diff:
-// 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) { types.RegisterLegacyAminoCodec(cdc) // nolint staticcheck }-// 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 { return cdc.MustMarshalJSON(DefaultGenesisState()) }-// 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) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(cctx)); err != nil { panic(err)Also applies to: 54-54, 64-65, 86-86
43-43: Fix additional copy-paste documentation errors.Several comments incorrectly reference "take module" or "deployment module" instead of "wasm module."
Apply these fixes:
-// AppModule implements an application module for the take module. +// AppModule implements an application module for the wasm module. type AppModule struct { AppModuleBasic keeper keeper.Keeper }-// QuerierRoute returns the take module's querier route name. +// QuerierRoute returns the wasm module's querier route name. func (am AppModule) QuerierRoute() string { return types.ModuleName }-// 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. func (am AppModule) EndBlock(_ context.Context) error { return nil }-// InitGenesis performs genesis initialization for the take module. It returns +// InitGenesis performs genesis initialization for the wasm module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {-// 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. func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {Also applies to: 122-122, 139-139, 145-145, 153-153
app/types/app.go (1)
476-476: Distribution keeper is wrapped incorrectly.Line 476 wraps the distribution keeper in
distrkeeper.NewQuerier(), but wasmd v0.61.6'sNewKeeperexpects the concretetypes.DistributionKeeperdirectly as parameter 6.Apply this diff:
- distrkeeper.NewQuerier(app.Keepers.Cosmos.Distr), + app.Keepers.Cosmos.Distr,make/releasing.mk (1)
39-41: build target still missing wasmvm-libs prerequisite.Running
make buildon a clean checkout will fail with linker errors ("ld: cannot find -lwasmvm") because wasmvm-libs is not listed as a prerequisite. While the $(AKASH) target correctly depends on wasmvm-libs, developers runningmake builddirectly will hit this issue.Apply this diff:
.PHONY: build -build: +build: wasmvm-libs $(GO_BUILD) -a $(BUILD_FLAGS) ./...Based on learnings.
🧹 Nitpick comments (1)
script/upgrades.sh (1)
548-551: Add explicit file existence validation before using validator.json.The validator.json file is created only during
init()execution (line 389), butprepare_state()is also callable as an independent command (line 739). Ifprepare_stateis invoked without first runninginit, thecatcommand at line 548 will fail with a generic error rather than a clear diagnostic message. Additionally, line 551 now passes the file path directly to thecreate-validatorcommand for v1.0.0-rc0+, making the file dependency more explicit.Add a pre-check to validate file existence and provide actionable guidance:
valdir=$validators_dir/.akash${cnt} valjson=$(cat "$valdir/validator.json") + if [[ ! -f "$valdir/validator.json" ]]; then + echo >&2 "Error: $valdir/validator.json not found. Run 'init' first to initialize validator configuration." + exit 1 + fi 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 + $AKASH tx staking create-validator "$valdir/validator.json" --home="$rvaldir" --from="validator$cnt" --yesAlternatively, document that
initmust be run beforeprepare_statein the USAGE text or function comments.
📜 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 (24)
.envrc(2 hunks).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)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 (6)
- tests/upgrade/test-config.json
- tests/upgrade/types/types.go
- meta.json
- tests/upgrade/test-cases.json
- .envrc
- .github/workflows/tests.yaml
🧰 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/releasing.mkmake/setup-cache.mkMakefilemake/test-upgrade.mkmake/init.mk
🧬 Code graph analysis (4)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(131-142)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)
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)
🪛 GitHub Check: lint-go
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). (3)
- GitHub Check: network-upgrade
- GitHub Check: release-dry-run
- GitHub Check: build-bins
🔇 Additional comments (37)
.github/actions/setup-ubuntu/action.yaml (1)
17-17: Addition ofmusl-toolsaligns with WASM support goal.The addition of
musl-toolsto the CI dependencies is appropriate for enabling CosmWasm compilation, as musl-libc is the standard C library implementation used for WASM builds in the Cosmos ecosystem. The placement at the end of the list and the syntax are correct.Please verify that
musl-toolsis available in the Ubuntu version used by this CI action (typically the latest Ubuntu LTS on GitHub Actions). You may also want to confirm that any WASM-specific Rust targets (if applicable) are installed elsewhere in the CI/CD pipeline or build scripts.upgrades/software/v2.0.0/upgrade.go (3)
20-22: LGTM!The upgrade name constant is properly defined.
24-38: LGTM!The upgrade struct initialization follows standard patterns with proper logger scoping and interface compliance verification.
40-48: LGTM!Store loader correctly registers the new wasm module stores (
awasm.StoreKeyandwasmtypes.StoreKey) for the v2.0.0 upgrade.make/test-upgrade.mk (3)
24-24: LGTM on snapshot source simplification.The consolidation from
sandbox1tosandboxaligns with the infrastructure changes mentioned in the summary.
67-71: LGTM on enhanced test parameters.The addition of
-sourcesdirand-test-casesimproves test configurability and aligns with the broader test infrastructure enhancements.
76-76: LGTM on genesis binary version parameter.Explicitly passing the genesis binary version ensures proper version alignment during test resets.
.goreleaser.yaml (3)
64-67: LGTM on architecture-specific wasmvm libraries.The Linux builds correctly reference architecture-specific muslc libraries for static linking with wasmvm.
Also applies to: 83-86
124-124: LGTM on dockerfile path updates.The dockerfile path updates are consistent across both architectures.
Also applies to: 141-141
25-28: ****When make runs a recipe, some variables defined in the makefile are placed into the environment of each command make invokes. By default, only variables that came from the make's environment or set on its command line are placed into the environment of the commands. You can use the export directive to pass other variables. In this codebase,
BUILD_LDFLAGSis properly exported via the-eflag in the goreleaser invocation withinmake/releasing.mk(lines 70, 93, 121), which sets it from theGORELEASER_LDFLAGSvariable before goreleaser runs. This is the correct pattern—no changes are needed.Likely an incorrect or invalid review comment.
go.mod (2)
1-1: LGTM on v2 module migration and CosmWasm integration.The module path bump to v2 and the addition of CosmWasm dependencies (wasmd v0.61.6, wasmvm/v3 v3.0.2) are appropriate for enabling smart contract functionality. Based on past review discussions, these versions have been confirmed as valid and current.
Also applies to: 17-18
7-51: LGTM on dependency updates.The dependency updates across Cosmos SDK, IBC, and internal packages are consistent with the v2 module migration and wasm integration requirements.
Makefile (2)
29-54: LGTM on build configuration restructuring.The conditional build options, tag management, and database backend selection provide good flexibility for different build scenarios.
56-85: BUILD_LDFLAGS is properly exported—no issue exists.The variable flow is intentional:
make/releasing.mkexportsGORELEASER_LDFLAGS(defined in Makefile line 63) as the environment variableBUILD_LDFLAGSto docker and goreleaser invocations, which the.goreleaser*.yamlconfigs consume via{{ .Env.BUILD_LDFLAGS }}. The naming difference between the Makefile variable (GORELEASER_LDFLAGS) and the exported environment variable (BUILD_LDFLAGS) is a deliberate pattern in the build system, not a mismatch. No changes are required.Likely an incorrect or invalid review comment.
make/setup-cache.mk (1)
5-5: LGTM on lib cache directory creation.The addition of the lib directory to the cache structure supports wasmvm library caching.
make/test-integration.mk (1)
10-19: LGTM on wasmvm-libs prerequisites.The test, test-nocache, and test-full targets correctly depend on wasmvm-libs to ensure wasm libraries are available before running tests.
make/init.mk (2)
28-29: LGTM on wasmvm version tracking variables.The addition of
WASMVM_MOD,WASMVM_VERSION, andRELEASE_TAGprovides proper version tracking for wasmvm dependencies and releases.Also applies to: 77-78, 99-99
101-106: LGTM on wasmvm library list.The
WASMVM_LIBSlist comprehensively covers all required architectures and library types (static muslc for Linux, darwin libraries for macOS, and shared objects).app/app.go (3)
9-9: LGTM on wasm-related imports.The addition of reflect and CosmWasm imports is necessary for wasm integration and type checking.
Also applies to: 29-31
160-172: LGTM on wasm configuration.The wasm configuration is appropriately tuned for production with:
- Memory cache limit (100 MB)
- Smart query gas limit (3M)
- Debug mode disabled
The duplicate
ContractDebugModeassignment flagged in a previous review has been addressed.
323-327: LGTM on wasm module ordering.The block order correctly places the Akash wasm module (
awasm) before the CosmWasm module (wasmtypes.ModuleName), with clear comments explaining the ordering requirement.Also applies to: 356-360
app/types/app.go (7)
17-19: LGTM! Wasm imports added correctly.The wasm-related imports from CosmWasm/wasmd and the v2 module path updates are properly structured to support the wasm integration.
Also applies to: 54-54, 58-58, 67-67, 73-73, 76-86
112-112: LGTM! Wasm keepers added to AppKeepers.Both Cosmos and Akash keeper structures now properly expose their Wasm keeper fields.
Also applies to: 123-123
244-251: LGTM! InitNormalKeepers signature extended for wasm configuration.The function signature correctly accepts the wasm directory, node configuration, and keeper options needed for wasm initialization.
451-455: LGTM! Akash Wasm keeper initialization is correct.The Akash-specific wasm keeper is properly initialized with codec, store key, and authority address.
457-469: LGTM! Wasm keeper options and capabilities configured correctly.The message handler decorator is properly wired, and the custom "akash" capability is added to the built-in wasm capabilities list.
492-509: LGTM! IBC routing for wasm is properly configured.The wasm IBC handler is correctly wired into both the v1 static router and the v2 API router with appropriate module routing.
581-582: LGTM! Wasm store keys added correctly.Both the cosmos wasm store key and the akash wasm store key are properly registered in their respective key lists.
Also applies to: 599-599
make/releasing.mk (4)
37-37: LGTM! bins target correctly depends on $(AKASH).The bins target now depends on the AKASH binary which ensures proper build ordering.
43-45: LGTM! $(AKASH) target correctly depends on wasmvm-libs.The AKASH binary target properly gates on wasmvm-libs and uses BUILD_FLAGS with verbose output.
Based on learnings.
52-52: LGTM! wasmvm-libs dependencies added to all necessary targets.The test-bins, docker-image, and release targets now correctly depend on wasmvm-libs, ensuring the wasm library cache is populated before building.
Also applies to: 64-64, 87-87, 115-115
68-70: LGTM! Environment variables updated consistently.The BUILD_TAGS and BUILD_LDFLAGS environment variables are correctly replaced with GORELEASER_TAGS and GORELEASER_LDFLAGS across test-bins, docker-image, and release targets.
Also applies to: 91-93, 119-121
x/wasm/module.go (5)
128-132: LGTM! Service registration appears correct.The module registers both message and query servers. Based on the previous review discussion, the
NewQuerier()implementation is expected to return a valid query server.
1-24: LGTM! Module structure and imports are correct.The module properly implements all required interfaces (AppModuleBasic, HasGenesisBasics, AppModule, HasConsensusVersion, HasGenesis, HasServices, AppModuleSimulation) and imports are well-organized.
103-163: LGTM! Module lifecycle methods implemented correctly.The constructor, lifecycle hooks (BeginBlock/EndBlock), genesis handling (InitGenesis/ExportGenesis), and consensus version are all properly implemented.
165-183: LGTM! Simulation support properly integrated.The module correctly implements simulation hooks including
GenerateGenesisState,ProposalMsgs,RegisterStoreDecoder, andWeightedOperations.
94-101: CLI panic behavior is consistent with Akash module architecture.The
GetQueryCmdandGetTxCmdmethods panic with the message "akash modules do not export cli commands via cosmos interface" in the wasm module, which is the standard pattern across all other Akash modules (provider, market, escrow, deployment, cert, audit). Only the take module deviates by returning nil. This confirms the panic is an intentional architectural design choice, not an oversight. The code aligns with project conventions.
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 (10)
app/app.go (1)
140-146: Fix undefined identifier in panic - critical compilation error.Line 144 references
vlwhich is only scoped inside theif validblock on line 141. This will cause a compilation error. The panic should usevalinstead.Apply this fix:
- 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()))Note: Also fixes the typo "aptOpts" → "appOpts".
make/setup-cache.mk (1)
62-63: Add checksum verification for downloaded wasmvm libraries.Downloading prebuilt native libraries without integrity verification remains a security risk. The previous review flagged this issue, and it has not yet been addressed.
make/test-integration.mk (2)
22-23: Add missing wasmvm-libs prerequisite for consistency.The
test-integrationtarget remains the only test target without awasmvm-libsprerequisite, while all other test targets (test,test-nocache,test-full,test-coverage,test-vet) require it. This inconsistency could lead to link failures if integration tests require wasmvm libraries.Apply this diff to add the missing prerequisite:
.PHONY: test-integration -test-integration: +test-integration: wasmvm-libs $(GO_TEST) -v -tags="e2e.integration" -ldflags '$(ldflags)' $(TEST_MODULES)
33-34: Remove ldflags from go vet - static analysis doesn't link.The
-ldflagsflag has no effect ongo vetsince it performs static analysis without building or linking binaries. This flag is semantically incorrect.Apply this diff to remove the unnecessary flag:
.PHONY: test-vet test-vet: wasmvm-libs - $(GO_VET) -ldflags '$(ldflags)' ./... + $(GO_VET) ./...upgrades/software/v2.0.0/upgrade.go (1)
50-86: Unwrap SDK context before calling keeper methods.The upgrade handler receives a
context.Contextbut passes it directly to keeper methods (GetParams,SetParams) andRunMigrations, which all expectsdk.Context. This will cause a panic at runtime.Apply this diff to unwrap the context once and use it throughout:
+ sdk "github.com/cosmos/cosmos-sdk/types"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,13 +62,13 @@ // 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 @@ -76,7 +78,7 @@ // 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 }make/releasing.mk (1)
39-41: Restore wasmvm-libs prerequisite to prevent linker failures.The
buildtarget lacks thewasmvm-libsprerequisite, causing linker errors on clean checkouts when the linker cannot findlibwasmvm. While the$(AKASH)target at line 44 correctly depends onwasmvm-libs, thebuildtarget builds all packages and will fail without the libraries present.Apply this diff to restore the prerequisite:
.PHONY: build -build: +build: wasmvm-libs $(GO_BUILD) -a $(BUILD_FLAGS) ./...tests/upgrade/upgrade_test.go (3)
695-704: Remove the commented-out timer/select block.The old
time.NewTimer/selectblock is fully commented out and superseded by thecontext.WithTimeoutlogic below. To keep the test code clean and avoid confusion about which wait path is active, please delete this commented block instead of leaving it in place.
757-765: Fix MinDeposit handling for multi-denom/empty cases in proposal JSON.
params.DepositParams.MinDeposit[0]assumes there is at least one coin and only uses the first denom; this will panic if MinDeposit is empty and will submit an incorrect deposit if multiple denoms are configured. Use the fullsdk.Coinsvalue and guard the empty case instead.Suggested change:
- 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, }
791-793: Fix the block-time comment to match the timeout and correct the typo.The comment says “give it two blocks” but the timeout is 18 seconds, which corresponds to three 6-second blocks, and “commited” is misspelled. Either update the comment to “three blocks” (and fix the spelling) or reduce the timeout to 12 seconds if two blocks is the real intent.
For example, if you intend three blocks:
- // 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)tests/upgrade/workers_test.go (1)
124-137: Remove redundant second UnpackAny of the gov module account.You already unpack into
accand assert it assdk.ModuleAccountI; callingUnpackAnyintomaccagain is unnecessary.Suggested simplification:
- 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() + var acc sdk.AccountI + err = encCfg.InterfaceRegistry.UnpackAny(qResp.Account, &acc) + require.NoError(t, err) + + macc, ok := acc.(sdk.ModuleAccountI) + require.True(t, ok) + + msg.Sender = macc.GetAddress().String()
🧹 Nitpick comments (3)
x/wasm/module.go (1)
38-38: Fix copy-paste errors in documentation comments.Multiple comments incorrectly reference "provider module", "take module", or "deployment module" instead of "wasm module". Update for accuracy:
- Line 38: "provider module" → "wasm module"
- Line 43: "take module" → "wasm module"
- Line 54: "provider module" → "wasm module"
- Lines 64-65: "provider module" → "wasm module"
- Line 86: "provider module" → "wasm module"
- Line 122: "take module" → "wasm module"
- Line 139: "deployment module" → "wasm module"
- Line 145: "take module" → "wasm module"
- Line 153: "take module" → "wasm module"
Also applies to: 43-43, 54-54, 64-65, 86-86, 122-122, 139-139, 145-145, 153-153
tests/upgrade/upgrade_test.go (2)
204-215: cacheDir tied to the first validator’s homedir is acceptable but a bit implicit.Using the first validator’s homedir as
cacheDirfor the proposal JSON ensures the directory exists, but the coupling is somewhat implicit. Consider a dedicatedcachesubdir underworkdir(or similar) for clarity and to decouple proposal artifacts from a specific validator’s home, especially if the validator layout changes in future.Also applies to: 349-356, 510-516, 772-776
719-723: Upgrade height computation and logging are reasonable but depend on a 6s block-time assumption.Deriving
upgradeHeightfromvotePeriod/(6*time.Second)plus a 10-block buffer and logging the vote period/current/upgrade heights is sensible for these e2e tests, but it does encode a 6-second block-time assumption. If the default Akash block time ever changes materially, this test may need tweaking.Also applies to: 735-741, 778-781
📜 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 (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 (3)
- .github/workflows/tests.yaml
- script/upgrades.sh
- tests/upgrade/test-cases.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/init.mkMakefilemake/setup-cache.mkmake/releasing.mkmake/test-upgrade.mk
🧬 Code graph analysis (4)
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)
x/wasm/module.go (1)
x/wasm/simulation/proposals.go (1)
ProposalMsgs(22-30)
upgrades/software/v2.0.0/upgrade.go (2)
app/types/app.go (1)
App(131-142)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: network-upgrade
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: tests
- GitHub Check: lint-shell
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: build-macos
- GitHub Check: build-bins
🔇 Additional comments (25)
.github/actions/setup-ubuntu/action.yaml (1)
17-17: Verify musl-tools is actually required for the wasm build strategy.The search of the codebase found zero references to musl-tools, musl, or x86_64-linux-musl patterns in any build scripts, Dockerfiles, or CI configurations. While adding musl-tools may be preemptive infrastructure for future wasm compilation support, please confirm:
- Whether the wasm/CosmWasm build pipeline in this PR explicitly requires musl-tools
- If musl-tools will be invoked during the build process (directly or through npm dependencies)
- Whether this dependency is necessary in the current PR or deferred to a follow-up
make/init.mk (1)
77-106: LGTM! Wasmvm versioning and library tracking properly configured.The wasmvm module version extraction and library list are well-structured. The multi-platform library set (static
.a, Linux.so, macOS.dylib) correctly covers the cross-compilation targets.app/types/app.go (1)
581-599: LGTM! Wasm store keys properly registered.The wasm module store keys are correctly added to both Cosmos (
wasmtypes.ModuleName) and Akash (awasm.StoreKey) key lists, with appropriate ordering (wasm after IBC transfer as noted in comments).app/app.go (2)
160-172: LGTM! Wasm configuration properly initialized with security limits.The wasm configuration correctly sets:
- Memory cache: 100 MB (prevents DoS)
- Smart query gas limit: 3,000,000 (prevents expensive queries)
- Debug mode: false (production-safe)
323-326: Verify module ordering dependency between awasm and wasmtypes.The comment states "akash wasm module must be prior wasm", placing
awasm.ModuleNamebeforewasmtypes.ModuleName. Please confirm this ordering is required for correct initialization dependencies between the Akash and Cosmos wasm modules.Makefile (2)
67-69: Verify static-link condition matches intended behavior.Line 67 checks
ifeq (static-link,$(findstring static-link,$(BUILD_OPTIONS)))which adds static linking flags whenBUILD_OPTIONScontains "static-link". Since lines 31-33 setBUILD_OPTIONS ?= static-linkby default on non-Darwin, this should work correctly. However, previous reviews suggested this condition was inverted. Please confirm the current logic produces static binaries as expected.
63-78: Confirm whether incomplete ldflags capture is intentional or requires fixing.The verification confirms the original concern is valid. GORELEASER_LDFLAGS on line 63 uses immediate assignment (
:=) and capturesldflagsbefore the subsequent mutations on lines 65, 68, 73, and 77. This incomplete value is then passed to goreleaser viaBUILD_LDFLAGSenvironment variable inmake/releasing.mk(lines 70, 93, 121).As a result, goreleaser's build will be missing:
-linkmode=external-extldflags "-lm -Wl,-z,muldefs -static"(whenstatic-linkoption is used)-s -w(whennostripoption is not used)- Any custom
$(LDFLAGS)valuesSince you noted this was flagged in previous reviews, please confirm: Is this incomplete flag capture intentional for goreleaser builds, or should line 63 be moved to after line 78 or changed to use recursive assignment (
=)?x/wasm/module.go (1)
94-101: CLI commands intentionally omitted per Akash design.The panic messages indicate Akash modules handle CLI commands outside the Cosmos SDK module interface. This is an intentional design choice, not a missing implementation. No changes needed.
tests/upgrade/test-config.json (1)
3-5: LGTM! Single validator setup simplifies upgrade testing.Reducing the test validators from two to one streamlines the upgrade test configuration without compromising test coverage.
wasmvm.go (1)
3-3: The rpath concern does not apply to production deployments.The review comment assumes the rpath path will be embedded in the runtime binary, but the goreleaser configuration reveals that wasmvm is statically linked on Linux (the primary production target). The
-staticflag in the Linux build'sextldflagsmeanslibwasmvm_muslcis embedded directly into the binary—the library is not loaded at runtime, so rpath is irrelevant. The-L./.cache/libis purely a build-time linker search path and does not end up in the final binary.For Darwin builds, external linking is used, but these are built in containers (per
make/releasing.mk) where.cache/libis present, so the rpath is functional during the build process.Likely an incorrect or invalid review comment.
.goreleaser.yaml (1)
67-67: The .cache/lib path is correctly configured and properly mounted in the release build flow.Verification confirms:
wasmvm-libsis an explicit prerequisite for thereleasetarget, ensuring.cache/libis populated before goreleaser runs.cacheis the defaultAKASH_DEVCACHElocation (project root, per.gitignore), configurable via environment- Docker invocation mounts entire
$(AKASH_ROOT)including.cache, so relative path-L./.cache/libresolves correctly inside the container- Static linking (
-lwasmvm_muslc.x86_64) means libraries are linked into the binary and not needed at runtimeThe design is sound. No issues found.
tests/upgrade/types/types.go (1)
14-14: LGTM!The addition of the
SourceDirfield cleanly extends the test parameters to support source directory propagation in upgrade test flows.make/test-upgrade.mk (1)
67-67: LGTM!The addition of
-sourcesdir=$(AKASH_ROOT)properly aligns with the newSourceDirfield inTestParams, enabling tests to reference source files during upgrade scenarios.meta.json (1)
48-52: LGTM!The v2.0.0 upgrade entry is properly structured and defines the upgrade path from v1.0.0, aligning with the new upgrade implementation files added in this PR.
tests/upgrade/sdktypes.go (1)
1-56: LGTM!These SDK-specific types are well-structured for upgrade simulation testing. The approach of defining local types rather than importing SDK-generated types is reasonable for test isolation.
tests/upgrade/upgrade_test.go (3)
232-240: sourcesdir flag + SourceDir wiring looks correct; ensure CI passes the repo root.The new
sourcesdirflag is required, trimmed, and propagated intopostUpgradeParams.SourceDir, which is then used by post-upgrade workers to locate testdata (e.g., wasm binaries). This wiring looks sound, but it assumes-sourcesdirpoints to the repository root; please double-check your CI/e2e harness passes the correct path so file lookups likeSourceDir/tests/upgrade/testdata/...succeed.Also applies to: 270-277, 286-288, 397-399
641-651: Minimal accountResp JSON structs are fine for the gov module-account query.The
baseAccount/moduleAccount/accountRespstructs line up with the expected JSON shape fromquery auth module-account govand keep the parsing scoped to just what you need (the address). This is an acceptable and simple approach for test code.Also applies to: 683-694
802-825: Title-based proposal lookup is a reasonable approach for these tests.Scanning the voting-period proposals in reverse and matching on
Title == l.upgradeNameto locate the proposal ID is a pragmatic strategy in this e2e context and avoids relying on positional assumptions in the proposal list.tests/upgrade/workers_test.go (6)
33-44: Encoding config and client context setup align with the v2 app wiring.Using
sdkutil.MakeEncodingConfigplusakash.ModuleBasics().RegisterInterfacesand then wiring the resulting codec, interface registry, tx config, and amino intosdkclient.Context(with direct sign mode) is consistent with the updated app and Cosmos SDK versions; this looks correct.Also applies to: 48-53, 64-77
78-87: Client discovery with mainCctx and gas settings looks appropriate.Discovering the client from
mainCctxwith explicit gas prices, fixed gas, and adjustment is a reasonable pattern for these e2e tests, andrequire.NotNil(t, mcl)guards against subtle discovery failures.
88-99: Wasm test artifact loading and gzip handling are robust.Reading
hackatom.wasmfromparams.SourceDirand normalizing it to gzipped form usingioutils.IsWasm/GzipIt(or asserting existing gzip) is a solid approach that tolerates either raw or pre-compressed test artifacts.
100-107: MsgStoreCode construction and basic validation look correct.Populating
MsgStoreCodewithSender: mainAddr.String(), the wasm bytes, andInstantiatePermission: &wasmtypes.AllowNobody, then callingValidateBasic, matches CosmWasm expectations and should catch obvious configuration issues early in the test.
109-114: Verify BroadcastMsgs error semantics for the “unauthorized” cases.These assertions assume
mcl.Tx().BroadcastMsgsreturns a Go error (wrappingsdkerrors.ErrUnauthorized) when:
- broadcasting
MsgStoreCodedirectly, and- broadcasting
govv1.MsgSubmitProposalcontaining aMsgStoreCodewhoseSenderis not the gov module account.Some clients instead encode such failures only in
*sdk.TxResponse.Codewhile returningerr == nil. Please confirm that your client implementation surfaces unauthorized conditions aserrorhere; otherwise, these tests may not behave as intended and should assert on the response code instead/as well.Also applies to: 115-123
138-145: Final gov simulation with gov module Sender is a good positive path check.Rebuilding
MsgSubmitProposalwithmsg.Senderset to the gov module account and then simulating the tx viaBroadcastMsgs(..., clt.WithGas(...Simulate: true))is a good way to assert the happy path without actually executing the on-chain upgrade.go.mod (1)
1-3: Module v2 path and dependency set look consistent with the new CosmWasm/SDK integration; confirm toolchain support.The
module pkg.akt.dev/node/v2declaration, upgraded Cosmos SDK/IBCGO/cosmossdk.io deps, and added CosmWasm (wasmd/wasmvm) dependencies line up with the rest of the PR. Just make sure your CI and release build environments are on Go ≥ 1.25.2 so thegodirective and these versions are fully supported end-to-end.Also applies to: 5-53, 55-79
8efe0de to
3118888
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
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: 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
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: 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
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