-
Couldn't load subscription status.
- Fork 249
feat!: cosmos-sdk v0.53.x #2008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds Changes
Sequence Diagram(s)%%{init: {"themeVariables":{"actorBkg":"#E8F1FF","noteBkg":"#F6F8FA"}}}%%
sequenceDiagram
autonumber
actor User
participant CLI as "akash CLI"
participant AppC as "appCreator"
participant App as "AkashApp"
participant Mods as "Module Manager"
User->>CLI: invoke start/init/testnet command
CLI->>AppC: appCreator.newApp(logger, db, traceStore, appOpts)
AppC->>App: construct AkashApp (encodingConfig, options)
App->>App: InitSpecialKeepers()
App->>App: InitNormalKeepers()
App->>Mods: appModules(app, encodingConfig)
Mods-->>App: modules & hooks wired
App-->>CLI: application ready / command result
%%{init: {"themeVariables":{"actorBkg":"#FFF4E6","noteBkg":"#FFF9F0"}}}%%
sequenceDiagram
autonumber
participant GH as "GitHub Actions"
participant SA as "setup-ubuntu action"
participant Runner as "Ubuntu runner"
GH->>SA: trigger setup-ubuntu
SA->>SA: fetch tags / unshallow if needed
SA->>Runner: apt install deps (make, direnv, lz4, pv, jq, ...)
SA->>Runner: setup-node@v4 (Node 18)
SA->>SA: detect Go version (script/tools.sh)
SA->>Runner: setup-go@v5 (GOVERSION)
SA-->>GH: environment prepared for jobs
Estimated code review effort🎯 5 (Critical) | ⏱️ ~180+ minutes Areas needing extra attention:
Possibly related PRs
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: 27
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
script/upgrades.sh (1)
138-177: Correct the xz archive detection globBoth
tar_by_content_typeandcontent_typelook for*.tar.cz*, which is a typo. As written,.tar.xzarchives (the common format) fall through to the default branch and are treated as plain tar files, causing extraction to fail. Update the glob to*.tar.xz*(and, if desired, also handle.txzaliases) so xz-compressed archives are detected correctly before downloading snapshots/genesis data.cmd/akash/cmd/auth.go (1)
69-88: Critical bug: nbf parsing sets exp instead of nbf.Lines 84 and 86 incorrectly assign to
expwhen parsing thenbf(not before) flag. This is a copy-paste error from the expiration parsing logic above. As a result, the nbf flag has no effect and the exp value is overwritten.Apply this diff to fix the bug:
nbfString, err := cmd.Flags().GetString(FlagJWTNbf) if err != nil { return err } // first, attempt to parse expiration value as duration. // fallback to unix timestamp if fails dur, err := time.ParseDuration(nbfString) if err != nil { nbfInt, err := strconv.ParseInt(nbfString, 10, 64) if err != nil { return err } - exp = time.Unix(nbfInt, 0) + nbf = time.Unix(nbfInt, 0) } else { - exp = now.Add(dur) + nbf = now.Add(dur) } }app/app.go (1)
420-429: BlockedAddrs computes wrong addresses (double NewModuleAddress).You’re deriving a module address from an address string. Use module names from ModuleAccountPerms instead.
-func (app *AkashApp) BlockedAddrs() map[string]bool { - perms := ModuleAccountAddrs() - blockedAddrs := make(map[string]bool) - for acc := range perms { - blockedAddrs[authtypes.NewModuleAddress(acc).String()] = !allowedReceivingModAcc[acc] - } - return blockedAddrs -} +func (app *AkashApp) BlockedAddrs() map[string]bool { + perms := ModuleAccountPerms() + blocked := make(map[string]bool, len(perms)) + for moduleName := range perms { + addr := authtypes.NewModuleAddress(moduleName).String() + blocked[addr] = !allowedReceivingModAcc[moduleName] + } + return blocked +}
🧹 Nitpick comments (21)
cmd/akash/cmd/testnetify/cmt_abci.go (1)
11-17: Consider using pointer receiver for consistency.The wrapper uses a value receiver, which means each method call will copy the struct (though it only contains a single pointer field). While this works correctly, pointer receivers are more common for types that implement interfaces, especially ABCI applications.
Apply this diff to use a pointer receiver:
-func NewCometABCIWrapper(app servertypes.ABCI) abci.Application { - return cometABCIWrapper{app: app} +func NewCometABCIWrapper(app servertypes.ABCI) abci.Application { + return &cometABCIWrapper{app: app} } -func (w cometABCIWrapper) Info(_ context.Context, req *abci.RequestInfo) (*abci.ResponseInfo, error) { +func (w *cometABCIWrapper) Info(_ context.Context, req *abci.RequestInfo) (*abci.ResponseInfo, error) { return w.app.Info(req) }Then update all remaining method receivers from
(w cometABCIWrapper)to(w *cometABCIWrapper).cmd/akash/cmd/bech32.go (1)
33-36: Consider returning the error instead of panicking.The function uses
panic(err)at line 35, which is inconsistent with the error-handling pattern used elsewhere in this function (lines 24-25, 29-31). For better error propagation and consistency, consider returning the error instead.Apply this diff for consistent error handling:
bech32Addr, err := bech32.ConvertAndEncode(bech32prefix, bz) if err != nil { - panic(err) + return err }cmd/akash/cmd/genesis.go (3)
51-52: Remove redundant variable assignment.The pattern
depCdc := clientCtx.Codecfollowed bycdc := depCdcis redundant. Either useclientCtx.Codecdirectly or assign it once.- clientCtx := client.GetClientContextFromCmd(cmd) - depCdc := clientCtx.Codec - cdc := depCdc + clientCtx := client.GetClientContextFromCmd(cmd) + cdc := clientCtx.Codec
109-110: Remove redundant variable assignment.Same redundant pattern as in PrepareGenesisCmd (lines 51-52).
- depCdc := clientCtx.Codec - cdc := depCdc + cdc := clientCtx.Codec
264-264: Consider shorter unbonding time for testnet.The testnet unbonding time is set to 2 weeks, matching mainnet. Testnets typically use shorter unbonding periods (e.g., 1-3 days) to allow faster iteration and testing of unbonding flows. This might be intentional, but consider if a shorter period would be more practical for testnet operations.
- genParams.StakingParams.UnbondingTime = time.Hour * 24 * 7 * 2 // 2 weeks + genParams.StakingParams.UnbondingTime = time.Hour * 24 * 3 // 3 dayscmd/akash/cmd/testnetify/utils.go (1)
55-62: Consider clarifying the context nesting pattern and documenting the block parameter.The function is correct but has two clarity issues:
Context variable shadowing: Line 57 shadows the
ctxvariable, making it harder to follow the context chain. The pattern works (cancelFn cancels the parent context, which propagates to the errgroup's derived context), but consider using distinct variable names.Missing parameter documentation: The
blockparameter has no explanation. Add a brief comment describing its purpose in the signal handling behavior.Apply this diff to improve clarity:
-func getCtx(sctx *sdksrv.Context, block bool) (*errgroup.Group, context.Context) { - ctx, cancelFn := context.WithCancel(context.Background()) - g, ctx := errgroup.WithContext(ctx) +// getCtx creates an errgroup with a cancellable context and wires up signal handlers. +// If block is true, the signal listener will block until a signal is received. +func getCtx(sctx *sdksrv.Context, block bool) (*errgroup.Group, context.Context) { + parentCtx, cancelFn := context.WithCancel(context.Background()) + g, ctx := errgroup.WithContext(parentCtx) // listen for quit signals so the calling parent process can gracefully exit server.ListenForQuitSignals(g, block, cancelFn, sctx.Logger) return g, ctx }.github/.repo (1)
1-1: Document the purpose and usage of this manifest file.The
.github/.repofile appears to be a new repository reference or dependency manifest, but its purpose and format are not documented.Consider adding:
- A comment in the file explaining its purpose
- Documentation in the PR description or a README about how this file is used by CI/tooling
For example:
+# Repository dependency manifest for GitHub Actions/workflows github.com/akash-network/nodemake/mod.mk (1)
11-15: Remove commented-out code.The commented Makefile target for
modserves no functional purpose and reduces code maintainability. If this is a placeholder for future implementation, track it in an issue instead.Apply this diff to remove the commented code:
- -#.PHONY: mod -#mod: go.mod -# -#go.mod: -# go mod tidyIf you want to track this for future implementation, open an issue with the desired functionality instead of keeping commented code in the codebase.
make/init.mk (1)
45-47: Clarify the error message.The error message references an empty string
""which may confuse users. Consider making it more explicit about what-modwas actually set to.Apply this diff to improve clarity:
- ifeq ($(GOMOD),$(filter $(GOMOD),mod "")) -$(error '-mod may only be set to readonly or vendor when in workspace mode, but it is set to ""') + ifeq ($(GOMOD),$(filter $(GOMOD),mod "")) +$(error '-mod may only be set to readonly or vendor when in workspace mode, but it is set to "$(GOMOD)"') endifscript/tools.sh (1)
41-42: Potential command not found error.Line 41 uses
whichto check ifgois available, butwhichitself may not be installed in minimal environments. Consider using the more portablecommand -vwhich is a bash built-in.Apply this diff:
# determine go toolchain from go version in go.mod - if which go >/dev/null 2>&1; then + if command -v go >/dev/null 2>&1; then local_goversion=$(GOTOOLCHAIN=local go version | cut -d ' ' -f 3 | sed 's/go*//' | tr -d '\n').envrc (1)
51-58: Document new tool dependencies.The addition of
pvandlz4as required tools is appropriate. Consider documenting these new dependencies in the project's README or setup documentation to help new contributors.app/sim/sim_utils.go (1)
59-69: Consider returning errors instead of panicking.Lines 61-68 use
panic()for file read and unmarshal errors. Since the caller expects errors to be returned (the function signature includeserror), consider returning these errors instead of panicking to allow graceful error handling.Apply this diff:
if config.ParamsFile != "" { bz, err := os.ReadFile(config.ParamsFile) if err != nil { - panic(err) + return nil, err } err = json.Unmarshal(bz, &simState.AppParams) if err != nil { - panic(err) + return nil, err } }Note: This would require updating the function signature to return an error.
go.mod (1)
60-60: Document the Akash CometBFT fork.The replace directive points to
github.com/akash-network/cometbft v0.38.17-akash.2. Consider documenting what patches or changes are included in the Akash fork to help future maintainers understand the divergence from upstream..github/actions/setup-ubuntu/action.yaml (1)
14-30: Addapt-get updatebefore installing packages.Bare
apt installcan fail on GitHub runners because the package index is often stale. Refresh the cache and useapt-getfor consistency.- name: Install dependencies # Shell must explicitly specify the shell for each step. https://github.com/orgs/community/discussions/18597 shell: bash - run: sudo apt install -y make direnv unzip lz4 wget curl npm jq pv coreutils + run: | + sudo apt-get update + sudo apt-get install -y make direnv unzip lz4 wget curl npm jq pv coreutilscmd/akash/cmd/testnetify/testnetify.go (1)
132-135: Verify root directory flag handling.The code retrieves the
FlagTestnetRootDirvalue but doesn't validate if the directory exists or is writable before proceeding. Consider adding validation to provide clear error messages early.Add validation after line 135:
if _, err := os.Stat(rootDir); os.IsNotExist(err) { return fmt.Errorf("root directory does not exist: %s", rootDir) }tests/upgrade/upgrade_test.go (3)
1209-1239: Block watchdog timeout tripled.The initial block window increased from 60 to 180 minutes. This generous timeout accounts for potentially slow initial block production, but consider whether 3 hours is excessive for CI/CD environments.
The timeout is adjusted after 3 blocks (lines 1237-1239) to the normal window. Consider adding a comment explaining why the first few blocks might take significantly longer to produce.
// first few blocks may take a while to produce. - // give a watchdog a generous timeout on them + // give a watchdog a generous timeout on them (e.g., state migrations, genesis setup)
1304-1306: Dual block event detection.The code now checks for both
executedBlockandexecutedBlock2patterns to detect block commits. Ensure both patterns are documented and necessary, or consider consolidating if one is deprecated.Add a comment explaining why two different block event patterns exist:
+ // Match both indexed block events (older) and committed state events (newer) } else if strings.Contains(line, executedBlock) || strings.Contains(line, executedBlock2) {
401-403: Document and track the gas workaround in tests/upgrade/upgrade_test.go:401-403. Add a comment linking to known Cosmos SDK simulation issues (missing/cosmos.tx.v1beta1.Service/Simulateregistration in v0.53), verify your node registers the Tx service with the required patches, or file an issue to track a permanent fix.app/types/app.go (1)
150-157: Subspace accessor with panic on missing subspace.The
GetSubspacemethod panics if a subspace isn't found. While this is acceptable for app initialization failures, consider whether a more informative error that includes available subspaces would help debugging.func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { subspace, found := app.Keepers.Cosmos.Params.GetSubspace(moduleName) if !found { - panic(fmt.Sprintf("params subspace \"%s\" not found", moduleName)) + // Consider listing available subspaces in the panic message for debugging + panic(fmt.Sprintf("params subspace %q not found", moduleName)) } return subspace }cmd/akash/cmd/testnet.go (1)
112-193: Validator initialization loop handles cleanup.The loop properly generates validator directories, keys, and configurations. The error handling removes the output directory on failures, which is good cleanup behavior. However, this could remove other validators if one fails partway through.
Consider more granular cleanup that only removes the failed validator's directory rather than the entire output directory:
if err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm); err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(nodeDir) return err }This way, partial progress is preserved for debugging.
app/app.go (1)
506-519: Thread-safe reflection service cache (optional).If tests construct apps concurrently, guard init with sync.Once.
+import "sync" @@ -var cachedReflectionService *runtimeservices.ReflectionService +var ( + cachedReflectionService *runtimeservices.ReflectionService + reflOnce sync.Once +) func getReflectionService() *runtimeservices.ReflectionService { - if cachedReflectionService != nil { - return cachedReflectionService - } - reflectionSvc, err := runtimeservices.NewReflectionService() - if err != nil { - panic(err) - } - cachedReflectionService = reflectionSvc - return reflectionSvc + reflOnce.Do(func() { + rs, err := runtimeservices.NewReflectionService() + if err != nil { + panic(err) + } + cachedReflectionService = rs + }) + return cachedReflectionService }
📜 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 (151)
.env(1 hunks).envrc(1 hunks).github/.repo(1 hunks).github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/concommits.yaml(1 hunks).github/workflows/release.yaml(3 hunks).github/workflows/tests.yaml(7 hunks).golangci.yaml(1 hunks).goreleaser-docker.yaml(1 hunks).goreleaser-test-bins.yaml(1 hunks).goreleaser.yaml(5 hunks).mockery.yaml(1 hunks)CHANGELOG.md(1 hunks)Makefile(3 hunks)README.md(1 hunks)_build/single-node.sh(2 hunks)_docs/adr/adr-001-network-upgrades.md(1 hunks)app/ante.go(1 hunks)app/app.go(7 hunks)app/app_configure.go(3 hunks)app/app_test.go(0 hunks)app/config.go(2 hunks)app/decorators/gov_filter.go(0 hunks)app/decorators/min_commision.go(0 hunks)app/export.go(6 hunks)app/genesis.go(2 hunks)app/mac.go(2 hunks)app/modules.go(1 hunks)app/option.go(1 hunks)app/params/proto.go(0 hunks)app/sim/sim_config.go(1 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(4 hunks)app/testnet.go(4 hunks)app/types/app.go(3 hunks)app/types/app_test.go(1 hunks)app/upgrades.go(2 hunks)client/client.go(0 hunks)client/utils.go(3 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/auth.go(2 hunks)cmd/akash/cmd/bech32.go(1 hunks)cmd/akash/cmd/flag_test.go(0 hunks)cmd/akash/cmd/genaccounts.go(6 hunks)cmd/akash/cmd/genesis.go(1 hunks)cmd/akash/cmd/root.go(3 hunks)cmd/akash/cmd/testnet.go(1 hunks)cmd/akash/cmd/testnetify/cmt_abci.go(1 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(12 hunks)cmd/akash/cmd/testnetify/utils.go(2 hunks)cmd/akash/main.go(1 hunks)cmd/common/flags.go(0 hunks)cmd/common/signal.go(0 hunks)cmd/common/util.go(0 hunks)cmd/common/util_test.go(0 hunks)docgen/main.go(1 hunks)events/cmd/root.go(0 hunks)events/publish.go(0 hunks)events/publish_test.go(0 hunks)events/query.go(0 hunks)go.mod(1 hunks)install.sh(0 hunks)make/codegen.mk(1 hunks)make/init.mk(4 hunks)make/lint.mk(1 hunks)make/mod.mk(1 hunks)make/releasing.mk(6 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(2 hunks)make/test-simulation.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)pubsub/bus_test.go(1 hunks)script/tools.sh(1 hunks)script/upgrades.sh(13 hunks)sdl/_testdata/deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/private_service.yaml(0 hunks)sdl/_testdata/profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/service-mix.yaml(0 hunks)sdl/_testdata/service-mix2.yaml(0 hunks)sdl/_testdata/simple-double-ram.yaml(0 hunks)sdl/_testdata/simple-gpu.yaml(0 hunks)sdl/_testdata/simple-with-ip.yaml(0 hunks)sdl/_testdata/simple.yaml(0 hunks)sdl/_testdata/simple2.yaml(0 hunks)sdl/_testdata/simple3.yaml(0 hunks)sdl/_testdata/simple4.yaml(0 hunks)sdl/_testdata/storageClass1.yaml(0 hunks)sdl/_testdata/storageClass2.yaml(0 hunks)sdl/_testdata/storageClass3.yaml(0 hunks)sdl/_testdata/storageClass4.yaml(0 hunks)sdl/_testdata/storageClass5.yaml(0 hunks)sdl/_testdata/storageClass6.yaml(0 hunks)sdl/_testdata/v2.1-credentials-error.yaml(0 hunks)sdl/_testdata/v2.1-credentials.yaml(0 hunks)sdl/_testdata/v2.1-deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-private_service.yaml(0 hunks)sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-service-mix.yaml(0 hunks)sdl/_testdata/v2.1-service-mix2.yaml(0 hunks)sdl/_testdata/v2.1-simple-gpu.yaml(0 hunks)sdl/_testdata/v2.1-simple-with-ip.yaml(0 hunks)sdl/_testdata/v2.1-simple.yaml(0 hunks)sdl/_testdata/v2.1-simple2.yaml(0 hunks)sdl/_testdata/v2.1-simple3.yaml(0 hunks)sdl/_testdata/v2.1-simple4.yaml(0 hunks)sdl/coin.go(0 hunks)sdl/coin_test.go(0 hunks)sdl/cpu.go(0 hunks)sdl/cpu_test.go(0 hunks)sdl/expose.go(0 hunks)sdl/full_test.go(0 hunks)sdl/gpu.go(0 hunks)sdl/gpu_test.go(0 hunks)sdl/groupBuilder_v2.go(0 hunks)sdl/groupBuilder_v2_1.go(0 hunks)sdl/memory.go(0 hunks)sdl/placement.go(0 hunks)sdl/pricing.go(0 hunks)sdl/resources.go(0 hunks)sdl/sdl.go(0 hunks)sdl/sdl_test.go(0 hunks)sdl/storage.go(0 hunks)sdl/storage_test.go(0 hunks)sdl/units.go(0 hunks)sdl/units_test.go(0 hunks)sdl/util/util.go(0 hunks)sdl/util/util_test.go(0 hunks)sdl/utils.go(0 hunks)sdl/v2.go(0 hunks)sdl/v2_1.go(0 hunks)sdl/v2_1_ip_test.go(0 hunks)sdl/v2_1_test.go(0 hunks)sdl/v2_ip_test.go(0 hunks)sdl/v2_test.go(0 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.json(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config-gha.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)
💤 Files with no reviewable changes (75)
- app/params/proto.go
- sdl/resources.go
- sdl/_testdata/storageClass6.yaml
- sdl/_testdata/v2.1-credentials-error.yaml
- cmd/common/util_test.go
- sdl/sdl_test.go
- sdl/_testdata/v2.1-simple3.yaml
- sdl/v2_test.go
- sdl/_testdata/profile-svc-name-mismatch.yaml
- sdl/_testdata/simple2.yaml
- sdl/_testdata/v2.1-service-mix2.yaml
- app/decorators/min_commision.go
- sdl/_testdata/simple-double-ram.yaml
- cmd/akash/cmd/flag_test.go
- cmd/common/signal.go
- sdl/units_test.go
- client/client.go
- sdl/storage_test.go
- sdl/memory.go
- sdl/units.go
- app/decorators/gov_filter.go
- sdl/_testdata/storageClass4.yaml
- sdl/_testdata/v2.1-simple.yaml
- sdl/gpu_test.go
- events/cmd/root.go
- sdl/v2_ip_test.go
- sdl/_testdata/v2.1-deployment-svc-mismatch.yaml
- app/app_test.go
- sdl/_testdata/service-mix2.yaml
- events/publish.go
- sdl/_testdata/v2.1-simple-gpu.yaml
- sdl/_testdata/storageClass3.yaml
- sdl/_testdata/deployment-svc-mismatch.yaml
- sdl/groupBuilder_v2_1.go
- sdl/_testdata/v2.1-simple2.yaml
- sdl/gpu.go
- sdl/_testdata/simple3.yaml
- install.sh
- sdl/sdl.go
- sdl/_testdata/v2.1-simple4.yaml
- sdl/placement.go
- sdl/_testdata/v2.1-private_service.yaml
- sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml
- sdl/_testdata/private_service.yaml
- sdl/_testdata/v2.1-service-mix.yaml
- sdl/cpu.go
- sdl/v2.go
- sdl/groupBuilder_v2.go
- sdl/coin_test.go
- sdl/_testdata/simple.yaml
- cmd/common/flags.go
- sdl/_testdata/storageClass2.yaml
- sdl/_testdata/simple4.yaml
- sdl/_testdata/v2.1-credentials.yaml
- sdl/_testdata/simple-gpu.yaml
- sdl/util/util.go
- sdl/_testdata/storageClass5.yaml
- sdl/_testdata/storageClass1.yaml
- sdl/_testdata/simple-with-ip.yaml
- sdl/v2_1_ip_test.go
- sdl/expose.go
- sdl/storage.go
- sdl/_testdata/service-mix.yaml
- sdl/_testdata/v2.1-simple-with-ip.yaml
- events/publish_test.go
- sdl/coin.go
- sdl/cpu_test.go
- sdl/v2_1_test.go
- sdl/v2_1.go
- events/query.go
- sdl/pricing.go
- sdl/utils.go
- sdl/util/util_test.go
- sdl/full_test.go
- cmd/common/util.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.421Z
Learnt from: troian
PR: akash-network/node#2007
File: make/releasing.mk:43-45
Timestamp: 2025-10-08T15:59:15.421Z
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.mk
🧬 Code graph analysis (14)
_build/single-node.sh (1)
script/upgrades.sh (1)
init(267-344)
app/upgrades.go (3)
upgrades/types/types.go (5)
GetUpgradesList(95-97)IterateMigrations(119-125)NewMigrationFn(27-27)NewMigrator(60-65)RegisterMigration(107-117)app/types/app.go (1)
App(123-134)app/app.go (1)
AkashApp(92-102)
cmd/akash/cmd/testnetify/testnetify.go (3)
util/server/server.go (1)
GetAppDBBackend(221-231)app/testnet.go (1)
TestnetConfig(47-52)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(60-66)
cmd/akash/cmd/root.go (5)
app/config.go (1)
ModuleBasics(70-72)app/app.go (1)
DefaultHome(82-82)cmd/akash/cmd/bech32.go (1)
ConvertBech32Cmd(12-47)cmd/akash/cmd/testnetify/testnetify.go (1)
GetCmd(48-263)cmd/akash/cmd/genaccounts.go (1)
AddGenesisAccountCmd(35-195)
cmd/akash/main.go (1)
cmd/akash/cmd/root.go (2)
NewRootCmd(31-46)Execute(49-58)
cmd/akash/cmd/app_creator.go (4)
util/server/server.go (1)
GetAppDBBackend(221-231)app/app.go (2)
NewApp(105-261)AkashApp(92-102)app/testnet.go (2)
TestnetConfig(47-52)InitAkashAppForTestnet(57-284)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(60-66)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (1)
TestnetGov(38-41)
app/types/app.go (3)
x/deployment/keeper/keeper.go (2)
Keeper(36-44)NewKeeper(47-54)x/escrow/keeper/keeper.go (2)
Keeper(30-50)NewKeeper(52-68)x/take/keeper/keeper.go (2)
Keeper(24-30)NewKeeper(33-39)
app/app_configure.go (3)
x/market/alias.go (1)
ModuleName(13-13)x/take/alias.go (1)
ModuleName(11-11)x/cert/alias.go (1)
ModuleName(13-13)
app/export.go (1)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)
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)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
ConsAddress(40-42)AccAddress(32-34)TestnetValidator(44-56)TestnetConfig(60-66)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
app/app.go (5)
app/types/app.go (1)
App(123-134)app/mac.go (2)
ModuleAccountPerms(13-24)ModuleAccountAddrs(26-33)app/app_configure.go (1)
OrderInitGenesis(54-82)app/ante.go (1)
NewAnteHandler(21-61)upgrades/types/types.go (1)
GetHeightPatchesList(99-101)
app/sim_test.go (3)
app/app.go (4)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)AppName(78-78)app/mac.go (1)
ModuleAccountAddrs(26-33)app/config.go (1)
ModuleBasics(70-72)
🪛 actionlint (1.7.7)
.github/workflows/release.yaml
13-13: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
22-22: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
45-45: label "gh-runner-test" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
58-58: shellcheck reported issue in this script: SC2086:info:1:48: Double quote to prevent globbing and word splitting
(shellcheck)
60-60: shellcheck reported issue in this script: SC2086:info:2:40: Double quote to prevent globbing and word splitting
(shellcheck)
.github/workflows/tests.yaml
59-59: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
109-109: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
172-172: shellcheck reported issue in this script: SC2086:info:3:38: Double quote to prevent globbing and word splitting
(shellcheck)
172-172: shellcheck reported issue in this script: SC2086:info:4:40: Double quote to prevent globbing and word splitting
(shellcheck)
178-178: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 markdownlint-cli2 (0.18.1)
_docs/adr/adr-001-network-upgrades.md
43-43: Hard tabs
Column: 1
(MD010, no-hard-tabs)
45-45: Hard tabs
Column: 1
(MD010, no-hard-tabs)
46-46: Hard tabs
Column: 1
(MD010, no-hard-tabs)
47-47: Hard tabs
Column: 1
(MD010, no-hard-tabs)
48-48: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🪛 OSV Scanner (2.2.3)
go.mod
[HIGH] 177-177: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks in github.com/hashicorp/go-getter
(GO-2025-3892)
[HIGH] 177-177: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks
⏰ 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: network-upgrade-names
- GitHub Check: lint-shell
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: build-macos
- GitHub Check: tests
- GitHub Check: build-bins
- GitHub Check: coverage
| - third_party$ | ||
| - builtin$ | ||
| - examples$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix directory exclusion regexes
The expressions third_party$, builtin$, and examples$ only match paths ending exactly with those names, so files like third_party/foo/bar.go still get linted. That defeats the exclusion you just reintroduced and will surface a lot of third-party noise.
Switch to patterns that match the directory prefix instead:
- - third_party$
- - builtin$
- - examples$
+ - third_party/
+ - builtin/
+ - examples/Apply the same adjustment in the formatter exclusions to keep both lists consistent.
Also applies to: 44-46
| // Tell the app's module manager how to set the order of BeginBlockers, which are run at the beginning of every block. | ||
| app.MM.SetOrderBeginBlockers(orderBeginBlockers(app.MM.ModuleNames())...) | ||
| app.MM.SetOrderInitGenesis(OrderInitGenesis(app.MM.ModuleNames())...) | ||
|
|
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.
Set EndBlockers ordering (currently unused OrderEndBlockers).
You define OrderEndBlockers but never set it on the module manager. Add:
// Tell the app's module manager how to set the order of BeginBlockers, which are run at the beginning of every block.
app.MM.SetOrderBeginBlockers(orderBeginBlockers(app.MM.ModuleNames())...)
app.MM.SetOrderInitGenesis(OrderInitGenesis(app.MM.ModuleNames())...)
+ app.MM.SetOrderEndBlockers(OrderEndBlockers(app.MM.ModuleNames())...)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Tell the app's module manager how to set the order of BeginBlockers, which are run at the beginning of every block. | |
| app.MM.SetOrderBeginBlockers(orderBeginBlockers(app.MM.ModuleNames())...) | |
| app.MM.SetOrderInitGenesis(OrderInitGenesis(app.MM.ModuleNames())...) | |
| // Tell the app's module manager how to set the order of BeginBlockers, which are run at the beginning of every block. | |
| app.MM.SetOrderBeginBlockers(orderBeginBlockers(app.MM.ModuleNames())...) | |
| app.MM.SetOrderInitGenesis(OrderInitGenesis(app.MM.ModuleNames())...) | |
| app.MM.SetOrderEndBlockers(OrderEndBlockers(app.MM.ModuleNames())...) |
🤖 Prompt for AI Agents
In app/app.go around lines 194 to 197, you defined OrderEndBlockers but never
applied it to the module manager; call app.MM.SetOrderEndBlockers with
OrderEndBlockers(app.MM.ModuleNames())... immediately after setting
BeginBlockers (and/or InitGenesis) so the module manager uses your EndBlockers
ordering; ensure you import or reference the OrderEndBlockers function name
exactly as declared and place the call before wiring the rest of the app
lifecycle.
| // initialize stores | ||
| app.MountKVStores(app.GetKVStoreKey()) | ||
| app.MountTransientStores(app.GetTransientStoreKey()) | ||
|
|
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.
Mount memory stores to avoid runtime panics.
Memory stores are not mounted; modules that declare MemStoreKey will panic at runtime.
// initialize stores
app.MountKVStores(app.GetKVStoreKey())
app.MountTransientStores(app.GetTransientStoreKey())
+ app.MountMemoryStores(app.GetMemoryStoreKey())🤖 Prompt for AI Agents
In app/app.go around lines 217 to 220, memory stores are not being mounted which
causes modules that declare MemStoreKey to panic at runtime; add a call to mount
them by invoking app.MountMemStores(app.GetMemStoreKey()) (positioned with the
other store mounts) so MemStoreKeys are registered before the app starts.
| GORELEASER_GOWORK := $(GOWORK) | ||
|
|
||
| ifneq ($(GOWORK), off) | ||
| GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work | ||
| endif |
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.
Guard against empty GOWORK before forcing container path.
With the current conditional, a blank $(GOWORK) (the default when no workspace is in use) still hits the ifneq ($(GOWORK), off) branch. That rewrites GORELEASER_GOWORK to /go/src/$(GORELEASER_MOD_MOUNT)/go.work, so the Docker jobs export GOWORK pointing at a file that does not exist. Go treats that as fatal (go: /.../go.work does not exist), breaking the build/release flow for anyone not using a workspace. Please gate the rewrite on the variable being non-empty as well:
-GORELEASER_GOWORK := $(GOWORK)
-ifneq ($(GOWORK), off)
- GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work
+GORELEASER_GOWORK := $(GOWORK)
+ifneq ($(strip $(GOWORK)),)
+ifneq ($(GOWORK), off)
+ GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work
+endif
endif📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| GORELEASER_GOWORK := $(GOWORK) | |
| ifneq ($(GOWORK), off) | |
| GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work | |
| endif | |
| GORELEASER_GOWORK := $(GOWORK) | |
| ifneq ($(strip $(GOWORK)),) | |
| ifneq ($(GOWORK), off) | |
| GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work | |
| endif | |
| endif |
🤖 Prompt for AI Agents
In make/releasing.mk around lines 14–18, the conditional rewrites
GORELEASER_GOWORK even when GOWORK is empty, causing Docker jobs to export a
non-existent path; change the guard so the rewrite only happens when GOWORK is
non-empty and not equal to "off" (e.g., check strip(GOWORK) is not empty AND
GOWORK != off) and only then set GORELEASER_GOWORK to
/go/src/$(GORELEASER_MOD_MOUNT)/go.work; otherwise leave GORELEASER_GOWORK as
$(GOWORK).
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)
app/app_configure.go (1)
48-82: Add capability module first in genesis init order (required for IBC).The comment explicitly notes capability must occur first, but capability module isn’t included. This can break IBC capability scoping and channel creation. Include capability/types and place it at the start.
import ( + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" @@ func OrderInitGenesis(_ []string) []string { return []string{ + capabilitytypes.ModuleName, authtypes.ModuleName, authz.ModuleName, banktypes.ModuleName,Based on learnings
script/upgrades.sh (1)
138-158: Fix tar_by_content_type: correct xz pattern and tar flags.Use .tar.xz and pass -f - to tar. Current .tar.cz and missing -f break extraction.
-function tar_by_content_type() { +function tar_by_content_type() { case "$1" in - *.tar.cz*) - tar_cmd="tar -xJ -" + *.tar.xz*) + tar_cmd="tar -xJf -" ;; *.tar.gz*) tar_cmd="tar xzf -" ;; *.tar.lz4*) tar_cmd="lz4 -d | tar xf -" ;; *.tar.zst*) tar_cmd="zstd -cd | tar xf -" ;; *) tar_cmd="tar xf -" ;; esacapp/types/app_test.go (1)
55-65: Fix test to actually assert type mismatch.The NonMatchingType test uses unknown field "Vals", duplicating the unknown-field test. Use "Val" to hit the type assertion path.
- _, err := FindStructField[int](&testStruct, "Vals") + _, err := FindStructField[int](&testStruct, "Val") require.Error(t, err)cmd/akash/cmd/auth.go (1)
69-88: JWT flags: nbf parsing, scope retrieval, and nbf/exp comparison are incorrect.
- nbf parsing assigns to exp (should assign to nbf).
- JWTScope reads FlagJWTAccess with GetString; should read FlagJWTScope with GetStringSlice.
- Validation should be nbf.Before(exp), not !nbf.After(exp).
Apply this diff:
@@ - nbr := now + nbr := now @@ if cmd.Flags().Changed(FlagJWTNbf) { nbfString, err := cmd.Flags().GetString(FlagJWTNbf) if err != nil { return err } @@ - dur, err := time.ParseDuration(nbfString) + dur, err := time.ParseDuration(nbfString) if err != nil { nbfInt, err := strconv.ParseInt(nbfString, 10, 64) if err != nil { return err } - - exp = time.Unix(nbfInt, 0) + nbr = time.Unix(nbfInt, 0) } else { - exp = now.Add(dur) + nbr = now.Add(dur) } } @@ - if cmd.Flags().Changed(FlagJWTScope) { - scopeString, err := cmd.Flags().GetString(FlagJWTAccess) + if cmd.Flags().Changed(FlagJWTScope) { + scopeSlice, err := cmd.Flags().GetStringSlice(FlagJWTScope) if err != nil { return err } - - if err = scope.UnmarshalCSV(scopeString); err != nil { + if err = scope.UnmarshalCSV(strings.Join(scopeSlice, ",")); err != nil { return err } } @@ - if !nbf.After(exp) { - return fmt.Errorf("`nbf` value is invalid. expected %d (nbf) < %d (exp)", nbf.Unix(), exp.Unix()) + if !nbr.Before(exp) { + return fmt.Errorf("`nbf` value is invalid. expected %d (nbf) < %d (exp)", nbr.Unix(), exp.Unix()) } @@ claims := ajwt.Claims{ RegisteredClaims: jwt.RegisteredClaims{ Issuer: cctx.FromAddress.String(), IssuedAt: jwt.NewNumericDate(now), - NotBefore: jwt.NewNumericDate(nbf), + NotBefore: jwt.NewNumericDate(nbr), ExpiresAt: jwt.NewNumericDate(exp), },Note: variable renamed locally to avoid shadowing; use consistent nbf variable if preferred.
Also applies to: 102-111, 117-119
♻️ Duplicate comments (21)
tests/e2e/deployment_grpc_test.go (3)
142-158: Critical: sdktestutil.GetRequest error handling is still incorrect.This is the same issue flagged in the previous review.
sdktestutil.GetRequestreturns an error for non-200 HTTP responses, sos.Require().NoError(err)at line 146 will fail the test before you can assert the expected error behavior. The error check at lines 151-153 tests the unmarshaling error, not the request error.Apply this diff to fix the error handling:
resp, err := sdktestutil.GetRequest(tc.url) - s.Require().NoError(err) - - var deployments v1beta4.QueryDeploymentsResponse - err = val.ClientCtx.Codec.UnmarshalJSON(resp, &deployments) - if tc.expErr { - s.Require().NotNil(err) - s.Require().Empty(deployments.Deployments) - } else { - s.Require().NoError(err) - s.Require().Len(deployments.Deployments, tc.expLen) - s.Require().Equal(tc.expResp, deployments.Deployments[0]) + s.Require().Error(err) + return } + s.Require().NoError(err) + + var deployments v1beta4.QueryDeploymentsResponse + err = val.ClientCtx.Codec.UnmarshalJSON(resp, &deployments) + s.Require().NoError(err) + s.Require().Len(deployments.Deployments, tc.expLen) + s.Require().Equal(tc.expResp, deployments.Deployments[0])
205-220: Critical: Same GetRequest error handling issue.The same pattern issue exists here: line 209 calls
s.Require().NoError(err)immediately after GetRequest, preventing error-path test cases from working correctly.Apply this diff:
resp, err := sdktestutil.GetRequest(tc.url) - s.Require().NoError(err) - - var out v1beta4.QueryDeploymentResponse - err = s.cctx.Codec.UnmarshalJSON(resp, &out) - if tc.expErr { s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expResp, out) + return } + s.Require().NoError(err) + + var out v1beta4.QueryDeploymentResponse + err = s.cctx.Codec.UnmarshalJSON(resp, &out) + s.Require().NoError(err) + s.Require().Equal(tc.expResp, out)
269-284: Critical: Same GetRequest error handling issue in TestGetGroup.Line 273 has the same problematic pattern as the other two test methods.
Apply this diff:
resp, err := sdktestutil.GetRequest(tc.url) - s.Require().NoError(err) - - var out v1beta4.QueryGroupResponse - err = s.cctx.Codec.UnmarshalJSON(resp, &out) - if tc.expErr { s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expResp, out.Group) + return } + s.Require().NoError(err) + + var out v1beta4.QueryGroupResponse + err = s.cctx.Codec.UnmarshalJSON(resp, &out) + s.Require().NoError(err) + s.Require().Equal(tc.expResp, out.Group)_docs/adr/adr-001-network-upgrades.md (1)
43-48: Hard tabs in code example remain unaddressed.The hard tab characters flagged in the previous review are still present in this code example. As noted in the earlier review comment, replace hard tabs with spaces (4 spaces per tab) to comply with markdown best practices.
make/init.mk (1)
50-54: Fix inverted vendor directory check logic (previously flagged).As noted in a previous review, the condition checks if the vendor directory exists (
ifneq) but then errors saying it hasn't been found. This logic is inverted.Apply this diff to fix the logic:
ifeq ($(GOMOD),vendor) - ifneq ($(wildcard ./vendor/.),) + ifeq ($(wildcard ./vendor/.),) $(error "go -mod is in vendor mode but vendor dir has not been found. consider to run go mod vendor") endif endifmake/releasing.mk (1)
14-18: Guard against empty GOWORK before forcing container path (previously flagged).As noted in a previous review, with the current conditional, a blank
$(GOWORK)still hits theifneq ($(GOWORK), off)branch, causing Docker jobs to exportGOWORKpointing at a non-existent file.Apply this diff:
GORELEASER_GOWORK := $(GOWORK) -ifneq ($(GOWORK), off) +ifneq ($(strip $(GOWORK)),) +ifneq ($(GOWORK), off) GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work +endif endifscript/tools.sh (1)
8-25: Fix typo in debian_deps package name (previously flagged).As noted in a previous review, line 17 contains a typo:
build-essentialsshould bebuild-essential(no trailing 's'). This will cause installation failures on Debian-based systems.Apply this diff:
debian_deps=( "make" - "build-essentials" + "build-essential" "direnv" "unzip"app/upgrades.go (1)
19-21: Don't exit before registering upgrade handlers (previously flagged).As noted in a previous review, returning when the height is marked as skipped stops registration of any upgrade handlers for this run. This means a later plan will panic because no handler was ever set.
Apply this fix to propagate the skip flag:
- if app.Keepers.Cosmos.Upgrade.IsSkipHeight(upgradeInfo.Height) { - return nil - } + skip := app.Keepers.Cosmos.Upgrade.IsSkipHeight(upgradeInfo.Height)Then guard the store-loader section with
if !skip && upgradeInfo.Name == name { ... }.go.mod (1)
177-177: Critical: Address go-getter symlink vulnerability (previously flagged).As noted in a previous review, the dependency
github.com/hashicorp/go-getter v1.7.8has a known HIGH severity vulnerability (GO-2025-3892, GHSA-wjrx-6529-hcj3) related to symlink attacks.Identify if this is direct or transitive and either upgrade or add a replace directive:
#!/bin/bash # Check which module requires go-getter echo "Tracing go-getter dependency:" go mod why github.com/hashicorp/go-getter # Check latest patched version echo -e "\nLatest go-getter release:" gh api repos/hashicorp/go-getter/releases/latest | jq -r '.tag_name'script/upgrades.sh (1)
378-407: Use tar_by_content_type for genesis extraction (prev review).content_type returns only an extension; eval "$tar_cmd" then fails. Use tar_by_content_type on the resolved filename. Same for local file path.
- tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") + tar_cmd=$(tar_by_content_type "$(content_name "${GENESIS_URL}")") @@ - tar_cmd=$(content_type "${GENESIS_URL}") + tar_cmd=$(tar_by_content_type "${GENESIS_URL}")app/testnet.go (1)
265-279: Pass scheduled upgrade height to UpgradeStoreLoader (prev review).Using LatestVersion()+1 mismatches the actual plan height and can halt on boot. Use upgradePlan.Height.
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Heightcmd/akash/cmd/genesis.go (4)
23-30: Migrate gov genesis to v1 types (prev review).Using v1beta1 is deprecated in SDK v0.53+. Switch imports/types and populate the flat v1 Params.
- govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ - govGenState := govtypesv1.DefaultGenesisState() - govGenState.DepositParams = genesisParams.GovParams.DepositParams - govGenState.TallyParams = genesisParams.GovParams.TallyParams - govGenState.VotingParams = genesisParams.GovParams.VotingParams + govGenState := govv1.DefaultGenesisState() + govGenState.Params = genesisParams.GovParams @@ - GovParams govtypesv1.Params + GovParams govv1.Params @@ - genParams.GovParams = govtypesv1.DefaultParams() - genParams.GovParams.DepositParams.MaxDepositPeriod = time.Hour * 24 * 14 // 2 weeks - genParams.GovParams.DepositParams.MinDeposit = sdk.NewCoins(sdk.NewCoin( + genParams.GovParams = govv1.DefaultParams() + genParams.GovParams.MaxDepositPeriod = time.Hour * 24 * 14 // 2 weeks + genParams.GovParams.MinDeposit = sdk.NewCoins(sdk.NewCoin( genParams.NativeCoinMetadatas[0].Base, sdkmath.NewInt(2_500_000_000), )) - genParams.GovParams.TallyParams.Quorum = sdkmath.LegacyMustNewDecFromStr("0.2") // 20% - genParams.GovParams.VotingParams.VotingPeriod = time.Hour * 24 * 3 // 3 days + genParams.GovParams.Quorum = sdkmath.LegacyMustNewDecFromStr("0.2") // 20% + genParams.GovParams.VotingPeriod = time.Hour * 24 * 3 // 3 days @@ - genParams.GovParams.DepositParams.MinDeposit = sdk.NewCoins(sdk.NewCoin( + genParams.GovParams.MinDeposit = sdk.NewCoins(sdk.NewCoin( genParams.NativeCoinMetadatas[0].Base, sdkmath.NewInt(1000000), // 1 AKT )) - genParams.GovParams.TallyParams.Quorum = sdkmath.LegacyMustNewDecFromStr("0.0000000001") // 0.00000001% - genParams.GovParams.VotingParams.VotingPeriod = time.Second * 300 // 300 seconds + genParams.GovParams.Quorum = sdkmath.LegacyMustNewDecFromStr("0.0000000001") // 0.00000001% + genParams.GovParams.VotingPeriod = time.Second * 300 // 300 secondsBased on learnings
Also applies to: 147-157, 182-199, 235-243, 259-274
108-116: Guard Consensus.Params to avoid nil deref (prev review).ConsensusParams is never initialized in Mainnet/Testnet builders. Add a nil check or set a default.
- genDoc.Consensus.Params = genesisParams.ConsensusParams + if genesisParams.ConsensusParams != nil { + genDoc.Consensus.Params = genesisParams.ConsensusParams + }Or initialize ConsensusParams in MainnetGenesisParams/TestnetGenesisParams with tmtypes.DefaultConsensusParams().
136-146: Populate bank genesis for denom metadata and reserve accounts (prev review).NativeCoinMetadatas and StrategicReserveAccounts are never applied to bank genesis, so metadata/balances are lost.
// distribution module genesis distributionGenState := distributiontypes.DefaultGenesisState() @@ appState[distributiontypes.ModuleName] = distributionGenStateBz + + // bank module genesis + bankGenState := banktypes.GetGenesisStateFromAppState(depCdc, appState) + bankGenState.DenomMetadata = genesisParams.NativeCoinMetadatas + if len(genesisParams.StrategicReserveAccounts) > 0 { + bankGenState.Balances = append(bankGenState.Balances, genesisParams.StrategicReserveAccounts...) + } + bankGenStateBz, err := cdc.MarshalJSON(bankGenState) + if err != nil { + return nil, nil, fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + appState[banktypes.ModuleName] = bankGenStateBzAlso applies to: 158-168
159-163: Remove misleading TODO in crisis section (prev review).This references distribution state in the crisis block.
- // TODO Set initial community pool - // distributionGenState.FeePool.CommunityPool = sdk.NewDecCoins()app/types/app_test.go (1)
1-1: Avoid broad revive suppression; scope it or document why.This repeats a prior comment; please either add a brief package doc or narrow the nolint to the specific rule.
Example:
-package types //nolint: revive +// Package types contains app-level helpers and tests. +package typesOr:
-package types //nolint: revive +package types //nolint:revive:package-comments // Test package does not need docstests/upgrade/upgrade_test.go (1)
55-55: Rename the event constant to “Committed”.The newly renamed constant is still spelled
nodeEventBlockCommited(single “t”). Please rename it tonodeEventBlockCommittedand update all references so the identifier matches the intended spelling.Also applies to: 1304-1306
cmd/akash/cmd/testnet.go (1)
384-395: Fix IPv4 increment overflow in calculateIPIncrementing only the last octet silently overflows. Implement carry-over (or detect exhaustion).
Apply one of the following:
Option A (carry-over):
func calculateIP(ip string, i int) (string, error) { ipv4 := net.ParseIP(ip).To4() if ipv4 == nil { return "", fmt.Errorf("%v: non ipv4 address", ip) } - for j := 0; j < i; j++ { - ipv4[3]++ - } + for j := 0; j < i; j++ { + ipv4[3]++ + if ipv4[3] == 0 { // overflow + ipv4[2]++ + if ipv4[2] == 0 { + ipv4[1]++ + if ipv4[1] == 0 { + return "", fmt.Errorf("IP address space exhausted after %d increments", j+1) + } + } + } + } return ipv4.String(), nil }Option B (convert to uint32 with bounds checking) is also acceptable if you prefer.
app/app.go (3)
59-62: IBC import paths are still incorrect (previously flagged).The issues from the previous review remain unresolved:
ibchostshould be imported fromcore/24-host, notcore/exportedibctm(07-tendermint light client) should not be used as a moduleThis causes compile-time breakage when referencing
ibchost.ModuleNameandibctm.ModuleName.Apply the fix from the previous review:
- ibchost "github.com/cosmos/ibc-go/v10/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint" + ibchost "github.com/cosmos/ibc-go/v10/modules/core/24-host"Also remove
ibctm.ModuleNamefrom line 288 inorderBeginBlockers.
194-197: OrderEndBlockers still not applied to module manager (previously flagged).The
OrderEndBlockersfunction is defined but never set on the module manager, meaning end blockers will run in an undefined order. This issue was flagged in the previous review and remains unresolved.Apply the fix from the previous review:
app.MM.SetOrderBeginBlockers(orderBeginBlockers(app.MM.ModuleNames())...) app.MM.SetOrderInitGenesis(OrderInitGenesis(app.MM.ModuleNames())...) + app.MM.SetOrderEndBlockers(OrderEndBlockers(app.MM.ModuleNames())...)
217-220: Memory stores still not mounted (previously flagged).Memory stores are not being mounted, which will cause runtime panics for modules that declare
MemStoreKey. This critical issue was flagged in the previous review and remains unresolved.Apply the fix from the previous review:
app.MountKVStores(app.GetKVStoreKey()) app.MountTransientStores(app.GetTransientStoreKey()) + app.MountMemoryStores(app.GetMemoryStoreKey())
🧹 Nitpick comments (16)
CHANGELOG.md (1)
41-41: Wrap link to satisfy markdownlint MD034.markdownlint flags the bare URL; convert it to a Markdown link to keep the changelog lint-clean.
-* (ibc-go) Use ibc v4.4.0 https://pkg.akt.dev/node/pull/1825 +* (ibc-go) Use ibc v4.4.0 [pkg.akt.dev/node#1825](https://pkg.akt.dev/node/pull/1825)_build/single-node.sh (1)
26-26: Consider guarding the RPC bind overrideBinding RPC to
0.0.0.0is handy for containerized/e2e setups, but it also exposes the port on developer laptops or shared hosts. Please consider making this conditional (env flag or argument) so local runs can stay on127.0.0.1.make/init.mk (1)
45-47: Clarify error message formatting.The error message displays
""which might be confusing. Consider showing the actual value or using a clearer format:ifeq ($(GOMOD),$(filter $(GOMOD),mod "")) -$(error '-mod may only be set to readonly or vendor when in workspace mode, but it is set to ""') +$(error '-mod may only be set to readonly or vendor when in workspace mode, but it is set to "$(GOMOD)"') endifThis will show the actual problematic value rather than always displaying
"".app/genesis.go (1)
33-59: Simplify token filtering logic.The current implementation marshals already-marshaled JSON and uses a buffer unnecessarily. Since
json.RawMessageis already[]byte, you can simplify:func genesisFilterTokens(from GenesisState) GenesisState { genesisState := make(GenesisState) for k, v := range from { - data, err := v.MarshalJSON() - if err != nil { - panic(err) - } - - buf := &bytes.Buffer{} - _, err = buf.Write(data) - if err != nil { - panic(err) - } - - stringData := buf.String() + stringData := string(v) stringDataAfter := strings.ReplaceAll(stringData, `"stake"`, `"uakt"`) if stringData == stringDataAfter { genesisState[k] = v continue } replacementV := json.RawMessage(stringDataAfter) genesisState[k] = replacementV } return genesisState }tests/e2e/deployment_cli_test.go (1)
424-427: Prefer Int-safe subtraction for fees to avoid int64 truncation.Use Int arithmetic instead of SubRaw(Int64). Minor but safer and clearer.
- curOwnerBal := s.getAccountBalance(s.addrDeployer) - s.Require().Equal(ownerBal.SubRaw(fees.GetFee().AmountOf("uakt").Int64()), curOwnerBal) + curOwnerBal := s.getAccountBalance(s.addrDeployer) + s.Require().Equal(ownerBal.Sub(fees.GetFee().AmountOf("uakt")), curOwnerBal) @@ - s.Require().Equal(ownerBal.Sub(s.defaultDeposit.Amount).SubRaw(fees.GetFee().AmountOf("uakt").Int64()), curOwnerBal) + s.Require().Equal(ownerBal.Sub(s.defaultDeposit.Amount).Sub(fees.GetFee().AmountOf("uakt")), curOwnerBal) @@ - s.Require().Equal(ownerBal.Add(s.defaultDeposit.Amount).SubRaw(fees.GetFee().AmountOf("uakt").Int64()), s.getAccountBalance(s.addrDeployer)) + s.Require().Equal(ownerBal.Add(s.defaultDeposit.Amount).Sub(fees.GetFee().AmountOf("uakt")), s.getAccountBalance(s.addrDeployer))Also applies to: 448-451, 528-532
cmd/akash/main.go (1)
15-17: Simple, consistent exit behavior.Returning code 1 on any error is fine. Consider mapping known error types to specific exit codes if CLI consumers rely on them.
cmd/akash/cmd/app_creator.go (3)
54-66: Chain ID fallback depends on appOpts["genesis_file"]; add a safe default pathRelying on appOpts["genesis_file"] can be brittle. If unset, we panic. Fallback to the standard "/config/genesis.json" or server config’s GenesisFile() when the flag is absent.
Proposed diff:
- genDocFile := filepath.Join(homeDir, cast.ToString(appOpts.Get("genesis_file"))) + genFileOpt := cast.ToString(appOpts.Get("genesis_file")) + genDocFile := genFileOpt + if genDocFile == "" { + genDocFile = filepath.Join(homeDir, "config", "genesis.json") + } appGenesis, err := genutiltypes.AppGenesisFromFile(genDocFile)Please verify if your CLI wiring already injects "genesis_file"; if not, the default avoids startup panics.
118-129: Remove unused homePath check; it never influences exporthomePath is validated but not used afterwards. It adds a hard requirement without effect.
Apply:
- homePath, ok := appOpts.Get(cflags.FlagHome).(string) - if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home is not set") - }
153-160: Type assertion for testnet config: prefer a clearer errorPanic is fine here, but the message can include actual type to aid debugging.
Example:
tcfg, valid := appOpts.Get(cflags.KeyTestnetConfig).(akash.TestnetConfig) if !valid { panic(fmt.Sprintf("expected akash.TestnetConfig in %q (got %T)", cflags.KeyTestnetConfig, appOpts.Get(cflags.KeyTestnetConfig))) }cmd/akash/cmd/root.go (1)
35-45: Unify default home between pre-run and executorPersistentPreRunE uses cli.DefaultHome while PrepareBaseCmd uses app.DefaultHome. If these diverge, users will see inconsistent home dirs.
Consider passing app.DefaultHome to both to avoid mismatch:
- PersistentPreRunE: cli.GetPersistentPreRunE(encodingConfig, []string{"AKASH"}, cli.DefaultHome), + PersistentPreRunE: cli.GetPersistentPreRunE(encodingConfig, []string{"AKASH"}, app.DefaultHome),app/export.go (3)
257-258: Check error from ApplyAndReturnValidatorSetUpdatesIgnoring the error may hide staking set update failures during zero-height prep.
Apply:
- _, _ = app.Keepers.Cosmos.Staking.ApplyAndReturnValidatorSetUpdates(ctx) + if _, err := app.Keepers.Cosmos.Staking.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { + panic(err) + }
91-107: Use a consistent address codec for validator addressesYou use Staking.ValidatorAddressCodec().StringToBytes in one loop and sdk.ValAddressFromBech32 in another. Prefer a single approach (the keeper’s codec) to avoid surprises if bech32 config differs.
Example:
valBz, err := app.Keepers.Cosmos.Staking.ValidatorAddressCodec().StringToBytes(val.GetOperator())Apply the same style across the function. Based on learnings
Also applies to: 139-170
70-276: Panic-heavy error handling in zero-height prepPanics are common in legacy zero-height export paths, but returning errors would make the export more predictable from CLI/automation.
Consider refactoring prepForZeroHeightGenesis to return an error and propagate it up, avoiding process aborts.
cmd/akash/cmd/testnet.go (1)
62-63: Update example to Akash binaryLeftover reference to osmosis; change to akash for clarity.
- osmosisd testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 + akash testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2app/app.go (2)
162-167: Track the govRouter hooks ordering issue.The TODO comment identifies a real bug where hooks are set up after routes are registered, potentially causing nil pointer dereferences when gov proposals invoke hooked methods. While deferring until after the SDK 0.47 unfork is reasonable, this should be tracked to prevent it from being forgotten.
Would you like me to open an issue to track this bug? I can draft the issue description based on this TODO comment.
323-339: Remove unused code or clarify its purpose.The
getGenesisTimefunction is markednolint: unused. If this function is truly unused, it should be removed to avoid dead code. If it's intended for future use or called dynamically, the comment should clarify why it's kept.If unused, remove the function:
-func getGenesisTime(appOpts servertypes.AppOptions, homePath string) time.Time { // nolint: unused - if v := appOpts.Get("GenesisTime"); v != nil { - // in tests, GenesisTime is supplied using appOpts - genTime, ok := v.(time.Time) - if !ok { - panic("expected GenesisTime to be a Time value") - } - return genTime - } - - genDoc, err := tmtypes.GenesisDocFromFile(filepath.Join(homePath, "config/genesis.json")) - if err != nil { - panic(err) - } - - return genDoc.GenesisTime -}Otherwise, add a comment explaining why it's kept despite being unused.
📜 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 (151)
.env(1 hunks).envrc(1 hunks).github/.repo(1 hunks).github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/concommits.yaml(1 hunks).github/workflows/release.yaml(3 hunks).github/workflows/tests.yaml(7 hunks).golangci.yaml(1 hunks).goreleaser-docker.yaml(1 hunks).goreleaser-test-bins.yaml(1 hunks).goreleaser.yaml(5 hunks).mockery.yaml(1 hunks)CHANGELOG.md(1 hunks)Makefile(3 hunks)README.md(1 hunks)_build/single-node.sh(2 hunks)_docs/adr/adr-001-network-upgrades.md(1 hunks)app/ante.go(1 hunks)app/app.go(7 hunks)app/app_configure.go(3 hunks)app/app_test.go(0 hunks)app/config.go(2 hunks)app/decorators/gov_filter.go(0 hunks)app/decorators/min_commision.go(0 hunks)app/export.go(6 hunks)app/genesis.go(2 hunks)app/mac.go(2 hunks)app/modules.go(1 hunks)app/option.go(1 hunks)app/params/proto.go(0 hunks)app/sim/sim_config.go(1 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(4 hunks)app/testnet.go(4 hunks)app/types/app.go(3 hunks)app/types/app_test.go(1 hunks)app/upgrades.go(2 hunks)client/client.go(0 hunks)client/utils.go(3 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/auth.go(2 hunks)cmd/akash/cmd/bech32.go(1 hunks)cmd/akash/cmd/flag_test.go(0 hunks)cmd/akash/cmd/genaccounts.go(6 hunks)cmd/akash/cmd/genesis.go(1 hunks)cmd/akash/cmd/root.go(3 hunks)cmd/akash/cmd/testnet.go(1 hunks)cmd/akash/cmd/testnetify/cmt_abci.go(1 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(12 hunks)cmd/akash/cmd/testnetify/utils.go(2 hunks)cmd/akash/main.go(1 hunks)cmd/common/flags.go(0 hunks)cmd/common/signal.go(0 hunks)cmd/common/util.go(0 hunks)cmd/common/util_test.go(0 hunks)docgen/main.go(1 hunks)events/cmd/root.go(0 hunks)events/publish.go(0 hunks)events/publish_test.go(0 hunks)events/query.go(0 hunks)go.mod(1 hunks)install.sh(0 hunks)make/codegen.mk(1 hunks)make/init.mk(4 hunks)make/lint.mk(1 hunks)make/mod.mk(1 hunks)make/releasing.mk(6 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(2 hunks)make/test-simulation.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)pubsub/bus_test.go(1 hunks)script/tools.sh(1 hunks)script/upgrades.sh(13 hunks)sdl/_testdata/deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/private_service.yaml(0 hunks)sdl/_testdata/profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/service-mix.yaml(0 hunks)sdl/_testdata/service-mix2.yaml(0 hunks)sdl/_testdata/simple-double-ram.yaml(0 hunks)sdl/_testdata/simple-gpu.yaml(0 hunks)sdl/_testdata/simple-with-ip.yaml(0 hunks)sdl/_testdata/simple.yaml(0 hunks)sdl/_testdata/simple2.yaml(0 hunks)sdl/_testdata/simple3.yaml(0 hunks)sdl/_testdata/simple4.yaml(0 hunks)sdl/_testdata/storageClass1.yaml(0 hunks)sdl/_testdata/storageClass2.yaml(0 hunks)sdl/_testdata/storageClass3.yaml(0 hunks)sdl/_testdata/storageClass4.yaml(0 hunks)sdl/_testdata/storageClass5.yaml(0 hunks)sdl/_testdata/storageClass6.yaml(0 hunks)sdl/_testdata/v2.1-credentials-error.yaml(0 hunks)sdl/_testdata/v2.1-credentials.yaml(0 hunks)sdl/_testdata/v2.1-deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-private_service.yaml(0 hunks)sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-service-mix.yaml(0 hunks)sdl/_testdata/v2.1-service-mix2.yaml(0 hunks)sdl/_testdata/v2.1-simple-gpu.yaml(0 hunks)sdl/_testdata/v2.1-simple-with-ip.yaml(0 hunks)sdl/_testdata/v2.1-simple.yaml(0 hunks)sdl/_testdata/v2.1-simple2.yaml(0 hunks)sdl/_testdata/v2.1-simple3.yaml(0 hunks)sdl/_testdata/v2.1-simple4.yaml(0 hunks)sdl/coin.go(0 hunks)sdl/coin_test.go(0 hunks)sdl/cpu.go(0 hunks)sdl/cpu_test.go(0 hunks)sdl/expose.go(0 hunks)sdl/full_test.go(0 hunks)sdl/gpu.go(0 hunks)sdl/gpu_test.go(0 hunks)sdl/groupBuilder_v2.go(0 hunks)sdl/groupBuilder_v2_1.go(0 hunks)sdl/memory.go(0 hunks)sdl/placement.go(0 hunks)sdl/pricing.go(0 hunks)sdl/resources.go(0 hunks)sdl/sdl.go(0 hunks)sdl/sdl_test.go(0 hunks)sdl/storage.go(0 hunks)sdl/storage_test.go(0 hunks)sdl/units.go(0 hunks)sdl/units_test.go(0 hunks)sdl/util/util.go(0 hunks)sdl/util/util_test.go(0 hunks)sdl/utils.go(0 hunks)sdl/v2.go(0 hunks)sdl/v2_1.go(0 hunks)sdl/v2_1_ip_test.go(0 hunks)sdl/v2_1_test.go(0 hunks)sdl/v2_ip_test.go(0 hunks)sdl/v2_test.go(0 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.json(1 hunks)tests/upgrade/test-cases.json(1 hunks)tests/upgrade/test-config-gha.json(1 hunks)tests/upgrade/types/types.go(1 hunks)tests/upgrade/upgrade_test.go(14 hunks)
💤 Files with no reviewable changes (75)
- sdl/_testdata/v2.1-simple2.yaml
- sdl/_testdata/v2.1-private_service.yaml
- sdl/_testdata/storageClass6.yaml
- sdl/full_test.go
- sdl/util/util.go
- sdl/_testdata/service-mix.yaml
- sdl/_testdata/storageClass5.yaml
- cmd/common/util_test.go
- sdl/coin.go
- sdl/groupBuilder_v2_1.go
- sdl/util/util_test.go
- app/decorators/gov_filter.go
- sdl/_testdata/v2.1-simple-gpu.yaml
- sdl/placement.go
- cmd/common/util.go
- sdl/_testdata/private_service.yaml
- sdl/_testdata/storageClass1.yaml
- sdl/sdl.go
- sdl/_testdata/v2.1-credentials.yaml
- sdl/resources.go
- cmd/common/signal.go
- events/publish_test.go
- cmd/akash/cmd/flag_test.go
- events/query.go
- app/decorators/min_commision.go
- sdl/v2_test.go
- sdl/gpu.go
- sdl/_testdata/simple-gpu.yaml
- sdl/_testdata/v2.1-service-mix2.yaml
- sdl/storage.go
- sdl/gpu_test.go
- sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml
- sdl/cpu.go
- sdl/_testdata/storageClass4.yaml
- sdl/storage_test.go
- sdl/expose.go
- sdl/units_test.go
- sdl/_testdata/v2.1-simple-with-ip.yaml
- sdl/_testdata/simple4.yaml
- sdl/_testdata/v2.1-deployment-svc-mismatch.yaml
- sdl/v2_1.go
- sdl/_testdata/service-mix2.yaml
- sdl/_testdata/storageClass2.yaml
- sdl/v2.go
- sdl/_testdata/simple-with-ip.yaml
- sdl/_testdata/simple2.yaml
- sdl/_testdata/simple.yaml
- sdl/coin_test.go
- sdl/sdl_test.go
- sdl/cpu_test.go
- sdl/units.go
- sdl/_testdata/v2.1-service-mix.yaml
- sdl/_testdata/profile-svc-name-mismatch.yaml
- sdl/_testdata/v2.1-credentials-error.yaml
- sdl/v2_1_test.go
- sdl/memory.go
- events/publish.go
- sdl/v2_1_ip_test.go
- app/app_test.go
- sdl/_testdata/simple-double-ram.yaml
- sdl/utils.go
- install.sh
- events/cmd/root.go
- sdl/pricing.go
- sdl/_testdata/storageClass3.yaml
- sdl/_testdata/v2.1-simple.yaml
- sdl/_testdata/v2.1-simple4.yaml
- sdl/_testdata/v2.1-simple3.yaml
- sdl/groupBuilder_v2.go
- app/params/proto.go
- sdl/v2_ip_test.go
- sdl/_testdata/simple3.yaml
- cmd/common/flags.go
- sdl/_testdata/deployment-svc-mismatch.yaml
- client/client.go
✅ Files skipped from review due to trivial changes (1)
- .github/.repo
🚧 Files skipped from review as they are similar to previous changes (21)
- app/sim/sim_config.go
- tests/upgrade/types/types.go
- .golangci.yaml
- .github/workflows/concommits.yaml
- .github/actions/setup-ubuntu/action.yaml
- tests/upgrade/config.json
- app/modules.go
- tests/e2e/grpc_test.go
- docgen/main.go
- make/codegen.mk
- .goreleaser-docker.yaml
- .mockery.yaml
- .goreleaser-test-bins.yaml
- make/lint.mk
- cmd/akash/cmd/genaccounts.go
- tests/e2e/market_grpc_test.go
- tests/upgrade/test-config-gha.json
- meta.json
- cmd/akash/cmd/testnetify/config.go
- tests/e2e/cli_test.go
- client/utils.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
PR: akash-network/node#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.mk
🧬 Code graph analysis (13)
app/app_configure.go (3)
x/market/alias.go (1)
ModuleName(13-13)x/take/alias.go (1)
ModuleName(11-11)x/cert/alias.go (1)
ModuleName(13-13)
app/upgrades.go (3)
upgrades/types/types.go (5)
GetUpgradesList(95-97)IterateMigrations(119-125)NewMigrationFn(27-27)NewMigrator(60-65)RegisterMigration(107-117)app/types/app.go (1)
App(123-134)app/app.go (1)
AkashApp(92-102)
cmd/akash/cmd/testnetify/testnetify.go (2)
util/server/server.go (1)
GetAppDBBackend(221-231)app/testnet.go (1)
TestnetConfig(47-52)
_build/single-node.sh (1)
script/upgrades.sh (1)
init(267-344)
app/export.go (2)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)app/config.go (1)
ModuleBasics(70-72)
cmd/akash/cmd/root.go (6)
app/config.go (1)
ModuleBasics(70-72)app/app.go (1)
DefaultHome(82-82)cmd/akash/cmd/bech32.go (1)
ConvertBech32Cmd(12-47)cmd/akash/cmd/auth.go (1)
AuthCmd(24-32)cmd/akash/cmd/testnetify/testnetify.go (1)
GetCmd(48-263)cmd/akash/cmd/genaccounts.go (1)
AddGenesisAccountCmd(35-195)
app/types/app.go (6)
x/deployment/keeper/keeper.go (2)
Keeper(36-44)NewKeeper(47-54)x/escrow/keeper/keeper.go (2)
Keeper(30-50)NewKeeper(52-68)x/take/keeper/keeper.go (2)
Keeper(24-30)NewKeeper(33-39)testutil/state/suite.go (1)
Keepers(50-59)x/take/alias.go (2)
StoreKey(9-9)ModuleName(11-11)x/market/hooks/hooks.go (1)
Hooks(13-16)
cmd/akash/cmd/app_creator.go (3)
util/server/server.go (1)
GetAppDBBackend(221-231)app/app.go (2)
NewApp(105-261)AkashApp(92-102)app/testnet.go (2)
TestnetConfig(47-52)InitAkashAppForTestnet(57-284)
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)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
ConsAddress(40-42)AccAddress(32-34)TestnetValidator(44-56)TestnetConfig(60-66)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
cmd/akash/main.go (1)
cmd/akash/cmd/root.go (2)
NewRootCmd(31-46)Execute(49-58)
app/app.go (5)
app/types/app.go (1)
App(123-134)app/mac.go (2)
ModuleAccountPerms(13-24)ModuleAccountAddrs(26-33)app/app_configure.go (1)
OrderInitGenesis(54-82)app/ante.go (1)
NewAnteHandler(21-61)upgrades/types/types.go (1)
GetHeightPatchesList(99-101)
app/sim_test.go (3)
app/app.go (4)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)AppName(78-78)app/mac.go (1)
ModuleAccountAddrs(26-33)app/config.go (1)
ModuleBasics(70-72)
🪛 actionlint (1.7.8)
.github/workflows/tests.yaml
98-98: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
109-109: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
172-172: shellcheck reported issue in this script: SC2086:info:3:38: Double quote to prevent globbing and word splitting
(shellcheck)
172-172: shellcheck reported issue in this script: SC2086:info:4:40: Double quote to prevent globbing and word splitting
(shellcheck)
178-178: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
.github/workflows/release.yaml
13-13: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
22-22: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
45-45: label "gh-runner-test" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
58-58: shellcheck reported issue in this script: SC2086:info:1:48: Double quote to prevent globbing and word splitting
(shellcheck)
60-60: shellcheck reported issue in this script: SC2086:info:2:40: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 LanguageTool
README.md
[grammar] ~37-~37: There might be a mistake here.
Context: .../cometbft)-powered) blockchain node that implements the decentralized exchange as...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
CHANGELOG.md
41-41: Bare URL used
(MD034, no-bare-urls)
_docs/adr/adr-001-network-upgrades.md
43-43: Hard tabs
Column: 1
(MD010, no-hard-tabs)
45-45: Hard tabs
Column: 1
(MD010, no-hard-tabs)
46-46: Hard tabs
Column: 1
(MD010, no-hard-tabs)
47-47: Hard tabs
Column: 1
(MD010, no-hard-tabs)
48-48: Hard tabs
Column: 1
(MD010, no-hard-tabs)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: release-dry-run
- GitHub Check: network-upgrade-names
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: tests
- GitHub Check: build-macos
- GitHub Check: build-bins
- GitHub Check: lint-shell
- GitHub Check: coverage
- GitHub Check: tests
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: lint-shell
- GitHub Check: lint-go
- GitHub Check: build-bins
- GitHub Check: build-macos
🔇 Additional comments (44)
tests/e2e/deployment_grpc_test.go (5)
1-18: LGTM! Imports and build tag are correctly configured.The e2e.integration build tag and the new pkg.akt.dev import paths align with the SDK v0.50+ migration objectives of this PR.
20-95: LGTM! SetupSuite initialization is well-structured.The setup properly:
- Generates and publishes client certificates
- Creates a deployment for testing
- Stores the deployment for use in subsequent tests
- Includes appropriate error checks and block waits
97-161: Good test coverage for deployment listing scenarios.The test cases cover the important scenarios: no filters, owner filter, invalid state filter, and multiple filters. The test structure is clear and well-organized.
163-222: Good test coverage for individual deployment queries.The test cases appropriately cover empty input, partial input, not found, and valid retrieval scenarios.
224-286: Good test coverage for group queries.The test structure mirrors the deployment tests with appropriate scenario coverage.
_build/single-node.sh (1)
17-22: uakt denom update looks correctThanks for aligning the genesis funding and gentx with
uakt; that matches Akash’s on-chain bond denom. No further action needed here.make/setup-cache.mk (2)
20-24: Verify SEMVER availability and module path correctness
- Ensure
SEMVERis defined (or the semver CLI is installed) so$(SEMVER)resolves.- Confirm that
github.com/vektra/mockery/v$(MOCKERY_MAJOR)and the ldflags packagepkg/config.SemVerexist in mockery v$(MOCKERY_VERSION).
30-34: No action required: golangci-lint v2.3.0 uses module path github.com/golangci/golangci-lint/v2, so the Makefile install command is correct.README.md (1)
37-37: LGTM! Migration to CometBFT reference is correct.The update from Tendermint to CometBFT aligns with the broader repository migration to CometBFT-based components.
Note: The static analysis grammar hint is a false positive—the markdown link syntax
([text](url)-powered)is valid.cmd/akash/cmd/bech32.go (1)
6-6: LGTM! Clean migration to pkg.akt.dev module path.The import path update preserves functionality while aligning with the repository-wide migration to
pkg.akt.devnamespaces.Makefile (1)
28-28: LGTM! Variable rename improves consistency.The rename from
GO_MODtoGOMODand the corresponding reference update are clean and improve naming consistency.Also applies to: 64-64
pubsub/bus_test.go (1)
6-6: LGTM! Import migrations are clean and correct.The import path updates from Tendermint to CometBFT and from the internal Akash path to
pkg.akt.devare correct and preserve test functionality.Also applies to: 9-9
tests/upgrade/test-cases.json (1)
2-187: Verify migration version numbers align with actual consensus versions
- In-repo modules match the test cases (take→3, provider→3, escrow→3, market→7, deployment→5, cert→4, audit→3).
- Manually confirm consensus versions for external modules (auth, authz, bank, distribution, feegrant, gov, ibc, mint, slashing, staking, transfer, upgrade) against their upstream definitions.
- Ensure the new “07-tendermint” and “consensus” modules are registered and all intermediate migration steps exist.
cmd/akash/cmd/testnetify/cmt_abci.go (2)
1-17: LGTM: Clean wrapper design.The unexported wrapper type with an exported constructor returning the interface is a solid design pattern. The delegation approach keeps the code simple and maintainable.
19-73: LGTM: Correct context handling for interface adaptation.The wrapper correctly adapts between the CometBFT ABCI interface (which consistently passes context) and the Cosmos SDK ABCI interface (where some methods accept context and others don't). The selective use of
_to discard unused context parameters is appropriate.make/releasing.mk (2)
64-111: LGTM: Docker invocations properly updated for new variable names.The docker invocations for
test-binsanddocker-imagehave been correctly updated to useGOMOD(instead ofGO_MOD) andGORELEASER_MOD_MOUNT(instead ofGO_MOD_NAME). TheGORELEASER_GOWORKenvironment variable is properly passed to the containers.Note: These will work correctly once the
GORELEASER_GOWORKempty-check issue (flagged above) is resolved.
118-144: LGTM: Release target properly updated.The
releasetarget has been correctly updated to use the new variable names and properly passesGORELEASER_GOWORKto the container. The release notes path has been updated to useGORELEASER_MOD_MOUNT.script/tools.sh (3)
27-62: LGTM: Clean helper implementations.The
is_commandhelper is a simple, reliable way to check for command availability. Theget_gotoolchainfunction has been properly refactored to use local variables and handle toolchain detection from go.mod or fallback to querying go.dev.
137-209: LGTM:install_gha_depscorrectly handles missing and outdatedmakeversions; no changes needed.
64-135: Exclusion patterns correctly exclude intended files
The exclusion list correctly omits .git, install.sh, *.md, .cache, dist, upgrades, and .idea paths as expected; no additional exclusions needed.app/upgrades.go (2)
23-27: LGTM: Pre-upgrade handler hook properly placed.The addition of
customPreUpgradeHandlerprovides a proper hook point for executing custom logic one height before the upgrade. The conditionupgradeInfo.Height == currentHeight+1correctly identifies when the upgrade will occur on the next block.
46-51: LGTM: Verify store keys for modules with migrations
Ensure all modules registering migrations have a corresponding store key in your app’s initialization to avoid panics fromapp.GetKey(module).app/genesis.go (1)
62-65: LGTM: Genesis state initialization updated correctly.The addition of the
codec.Codecparameter and routing throughgenesisFilterTokensaligns with the module-based wiring changes throughout the PR..envrc (5)
1-14: LGTM: Improved shell detection.The change to use
psfor detecting bash is more reliable than checking$SHELL, which may not accurately reflect the current shell. The direnv version check is properly maintained.
16-59: LGTM: Comprehensive dependency checking.The addition of
pvandlz4checks aligns with the updated Ubuntu setup requirements. All dependency checks follow a consistent pattern with clear error messages.
61-83: LGTM: GOWORK configuration properly implemented.The
GOWORKselection logic correctly:
- Sets the absolute path when
go.workexists andGOWORKisn't explicitly disabled- Falls back to "off" otherwise
- Respects explicit "off" setting
The
dotenv_if_exists dev.envcall allows for optional local development environment overrides.
85-95: LGTM: Platform-specific configuration properly handled.The Darwin-specific
CGO_CFLAGSsetting and theGOARCHauto-detection provide good defaults while allowing overrides. The reformatting of the CGO_CFLAGS export improves readability.
97-111: LGTM: Environment exports and PATH configuration complete.The addition of
GOWORKto the exported variables and thePATHaugmentation for cache bins properly complete the environment setup for the development workflow.go.mod (4)
7-18: LGTM: cosmossdk.io module versions align with SDK v0.53.x.The migration to standalone
cosmossdk.iomodule paths is correct for Cosmos SDK v0.53.x. The versions used are consistent with the ecosystem at this SDK level.Based on learnings.
55-77: Verify necessity of x/exp and rapid replace directives.
The SDK v0.53.x upgrade guide doesn’t mention these pins (golang.org/x/exp, pgregory.net/rapid). Confirm if they're still required; if not, remove or update the comments accordingly.
1-5: Dependencies require Go ≤1.23; confirm Go 1.24 compatibility
All major Cosmos SDK deps declare GoVersion 1.22–1.23 and haven’t been updated for 1.24. Run your full build and test suite under Go 1.24 or pin to Go 1.23 until upstream modules officially support 1.24.
20-26: LGTM: All dependencies and Akash forks include required patch releases
- cometbft v0.38.17-akash.2 matches upstream
- cosmos-sdk v0.53.4-akash.4 includes the v0.53.3 fixes
- gogoproto v1.7.0-akash.2 matches upstream
make/init.mk (1)
70-74: Verify tool versions — confirm Go 1.24 compatibilityRelease notes for golangci-lint v2.3.0 (fetched) show a changelog but do not state Go 1.24 support; mockery v3.5.0 and cosmovisor v1.7.1 were not checked. Confirm upstream compatibility (or upgrade/pin versions) for make/init.mk (lines 70–74).
make/test-simulation.mk (1)
7-8: LGTM.Cleaner invocation via $(APP_DIR); flags/timeouts look reasonable.
Also applies to: 12-13, 17-18, 22-23
make/test-integration.mk (1)
11-11: LGTM.Dedicated e2e.integration target and longer timeout are appropriate.
Also applies to: 21-24
tests/e2e/certs_grpc_test.go (1)
24-73: LGTM.End-to-end flow and validations are clear and adequate.
app/types/app.go (1)
376-387: Incorrect suggestion: the second argument is an ICS4Wrapper, not a PortKeeper
The transfer keeper signature is
NewKeeper(..., channelKeeper types.ChannelKeeper, ics4Wrapper types.ICS4Wrapper, ...)
and ChannelKeeper implements ICS4Wrapper, so passing it twice is correct—using PortKeeper will not compile.Likely an incorrect or invalid review comment.
cmd/akash/cmd/root.go (1)
101-109: Good wiring of server, pruning, snapshot, rosetta, and testnetify commandsThe composition looks correct and aligns with SDK 0.53+ patterns.
app/export.go (1)
278-344: Setup() is a useful test helper; LGTMConfigurable chain ID and genesis injection are clean and idiomatic.
app/sim_test.go (2)
100-141: Simulation wiring and export checks look correctUse of sdkutil encoding config, fauxMerkle mode, and CheckExportSimulation is appropriate.
182-212: Import/export test flow is solidGenesis export/import and consensus params storage reflect current SDK best practices.
cmd/akash/cmd/testnet.go (1)
132-139: Nice: app.toml defaults for API/telemetry and chain_id labelsPractical defaults for local testing.
Also applies to: 257-258
app/app.go (2)
345-398: LGTM - lifecycle methods correctly updated for SDK 0.53.The lifecycle method signatures and implementations are correctly updated:
InitChainernow returns(*abci.ResponseInitChain, error)PreBlockerproperly uses infinite gas meter with clear explanation- New
PrecommitterandPrepareCheckStaterhooks are properly wired- Error handling is consistent throughout
The height patch support in
BeginBlockeris also well-implemented.
400-499: LGTM - accessors and API routing correctly updated.The accessor methods correctly return the new field names (
aminoCdc,cdc,txConfig), and the API routing has been properly updated to use the new SDK service names (cmtservice,nodeservice). The refactoring to useModuleAccountAddrs()helper function is cleaner and more maintainable.
| var logger log.Logger | ||
| if FlagVerboseValue { | ||
| logger = log.NewTestLogger(&testing.T{}) | ||
| } else { | ||
| logger = log.NewNopLogger() | ||
| } |
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.
Do not construct a fake testing.T for the logger.
log.NewTestLogger(&testing.T{}) passes a zero-valued testing.T. That struct is not safe to instantiate manually and can trigger nil dereferences inside the logger. Either accept a real *testing.T from the caller or fall back to a production-safe logger (e.g., log.NewLogger/log.NewNopLogger).
🤖 Prompt for AI Agents
In app/sim/sim_utils.go around lines 31 to 36, the code constructs a zero-valued
testing.T and passes it into log.NewTestLogger which is unsafe; instead either
change the caller/signature to accept a real *testing.T and pass that to
log.NewTestLogger when available, or remove the fake and use a production-safe
logger (e.g., log.NewLogger or log.NewNopLogger) when FlagVerboseValue is set so
no manual testing.T is instantiated.
| if upgradeInfo.Name == name { | ||
| app.Logger().Info(fmt.Sprintf("configuring upgrade `%s`", name)) | ||
| if storeUpgrades := upgrade.StoreLoader(); storeUpgrades != nil && upgradeInfo.Name == name { | ||
| app.Logger().Info(fmt.Sprintf("setting up store upgrades for `%s`", name)) | ||
| app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades)) | ||
| } | ||
| } |
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.
Remove redundant name check.
Line 39 checks upgradeInfo.Name == name again even though it's already inside a block that only executes when upgradeInfo.Name == name (line 37). This is redundant:
if upgradeInfo.Name == name {
app.Logger().Info(fmt.Sprintf("configuring upgrade `%s`", name))
- if storeUpgrades := upgrade.StoreLoader(); storeUpgrades != nil && upgradeInfo.Name == name {
+ if storeUpgrades := upgrade.StoreLoader(); storeUpgrades != nil {
app.Logger().Info(fmt.Sprintf("setting up store upgrades for `%s`", name))
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades))
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if upgradeInfo.Name == name { | |
| app.Logger().Info(fmt.Sprintf("configuring upgrade `%s`", name)) | |
| if storeUpgrades := upgrade.StoreLoader(); storeUpgrades != nil && upgradeInfo.Name == name { | |
| app.Logger().Info(fmt.Sprintf("setting up store upgrades for `%s`", name)) | |
| app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades)) | |
| } | |
| } | |
| if upgradeInfo.Name == name { | |
| app.Logger().Info(fmt.Sprintf("configuring upgrade `%s`", name)) | |
| if storeUpgrades := upgrade.StoreLoader(); storeUpgrades != nil { | |
| app.Logger().Info(fmt.Sprintf("setting up store upgrades for `%s`", name)) | |
| app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades)) | |
| } | |
| } |
🤖 Prompt for AI Agents
In app/upgrades.go around lines 37 to 43, there's a redundant check: the inner
if repeats upgradeInfo.Name == name even though the outer block only runs when
that is true; remove the duplicate condition so the inner if only checks for
storeUpgrades != nil and then call
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height,
storeUpgrades)) inside that branch, keeping the logging lines as-is.
| cmd.Flags().String(flagNodeDaemonHome, "osmosisd", "Home directory of the node's daemon configuration") | ||
| cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list [email protected]:46656, [email protected]:46656, ...)") | ||
| cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") | ||
| cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", TestnetGenesisParams().NativeCoinMetadatas[0].Base), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.001uakt)") | ||
| cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") | ||
| cmd.Flags().String(flagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") | ||
|
|
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.
Default node daemon home should be Akash-specific
"default: osmosisd" is likely a copy/paste leftover. Use "akash" to match this repo’s app.
- cmd.Flags().String(flagNodeDaemonHome, "osmosisd", "Home directory of the node's daemon configuration")
+ cmd.Flags().String(flagNodeDaemonHome, "akash", "Home directory of the node's daemon configuration")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| cmd.Flags().String(flagNodeDaemonHome, "osmosisd", "Home directory of the node's daemon configuration") | |
| cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list [email protected]:46656, [email protected]:46656, ...)") | |
| cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") | |
| cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", TestnetGenesisParams().NativeCoinMetadatas[0].Base), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.001uakt)") | |
| cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") | |
| cmd.Flags().String(flagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") | |
| cmd.Flags().String(flagNodeDaemonHome, "akash", "Home directory of the node's daemon configuration") | |
| cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list [email protected]:46656, [email protected]:46656, ...)") | |
| cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") | |
| cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", TestnetGenesisParams().NativeCoinMetadatas[0].Base), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.001uakt)") | |
| cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") | |
| cmd.Flags().String(flagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") |
🤖 Prompt for AI Agents
In cmd/akash/cmd/testnet.go around lines 99 to 105, the default value for the
node daemon home flag is incorrectly set to "osmosisd"; replace that default
string with "akash" so the flag reads the Akash daemon home by default (i.e.,
change the first argument of cmd.Flags().String(flagNodeDaemonHome, ...) from
"osmosisd" to "akash"), keeping the existing help text unchanged.
| RELEASE_DOCKER_IMAGE ?= ghcr.io/akash-network/node | ||
| #GORELEASER_MOD_MOUNT ?= $(shell git config --get remote.origin.url | sed -r 's/.*(\@|\/\/)(.*)(\:|\/)([^:\/]*)\/([^\/\.]*)\.git/\2\/\4\/\5/' | tr -d '\n') | ||
| GORELEASER_MOD_MOUNT ?= $(shell cat $(ROOT_DIR)/.github/repo | tr -d '\n') | ||
|
|
||
| RELEASE_DOCKER_IMAGE ?= ghcr.io/akash-network/node |
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.
Remove duplicate RELEASE_DOCKER_IMAGE definition.
RELEASE_DOCKER_IMAGE is defined twice (line 8 and line 12) with the same value. Remove one definition:
GORELEASER_SKIP := $(subst $(COMMA),$(SPACE),$(GORELEASER_SKIP))
RELEASE_DOCKER_IMAGE ?= ghcr.io/akash-network/node
#GORELEASER_MOD_MOUNT ?= $(shell git config --get remote.origin.url | sed -r 's/.*(\@|\/\/)(.*)(\:|\/)([^:\/]*)\/([^\/\.]*)\.git/\2\/\4\/\5/' | tr -d '\n')
GORELEASER_MOD_MOUNT ?= $(shell cat $(ROOT_DIR)/.github/repo | tr -d '\n')
-
-RELEASE_DOCKER_IMAGE ?= ghcr.io/akash-network/node🤖 Prompt for AI Agents
In make/releasing.mk around lines 8 to 12, there is a duplicate definition of
RELEASE_DOCKER_IMAGE; remove the redundant second occurrence (the one on line
12) so the variable is defined only once, leaving the original definition intact
and ensuring no blank-line or spacing issues are introduced.
| DOCKER_RUN := docker run --rm -v $(shell pwd):/workspace -w /workspace | ||
| GOLANGCI_LINT_RUN := $(GOLANGCI_LINT) run | ||
| LINT = $(GOLANGCI_LINT_RUN) ./... --disable-all --timeout=5m --enable | ||
| LINT = $(GOLANGCI_LINT_RUN) ./... --disable-all --deadline=5m --enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify the golangci-lint flag change from --timeout to --deadline.
The flag was changed from --timeout=5m to --deadline=5m. However, recent versions of golangci-lint use --timeout, not --deadline. Please confirm that your version of golangci-lint supports the --deadline flag, or revert to --timeout if this change breaks linting.
Run the following script to check the supported flags:
🏁 Script executed:
#!/bin/bash
# Check golangci-lint version and supported flags
golangci-lint --version
golangci-lint run --help | grep -E "(--timeout|--deadline)"Length of output: 175
Replace unsupported --deadline flag with --timeout Revert the change on line 15 to --timeout=5m since golangci-lint v2.5.0 only supports --timeout.
🤖 Prompt for AI Agents
In Makefile around line 15, the golangci-lint invocation uses the unsupported
flag `--deadline=5m`; replace it with the supported `--timeout=5m` so the LINT
variable reads the same but uses `--timeout=5m`. Update the invocation to use
`--timeout` and keep the rest of the flags intact.
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
🧹 Nitpick comments (2)
app/types/app.go (2)
213-222: Consider removing unnecessary block scope.The block scope around the
consensusparamkeepercreation (lines 213-222) is unnecessary. The temporarykeepervariable could be directly assigned or avoided altogether.Apply this diff to simplify:
- // set the BaseApp's parameter store - { - keeper := consensusparamkeeper.NewKeeper( - cdc, - runtime.NewKVStoreService(app.keys[consensusparamtypes.StoreKey]), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - runtime.EventService{}, - ) - - app.Keepers.Cosmos.ConsensusParams = &keeper - } + // set the BaseApp's parameter store + keeper := consensusparamkeeper.NewKeeper( + cdc, + runtime.NewKVStoreService(app.keys[consensusparamtypes.StoreKey]), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + runtime.EventService{}, + ) + app.Keepers.Cosmos.ConsensusParams = &keeper
236-447: Consider breaking down this large initialization method.The
InitNormalKeepersmethod is 212 lines long and initializes 22 different keepers sequentially. While the logic is straightforward, the length and complexity make it harder to maintain and test.Consider refactoring into smaller, focused initialization functions grouped by subsystem:
initCoreKeepers(Account, Bank, Authz, FeeGrant)initStakingKeepers(Staking, Slashing, Mint, Distribution)initGovKeepers(Gov, Crisis, Params)initIBCKeepers(IBC, Transfer, Evidence, Light clients)initAkashKeepers(Take, Escrow, Deployment, Market, Provider, Audit, Cert)This would improve readability, testability, and make it easier to understand keeper dependency chains.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/types/app.go(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/types/app.go (5)
x/deployment/keeper/keeper.go (2)
Keeper(36-44)NewKeeper(47-54)x/escrow/keeper/keeper.go (2)
Keeper(30-50)NewKeeper(52-68)x/take/keeper/keeper.go (2)
Keeper(24-30)NewKeeper(33-39)testutil/state/suite.go (1)
Keepers(50-59)x/take/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). (17)
- GitHub Check: network-upgrade
- GitHub Check: release-dry-run
- GitHub Check: lint-go
- GitHub Check: sims
- GitHub Check: coverage
- GitHub Check: build-macos
- GitHub Check: tests
- GitHub Check: build-bins
- GitHub Check: lint-go
- GitHub Check: lint-shell
- GitHub Check: network-upgrade-names
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: coverage
- GitHub Check: build-bins
- GitHub Check: build-macos
- GitHub Check: tests
🔇 Additional comments (9)
app/types/app.go (9)
123-134: Good addition of store key management state.The addition of
Log,kOnce, and the store key maps (keys,tkeys,memKeys) provides proper centralized management of store keys with thread-safe initialization viasync.Once. This aligns well with the newGenerateKeysmethod.
136-148: LGTM! Thread-safe key generation.The use of
sync.Onceensures that store keys are generated exactly once, preventing race conditions ifGenerateKeysis called from multiple goroutines or multiple times during initialization.
150-193: LGTM! Clean accessor methods.The accessor methods provide appropriate encapsulation for store keys and parameter subspaces. The panic in
GetSubspace(line 154) is reasonable for initialization-time errors when a required subspace is not found.
449-471: LGTM! Proper hook registration.The hook setup correctly:
- Registers distribution and slashing hooks on the staking keeper
- Initializes governance hooks (currently empty, allowing for future additions)
- Registers market hooks on the escrow keeper for account and payment closure events
The implementation follows Cosmos SDK patterns for multi-hook registration.
503-547: LGTM! Well-organized store key management.The helper functions (
kvStoreKeys,akashKVStoreKeys,transientStoreKeys,memStoreKeys) provide a clean, centralized way to manage store keys. The separation of Akash-specific keys intoakashKVStoreKeysmaintains good modularity and makes it easy to see which modules are being used.
549-580: LGTM! Minor error message formatting improvement.The only changes to
FindStructFieldare cosmetic improvements to the error messages (lines 566 and 573), using backticks for better readability. The function logic remains unchanged and correct.
88-121: Keeper types align with module definitions The mix of pointer and value keeper types reflects each module’s API in Cosmos SDK v0.53+ and all keepers are properly initialized with no nil dereference issues.
473-501: Confirm migration plan for deprecated x/params keeper
- Do you have a chain upgrade handler invoking
baseapp.MigrateParams(and module-specific migrations) to copy legacy subspaces into new module Param stores?- Please add or reference a tracking issue/TODO in
app/types/app.goto remove all legacyx/paramssubspaces after the upgrade height.- Ensure each module’s keeper now owns its Params type and Msg-based updates as per SDK v0.50+ ADR 046.
410-417: Verifyapp.Keepers.Cosmos.Distr.FeePoolis defined and typed correctly
In app/types/app.go:416 you passapp.Keepers.Cosmos.Distr.FeePoolintoeker.NewKeeper. Confirm that the distribution-keeper wrapper exposes aFeePoolfield of typecollections.Item[distrtypes.FeePool]and that it’s properly initialized before use.
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
🧹 Nitpick comments (1)
app/types/app.go (1)
236-447: Consider decomposing this large initialization method.The method correctly initializes all keepers with proper dependencies, but at 211 lines it could benefit from decomposition into smaller, focused functions (e.g.,
initCosmosKeepers,initIBCKeepers,initAkashKeepers).Example structure:
func (app *App) InitNormalKeepers( cdc codec.Codec, encodingConfig sdkutil.EncodingConfig, bApp *baseapp.BaseApp, maccPerms map[string][]string, blockedAddresses map[string]bool, invCheckPeriod uint, ) { legacyAmino := encodingConfig.Amino app.initAccountKeepers(cdc, maccPerms, blockedAddresses, invCheckPeriod, bApp) app.initStakingKeepers(cdc, legacyAmino, bApp) app.initIBCKeepers(cdc, bApp) app.initAkashKeepers(cdc) } func (app *App) initAccountKeepers(cdc codec.Codec, maccPerms map[string][]string, blockedAddresses map[string]bool, invCheckPeriod uint, bApp *baseapp.BaseApp) { // Initialize Acct, Bank, Crisis, Authz, FeeGrant keepers }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/types/app.go(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/types/app.go (4)
x/deployment/keeper/keeper.go (2)
Keeper(36-44)NewKeeper(47-54)x/escrow/keeper/keeper.go (2)
Keeper(30-50)NewKeeper(52-68)x/take/keeper/keeper.go (2)
Keeper(24-30)NewKeeper(33-39)x/take/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). (9)
- GitHub Check: coverage
- GitHub Check: network-upgrade-names
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: lint-shell
- GitHub Check: build-bins
- GitHub Check: build-macos
- GitHub Check: tests
🔇 Additional comments (10)
app/types/app.go (10)
88-121: LGTM! Well-organized keeper structure.The restructuring of
AppKeeperswith nestedCosmos,Akash, andModulessections provides clear separation of concerns and aligns well with the SDK migration.
123-134: LGTM! Thread-safe key management.The addition of
kOnce sync.Onceand key maps provides a proper foundation for thread-safe key generation and management.
136-148: LGTM! Proper concurrency control.The use of
sync.Onceensures keys are generated exactly once, preventing race conditions during concurrent initialization.
150-193: LGTM! Clean accessor methods.The accessor methods provide appropriate encapsulation. The panic in
GetSubspaceis reasonable for detecting configuration errors at startup.
195-234: LGTM! Proper initialization sequence.The special keepers are initialized in the correct order, and
GenerateKeys()is called before accessing the key maps.
449-471: LGTM! Proper hook registration.The hooks are correctly registered for staking (distribution and slashing) and escrow (market events).
503-547: LGTM! Clean key management helpers.The helper functions provide clear organization of store keys, with good separation between cosmos and akash-specific keys.
549-580: LGTM! Clean reflection utility.The
FindStructFieldfunction provides safe reflective field access with clear error messages.
473-501: Document migration plan for deprecated params keeper usage. No TODOs or documentation found for migrating off these deprecated patterns; please add or link a migration plan (e.g., ADR, roadmap, or in-code TODO) before merging.
340-368: Verify deprecated governance v1beta1 router usage (app/types/app.go:340-368). No migration or deprecation references found; confirm that relying ongovtypesv1.NewRouter()andgovtypesv1.ProposalHandleris intentional or add a TODO to track a migration plan to v1.
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
♻️ Duplicate comments (1)
go.mod (1)
178-178: Critical: Resolve go-getter symlink vulnerability (GO-2025-3892).The dependency
github.com/hashicorp/go-getter v1.7.8has a HIGH-severity vulnerability (GO-2025-3892, GHSA-wjrx-6529-hcj3) related to symlink attacks. This allows attackers to write files outside the intended download directory.Status: This issue was previously flagged in an earlier review but remains unresolved.
Actions required:
- Determine if go-getter is a direct or transitive dependency using
go mod why github.com/hashicorp/go-getter- If direct: upgrade to the latest patched version or evaluate alternatives
- If transitive: either upgrade the upstream module that depends on it, or use a
replacedirective to force a patched version- Run
go mod tidyand verify the vulnerability is removed#!/bin/bash # Determine if go-getter is a direct or transitive dependency echo "Checking go-getter dependency status:" go mod why github.com/hashicorp/go-getter # Check for available patched versions echo -e "\nChecking latest go-getter releases:" curl -s https://api.github.com/repos/hashicorp/go-getter/releases \ | jq -r '.[0:5] | .[] | "\(.tag_name): \(.published_at)"'
🧹 Nitpick comments (1)
go.mod (1)
60-64: Ensure coordination and maintenance of Akash forks.The go.mod file uses Akash forks of critical dependencies:
github.com/akash-network/cometbft(v0.38.17-akash.2)github.com/akash-network/cosmos-sdk(v0.53.4-akash.4)github.com/akash-network/gogoproto(v1.7.0-akash.2)Verify that these forks are:
- Actively maintained and synchronized with upstream security patches
- Documented in an ADR or architecture decision record
- Tracked in a FORK_MAINTENANCE.md or similar tracking document
- Subject to regular security audits
📜 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 (1)
go.mod(1 hunks)
🧰 Additional context used
🪛 OSV Scanner (2.2.3)
go.mod
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks in github.com/hashicorp/go-getter
(GO-2025-3892)
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks
⏰ 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
- GitHub Check: sims
- GitHub Check: network-upgrade-names
- GitHub Check: lint-go
- GitHub Check: release-dry-run
- GitHub Check: lint-shell
- GitHub Check: coverage
- GitHub Check: build-macos
- GitHub Check: build-bins
- GitHub Check: tests
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: lint-shell
- GitHub Check: build-macos
- GitHub Check: tests
- GitHub Check: build-bins
🔇 Additional comments (2)
go.mod (2)
3-3: Verify Go 1.25.2 stability and compatibility.Go 1.25.2 is a very recent release (late 2025). Confirm that:
- All dependencies are compatible with Go 1.25.2
- No known regressions or stability issues exist in this version
- The toolchain is properly specified for reproducible builds
1-1: ****The review comment mischaracterizes this PR. The module path
pkg.akt.dev/nodeis not changing in this PR—it was already changed in a prior commit (feat!: sdk-50) and is fully adopted throughout the codebase. This PR only updates dependencies ingo.modandgo.sum, not the module path itself. No migration work or verification of path accessibility is required for this PR.Likely an incorrect or invalid review 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: 1
🧹 Nitpick comments (1)
make/test-upgrade.mk (1)
69-72: Consider extracting common flags to reduce duplication.The four script invocations repeat many flags (
--workdir,--config,--uto,--snapshot-url). Extracting these to a variable would improve maintainability.Consider this refactor:
+UPGRADE_SCRIPT_FLAGS := --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) + .PHONY: test-reset test-reset: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) clean - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) bins - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) keys - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) prepare-state + $(ROOT_DIR)/script/upgrades.sh $(UPGRADE_SCRIPT_FLAGS) clean + $(ROOT_DIR)/script/upgrades.sh $(UPGRADE_SCRIPT_FLAGS) --gbv=$(GENESIS_BINARY_VERSION) bins + $(ROOT_DIR)/script/upgrades.sh $(UPGRADE_SCRIPT_FLAGS) keys + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json) --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) prepare-stateNote: Line 72 has different flags (
--state-configinstead of--uto), so it may need special handling.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
make/test-upgrade.mk(3 hunks)
⏰ 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-names
- GitHub Check: release-dry-run
- GitHub Check: tests
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: lint-shell
- GitHub Check: build-bins
- GitHub Check: coverage
- GitHub Check: build-macos
🔇 Additional comments (5)
make/test-upgrade.mk (5)
15-15: LGTM: State configuration variable added.The
STATE_CONFIGvariable provides a sensible default path and allows override, which is appropriate for upgrade testing configuration.
41-48: LGTM: AKASH_INIT updated with state configuration flags.The addition of
--state-configand--snapshot-urlflags aligns with the new upgrade workflow described in the AI summary. The multi-line formatting is clean and maintainable.
52-52: LGTM: Dependency ordering improved.Reordering dependencies so
$(COSMOVISOR)comes before$(AKASH_INIT)ensures cosmovisor is available before initialization runs, which is the correct execution order.
58-58: LGTM: Test target now enforces initialization.Adding
initas a dependency ensures the test environment is properly initialized before tests run, preventing potential runtime errors from missing setup.
24-36: Snapshot source mapping is correctly implemented and consumed by the script.The makefile's conditional logic (lines 24-36) correctly maps
SNAPSHOT_SOURCEtoSNAPSHOT_NETWORK, and this value is propagated to the script via the--snapshot-urlargument in the primary test flow (lines 69-72). The script accepts and uses this argument properly (lines 117-119).Note: The
prepare-stateandbinsstandalone targets (lines 76, 82) do not pass--snapshot-url, so they rely on the script's hardcoded default (mainnet). This appears intentional for maintenance operations, but verify it aligns with intended usage patterns for sandbox snapshots.
ab35040 to
38baece
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
🧹 Nitpick comments (1)
script/tools.sh (1)
108-117: File discovery excludes.mdand build artifacts correctly.The
findpredicate grouping is correct, though the logic could be slightly more readable. Consider whether files likego.workor workspace-specific files need exclusion as well.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
script/tools.sh(1 hunks)
⏰ 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: tests
- GitHub Check: coverage
- GitHub Check: network-upgrade-names
- GitHub Check: release-dry-run
- GitHub Check: lint-go
- GitHub Check: sims
- GitHub Check: lint-shell
🔇 Additional comments (6)
script/tools.sh (6)
27-29: Preferis_commandoverwhichgoing forward.The new
is_command()helper is a solid utility and correctly usescommand -v, which is more portable thanwhich. Consistent use of this helper across the codebase will improve maintainability.
31-73:get_gotoolchain()refactor looks solid.The introduction of the
toolfilevariable (lines 37-41) to preferGOWORKwhen available is a good improvement for workspace support. The fallback logic togoversionfromgo.modis clean, and the remote toolchain discovery (lines 61-63) has reasonable error handling.
75-86:replace_paths()function looks good.The use of
gsedon macOS (line 82) andsedelsewhere is the correct pattern for cross-platform compatibility. The~delimiter avoids escaping issues with forward slashes in import paths. Verify that the-rflag (extended regex) is available on all target systems.
135-143: Retract handling viago mod edit --jsonandjqis correct.This is a good approach to safely drop retract directives when bumping major versions. Verify that
jqis available in the environment where this script runs (it's listed indebian_deps, so Debian is covered, but macOSmacos_depsdoes not includejq—confirm this is intentional).
148-181: macOS dependency detection and installation looks solid.Checks for homebrew availability, version-checks
make, iterates throughmacos_depswithbrew liststatus checks, and installs missing tools. The intentional word-splitting on line 178 is correctly flagged with shellcheck directive.
222-229: Newreplace-import-pathcase handler is correctly wired.The shift and pass-through of arguments to
replace_import_path()(line 227-228) follows the established pattern. Verify that callers know to pass the next major version as the first argument.
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 (4)
script/upgrades.sh (3)
391-398: Usetar_by_content_type()instead ofcontent_type()for extraction.The
content_type()function returns only a file extension (e.g.,"tar.gz"), not an executable command. Piping intoeval "$tar_cmd"will fail because"tar.gz"is not a valid command. Thetar_by_content_type()function (lines 138–158) returns the proper tar invocation (e.g.,"tar xzf -").Apply this diff:
- tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") + tar_cmd=$(tar_by_content_type "$(content_name "${GENESIS_URL}")") if [ "$tar_cmd" != "" ]; then # shellcheck disable=SC2086 wget -q -O - "${GENESIS_URL}" | pv $pv_args | eval "$tar_cmd"
162-164: Fix typo:.tar.cz*should be.tar.xz*.The
content_type()function uses an incorrect pattern for xz-compressed archives.Apply this diff:
function content_type() { case "$1" in - *.tar.cz*) - tar_cmd="tar.cz" + *.tar.xz*) + tar_cmd="tar.xz" ;;
404-406: Usetar_by_content_type()for consistent extraction from local files.Same issue as line 391:
content_type()returns only the extension, not a valid tar command. Usetar_by_content_type()for the local file case as well.Apply this diff:
- tar_cmd=$(content_type "${GENESIS_URL}") + tar_cmd=$(tar_by_content_type "${GENESIS_URL}") # shellcheck disable=SC2086 (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n'make/test-upgrade.mk (1)
74-76: Add--snapshot-urlflag to standaloneprepare-statetarget.The standalone
prepare-statetarget (line 76) omits--snapshot-url=$(SNAPSHOT_URL), while the same command invoked withintest-reset(line 72) includes it. According to past review findings, theprepare_statefunction inscript/upgrades.shuses theSNAPSHOT_URLvariable, so this flag should be included for consistency and correct functionality.Apply this diff:
.PHONY: prepare-state prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) prepare-state
🧹 Nitpick comments (2)
script/upgrades.sh (2)
313-332: Redundant export statements in.envrcfile.The
.envrcfile declares variables and then immediately exports them (lines 324–331), but the variables are already in scope. This is valid but redundant; you can either declare without export and then export once, or declare withexportdirectly.Consider simplifying:
cat >"$valdir/.envrc" <<EOL -PATH_add "\$(pwd)/cosmovisor/current/bin" -AKASH_HOME="\$(pwd)" -AKASH_FROM=validator0 -AKASH_GAS=auto -AKASH_MINIMUM_GAS_PRICES=0.0025uakt -AKASH_NODE=tcp://127.0.0.1:26657 -AKASH_CHAIN_ID=localakash -AKASH_KEYRING_BACKEND=test -AKASH_SIGN_MODE=direct - -export AKASH_HOME -export AKASH_FROM -export AKASH_GAS -export AKASH_MINIMUM_GAS_PRICES -export AKASH_NODE -export AKASH_CHAIN_ID -export AKASH_KEYRING_BACKEND -export AKASH_SIGN_MODE +PATH_add "\$(pwd)/cosmovisor/current/bin" +export AKASH_HOME="\$(pwd)" +export AKASH_FROM=validator0 +export AKASH_GAS=auto +export AKASH_MINIMUM_GAS_PRICES=0.0025uakt +export AKASH_NODE=tcp://127.0.0.1:26657 +export AKASH_CHAIN_ID=localakash +export AKASH_KEYRING_BACKEND=test +export AKASH_SIGN_MODE=direct
488-489: Clarify commented-out state initialization.Lines 488–489 are commented-out code that initializes
priv_validator_state.json. If this is for future use, consider adding a brief comment explaining when/why it should be uncommented. If it's dead code, remove it.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
make/test-upgrade.mk(3 hunks)script/upgrades.sh(12 hunks)tests/upgrade/test-config.json(1 hunks)
⏰ 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: sims
- GitHub Check: lint-go
- GitHub Check: lint-shell
- GitHub Check: network-upgrade-names
- GitHub Check: release-dry-run
- GitHub Check: tests
- GitHub Check: build-bins
- GitHub Check: coverage
🔇 Additional comments (5)
tests/upgrade/test-config.json (1)
4-5: ✓ Configuration change is compatible with test infrastructure.The test harness already supports multiple validators through dynamic iteration. The addition of
.akash1aligns with the SDK 50 upgrade testing objectives for simulating multi-validator scenarios during upgrades.script/upgrades.sh (1)
374-377: Clarify or fixaddrbook_fileassignment.Line 375 assigns
addrbook_fileto the same path asgenesis_file(line 374). Both are then deleted on lines 376–377, making the separate variable redundant. Confirm if this should reference a different file (e.g.,address_book.json) or if the logic should be consolidated.make/test-upgrade.mk (3)
15-36: LGTM! Clean snapshot source configuration.The
SNAPSHOT_SOURCEconditional logic correctly maps mainnet/sandbox to their respective networks and properly handles invalid values with an error. TheSTATE_CONFIGandSNAPSHOT_URLderivation are well-structured.
40-49: LGTM! Proper integration of state config and snapshot URL.The
AKASH_INITtarget correctly passes the new--state-configand--snapshot-urlflags, aligning with the variable definitions above.
51-65: LGTM! Improved dependency management and test invocation.The
inittarget now explicitly depends onCOSMOVISOR, ensuring proper build ordering. The simplifiedtesttarget dependency oninitis cleaner, and the extended test invocation flags are appropriate for the enhanced upgrade test infrastructure.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/export.go (1)
125-125: Inconsistent error handling: withdrawals silently ignored.This line explicitly ignores errors from
WithdrawDelegationRewards, which is inconsistent with the extensive error handling added throughout the rest of this function. If ignoring these errors is intentional (e.g., because some delegations may have no rewards to withdraw), add a comment explaining why.Consider adding a comment or handling the error consistently:
- _, _ = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + // Ignore errors as some delegations may have no rewards to withdraw + _, _ = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr)Or handle errors explicitly if they shouldn't be ignored:
- _, _ = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + _, err = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + if err != nil && !errorsmod.IsOf(err, distrtypes.ErrNoDelegationDistInfo) { + panic(err) + }
♻️ Duplicate comments (4)
app/testnet.go (1)
278-290: Critical: Incorrect height passed to UpgradeStoreLoader.Line 278 calculates
versionasLatestVersion() + 1, which will not match the scheduled upgrade height (upgradePlan.Heightset on line 270). When the new binary boots at the real upgrade height, the store loader will panic because the height mismatch prevents proper store migrations, potentially halting the chain.Despite the past review comment being marked as "Addressed in commit 7e0c735", this issue persists in the current code.
Apply this diff to use the correct upgrade height:
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Heightmake/test-upgrade.mk (2)
80-80: Remove the commented-outbinsline.As noted in the previous review, this commented line should be removed since
binswas intentionally moved to a separate conditional target (lines 88-93). The commented code adds confusion without value.Apply this diff:
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) clean - #$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) keys
84-86: Add missing--snapshot-urlflag to standaloneprepare-statetarget.The past review flagged this issue as addressed in commit 2e33215, but the current code at line 86 still omits
--snapshot-url. Theprepare_statefunction inscript/upgrades.shuses theSNAPSHOT_URLvariable (lines 469-477), and thetest-resettarget (line 82) correctly includes this flag. For consistency and correctness, the standalone target must also pass it.Apply this diff:
.PHONY: prepare-state prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-statescript/upgrades.sh (1)
450-467: Fix genesis extraction: usetar_by_content_typeinstead ofcontent_type.The past review flagged this issue as addressed in commit 7e0c735, but the current code still uses
content_type(lines 450, 463), which returns extensions like"tar.gz"rather than commands like"tar xzf -". Wheneval "$tar_cmd"executes, it will fail with "command not found" errors. Usetar_by_content_type(as correctly done for snapshots at line 480) to get the proper extraction command.Apply this diff:
- tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") + tar_cmd=$(tar_by_content_type "$(content_name "${GENESIS_URL}")") if [ "$tar_cmd" != "" ]; then # shellcheck disable=SC2086 wget -q -O - "${GENESIS_URL}" | pv $pv_args | eval "$tar_cmd" ... else echo "Unpacking genesis from ${GENESIS_URL}" - tar_cmd=$(content_type "${GENESIS_URL}") + tar_cmd=$(tar_by_content_type "${GENESIS_URL}") # shellcheck disable=SC2086 (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n'
🧹 Nitpick comments (1)
script/upgrades.sh (1)
131-132: Add error handling for chain metadata fetch.The
curlcommand at line 131 lacks error handling. If the URL is unreachable or returns an error,CHAIN_METADATAwill be empty or contain an error message, causing subsequentjqparsing to fail silently or produce unexpected results.Consider adding validation:
-CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") +CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") +if [ -z "$CHAIN_METADATA" ] || ! echo "$CHAIN_METADATA" | jq empty 2>/dev/null; then + echo "Failed to fetch or parse chain metadata from ${CHAIN_METADATA_URL}" >&2 + exit 1 +fi GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')"
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
app/export.go(5 hunks)app/testnet.go(3 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(13 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(13 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- meta.json
🧰 Additional context used
🧬 Code graph analysis (4)
app/export.go (2)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)app/config.go (1)
ModuleBasics(70-72)
cmd/akash/cmd/testnetify/testnetify.go (3)
util/server/server.go (1)
GetAppDBBackend(221-231)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)testutil/network/network.go (2)
DefaultConfig(603-651)Validator(137-159)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (3)
TestnetDelegation(29-32)TestnetAccount(54-57)TestnetGov(45-48)
🪛 Shellcheck (0.11.0)
script/upgrades.sh
[warning] 152-152: Use single quotes, otherwise this expands now rather than when signalled.
(SC2064)
[warning] 152-152: Use single quotes, otherwise this expands now rather than when signalled.
(SC2064)
[warning] 155-155: Use single quotes, otherwise this expands now rather than when signalled.
(SC2064)
⏰ 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-names
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: lint-shell
- GitHub Check: build-macos
- GitHub Check: coverage
- GitHub Check: lint-go
- GitHub Check: tests
- GitHub Check: build-bins
🔇 Additional comments (33)
cmd/akash/cmd/testnetify/config.go (1)
6-15: LGTM! Clean migration to CometBFT and updated type definitions.The import changes correctly migrate from Tendermint to CometBFT equivalents, and the struct updates align with the new type definitions in
app/testnet.go. The type migrations (e.g.,sdk.Int→sdkmath.Int,[]sdk.AccAddress→[]akash.TestnetAccount) are consistent with the broader v0.53.x upgrade.Also applies to: 45-51, 64-65
cmd/akash/cmd/testnetify/testnetify.go (5)
5-6: LGTM! Proper import migration and options initialization.The import reorganization correctly migrates to CometBFT equivalents, and the
StartCmdOptionsinitialization with a customDBOpenerfollows the standard Cosmos SDK pattern for server startup.Also applies to: 17-45, 51-54
116-125: Account balance initialization logic is sound.The code correctly initializes accounts with default balances when none are provided. The use of
sdk.NewCoins()ensures proper coin validation and deduplication.
184-191: LGTM! Proper context and signal handling.The context management with
errgroupand signal handling viaserver.ListenForQuitSignalsenables graceful shutdown. This is a well-structured pattern for coordinating the lifecycle of concurrent operations.
170-183: LGTM! Robust server configuration and telemetry setup.The configuration retrieval, validation, and telemetry initialization follow Cosmos SDK best practices with proper error handling at each step.
498-508: LGTM! Correct voting power calculation from delegations.The voting power calculation properly sums delegation amounts and applies
DefaultPowerReductionto convert token amounts to consensus voting power, which is the standard Cosmos SDK pattern.app/testnet.go (4)
7-26: LGTM! Clean migration to CometBFT and updated type definitions.The import changes correctly migrate to CometBFT and cosmossdk.io equivalents, and the type definitions properly reflect the new testnet configuration structure with support for delegations, governance parameters, and flexible account balances.
Also applies to: 29-64
131-190: LGTM! Proper account funding and validator setup with comprehensive error handling.The banking flow correctly mints and distributes funds, and the validator setup includes proper bech32 address conversion, comprehensive state updates across all staking stores, and appropriate hook invocations.
196-242: LGTM! Comprehensive distribution, slashing, and delegation setup.The code properly initializes all distribution stores for each validator, sets up slashing state, and processes delegations with consistent error handling throughout.
251-263: LGTM! Proper governance parameter configuration.The governance parameter updates use the correct Params collection API with proper error handling and appropriate values for testnet use (shorter voting periods, reasonable deposit amounts).
app/export.go (7)
3-26: LGTM: Import updates align with cosmos-sdk v0.53.x migration.The migration from Tendermint to CometBFT packages and the new cosmossdk.io module structure are correct for this SDK version.
36-50: LGTM: Context creation and module-aware genesis export are correct.The migration to
NewContextLegacyandExportGenesisForModuleswith proper error handling aligns with cosmos-sdk v0.53.x patterns.
57-66: LGTM: Validator and consensus params retrieval updated correctly.The updated SDK APIs for retrieving validators and consensus parameters are properly applied.
91-107: LGTM: Comprehensive error handling additions.The extensive error handling added throughout
prepForZeroHeightGenesisproperly addresses the new error returns from cosmos-sdk v0.53.x keeper methods. Panicking on errors is appropriate for genesis operations where data integrity is critical.Also applies to: 110-113, 139-169, 182-190, 199-211, 214-226, 238-260, 265-278
282-347: LGTM: Well-structured option-based Setup function.The new
Setupfunction provides a clean, option-based initialization pattern for testing/simulation scenarios. The use ofmemDBandNopLoggerconfirms this is intended for non-production use. The integration with the newSetupAppOptionpattern (from app/option.go) is well-designed.The hardcoded
chainID: "akash-1"at line 287 is acceptable for a test helper, as it can be overridden viaWithChainIDoption.
30-34: Breaking API change properly integrated—all call sites updated.Verification confirms all five call sites of
ExportAppStateAndValidatorspass the newmodulesToExportparameter. No missing updates found.
231-232: Keeper methods exist in cosmos-sdk v0.53.x, but verify if they meet the specific requirements.Cosmos-sdk v0.53.x provides
IterateBondedValidatorsByPowerand related validator iteration methods. However, the code at lines 231-232 requires validation for two reasons:
Iteration scope: The current direct store access iterates ALL validators (including jailed ones, as evidenced by the jailing logic at line 242).
IterateBondedValidatorsByPoweriterates only bonded validators, which may not be sufficient.Iteration order: The comment explicitly states "by power descending." The reverse prefix iterator is intentional here, but it's unclear whether keeper methods return validators in the required descending order.
The code also uses a mixed approach—direct store traversal for order, then
GetValidatorkeeper calls for data retrieval (line 236)—which suggests the current pattern may be deliberate for the genesis export context. Verify whether switching to a keeper-based approach would preserve both the iteration scope (all validators) and order (descending by power).make/test-upgrade.mk (3)
15-45: LGTM: Configuration defaults and snapshot source validation.The defaulting logic for STATE_CONFIG, SNAPSHOT_SOURCE validation, and derivation of SNAPSHOT_NETWORK/CHAIN_METADATA_URL is well-structured. The hardcoded SNAPSHOT_URL with a commented alternative indicates an intentional configuration choice.
47-59: LGTM: AKASH_INIT target properly wired.All required flags (--chain-meta, --state-config, --snapshot-url, --max-validators) are correctly passed to the init command.
88-93: LGTM: Conditionalbinstarget properly configured.The conditional logic and flag passing (--gbv, --chain-meta) are correct.
script/upgrades.sh (13)
36-42: LGTM: Variable defaults and option parsing setup.The new defaults for CHAIN_METADATA_URL, SNAPSHOT_URL, STATE_CONFIG, and MAX_VALIDATORS are reasonable, and the long options are correctly extended.
98-127: LGTM: Option parsing for new flags.The new option parsing cases (chain-meta, snapshot-url, state-config, max-validators) follow the established pattern correctly.
134-177: LGTM: Trap management functions are correctly implemented.The
trap_add,trap_show, andcleanupfunctions provide robust trap stacking. The shellcheck SC2064 warnings about double quotes (lines 152, 155) are false positives in this context—the variablesexisting_cmdandnew_cmdare local and should be expanded at trap definition time to capture their values, making double quotes correct here.
187-226: LGTM: Archive type detection functions.
tar_by_content_type(returns commands) andcontent_type(returns extensions) serve distinct purposes and are correctly implemented.
243-261: LGTM: Content utility functions with proper fallbacks.Both
content_nameandcontent_locationcorrectly handle missing HTTP headers and provide safe fallbacks.
291-314: LGTM: Enhanced archive naming with GOARCH.Adding
$GOARCHto the Linux archive name (line 308) improves multi-architecture support.
316-404: LGTM: Enhanced init function with per-validator scaffolding.The addition of per-validator environment files (
.envrc,validator.json), key management (lines 396-397), and delegation toprepare_state(line 403) provide robust initialization.
468-513: LGTM: Snapshot download and extraction logic.The snapshot handling correctly uses
tar_by_content_type(line 480), properly relocates nested data directories (lines 492-496), and initializes validator state appropriately.
515-606: LGTM: Testnetification and multi-validator state setup.The orchestration for running
testnetify, temporarily starting a validator, adding subsequent validators with version-aware command handling (lines 545-559), and copying state while preserving per-validator keys is well-structured.
608-642: LGTM: Clean function with proper directory management.The cleanup logic correctly removes validator data and re-establishes the genesis symlink using pushd/popd for directory safety.
644-713: LGTM: Key import and binary management functions.Both
import_keysandbinscorrectly handle their respective responsibilities.
715-749: LGTM: Command routing for prepare-state and upgrade-from-release.The case branches correctly route to the respective functions.
750-789: LGTM: Snapshot source detection from version metadata.The
snapshot-sourcecommand intelligently parses semver build tokens to extract network information and provides sensible defaults (sandbox) with mainnet detection for main branches.
c86c8bc to
bd0236a
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: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/export.go (1)
115-126: Consider handling the error fromWithdrawDelegationRewards.Line 125 explicitly ignores both return values from
WithdrawDelegationRewards, which is inconsistent with the error handling pattern used elsewhere in this function (where errors cause panics). If withdrawal can legitimately fail for some delegations (e.g., no rewards), consider checking for specific error types like theErrNoValidatorCommissionpattern used above.- _, _ = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + _, err = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + if err != nil { + // Consider checking for specific expected errors if needed + panic(err) + }
♻️ Duplicate comments (4)
script/upgrades.sh (2)
437-439: Fix incorrect addrbook_file assignment.Line 437 assigns
addrbook_filetogenesis.jsoninstead ofaddrbook.json. This is a copy-paste error that prevents addrbook from being properly cleared.Apply this diff:
genesis_file=${valdir}/config/genesis.json - addrbook_file=${valdir}/config/genesis.json + addrbook_file=${valdir}/config/addrbook.json rm -f "$genesis_file"
442-469: Usetar_by_content_typeinstead ofcontent_typefor genesis extraction.Lines 453 and 466 call
content_typewhich returns just the file extension (e.g., "tar.gz"), not the executable tar command. When passed toeval, this attempts to run a non-existent command. This is the same bug flagged in past reviews. Usetar_by_content_typeinstead, as done correctly on line 483 for snapshot extraction.Apply this diff to lines 442-469:
if [[ $cnt -eq 0 ]]; then if [[ "${GENESIS_URL}" =~ ^https?:\/\/.* ]]; then echo "Downloading genesis from ${GENESIS_URL}" pv_args="-petrafb -i 5" sz=$(content_size "${GENESIS_URL}") # shellcheck disable=SC2181 if [ $? -eq 0 ]; then if [[ -n $sz ]]; then pv_args+=" -s $sz" fi - tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") + tar_cmd=$(tar_by_content_type "$(content_name "${GENESIS_URL}")") if [ "$tar_cmd" != "" ]; then # shellcheck disable=SC2086 wget -q -O - "${GENESIS_URL}" | pv $pv_args | eval "$tar_cmd" else wget -q --show-progress -O "$genesis_file" "${GENESIS_URL}" fi else echo "unable to download genesis" fi else echo "Unpacking genesis from ${GENESIS_URL}" - tar_cmd=$(content_type "${GENESIS_URL}") + tar_cmd=$(tar_by_content_type "${GENESIS_URL}") # shellcheck disable=SC2086 (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n' fiapp/testnet.go (2)
265-294: Critical: Incorrect upgrade store loader height calculation.Line 278 calculates
versionusingLatestVersion() + 1, which is incorrect. TheUpgradeStoreLoaderat line 290 must receive the actual scheduled upgrade height (upgradePlan.Heightfrom line 270). UsingLatestVersion() + 1will cause a height mismatch, leading to a chain halt when the upgrade executes.This issue was previously flagged in past reviews and remains unresolved.
Apply this diff:
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Height
104-111: Critical: Inconsistent error handling remains unaddressed.Line 106 returns
nilon error, which contradicts the panic-based error handling used throughout this function (e.g., lines 96, 134, 145). This was previously flagged in past reviews and marked as "Addressed in commit c86c8bc" but the issue persists in the current code.Apply this diff to fix:
iterator, err = app.Keepers.Cosmos.Staking.LastValidatorsIterator(ctx) if err != nil { - return nil + panic(err.Error()) }
🧹 Nitpick comments (4)
make/test-upgrade.mk (2)
40-41: Consider using the "latest" snapshot URL instead of a hardcoded version.The hardcoded snapshot URL points to a specific snapshot (
sandbox-2_201655.tar.lz4) that will become stale over time. The commented alternative on line 41 useslatest, which would automatically fetch the most recent snapshot and reduce maintenance burden.Apply this diff to use the "latest" snapshot:
-SNAPSHOT_URL := https://snapshots.akash.network/sandbox-2-archival/sandbox-2_201655.tar.lz4 -#SNAPSHOT_URL ?= https://snapshots.akash.network/$(SNAPSHOT_NETWORK)/latest +SNAPSHOT_URL ?= https://snapshots.akash.network/$(SNAPSHOT_NETWORK)/latest
45-45: Add error handling for MAX_VALIDATORS extraction.If
TEST_CONFIGis missing or doesn't contain a.validatorsfield, thejqcommand will fail or produce an empty value. Consider adding validation or usingjq -eto exit with error on missing fields.Example improvement:
MAX_VALIDATORS := $(shell cat $(TEST_CONFIG) 2>/dev/null | jq -e -r '.validators | length' 2>/dev/null || echo "0")Alternatively, add a prerequisite check that validates TEST_CONFIG exists and contains the required field.
app/testnet.go (2)
78-87: Inconsistent error handling pattern.The defer block at lines 80-84 handles errors via the
errvariable, but many error paths in the function usepanic()directly (e.g., lines 96, 134, 145, etc.), bypassing this handler. Consider either:
- Using the
errvariable consistently throughout the function, or- Removing the defer block and using panic consistently
167-190: Minor inconsistency in error panic formatting.Most error panics use
panic(err.Error())(lines 170, 174, 178, 182, 186), but line 189 usespanic(err). While both work, consistent formatting improves maintainability.Apply this diff for consistency:
if err := app.Keepers.Cosmos.Staking.Hooks().AfterValidatorCreated(ctx, valAddr); err != nil { - panic(err) + panic(err.Error()) }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
app/export.go(5 hunks)app/testnet.go(3 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(13 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(13 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (3)
TestnetDelegation(29-32)TestnetAccount(54-57)TestnetGov(45-48)
app/export.go (2)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)app/config.go (1)
ModuleBasics(70-72)
cmd/akash/cmd/testnetify/testnetify.go (3)
util/server/server.go (1)
GetAppDBBackend(221-231)app/testnet.go (1)
TestnetConfig(59-64)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: network-upgrade
- GitHub Check: sims
- GitHub Check: lint-shell
- GitHub Check: release-dry-run
- GitHub Check: lint-go
- GitHub Check: tests
- GitHub Check: coverage
- GitHub Check: build-bins
🔇 Additional comments (32)
meta.json (1)
43-47: LGTM!The new upgrade entry follows the established format and represents a major version bump to v1.0.0 from v0.38.0. The structure is consistent with existing entries.
make/test-upgrade.mk (3)
62-62: LGTM! Dependency updates look correct.The updated dependencies (
initnow requiresCOSMOVISOR, andtestdepends oninit) properly sequence the upgrade test workflow.Also applies to: 68-68
88-93: LGTM! Thebinstarget conditional logic is well-structured.The conditional skip logic and the updated script invocation with
--gbvand--chain-metaflags look correct.
15-15: No changes required. The STATE_CONFIG default filetests/upgrade/testnet.jsonexists in the repository. The code is correct as-is.cmd/akash/cmd/testnetify/testnetify.go (1)
184-252: LGTM! Lifecycle management properly integrated.The lifecycle management changes align well with the CometBFT/SDK v0.53.x patterns:
- errgroup-based coordination for graceful shutdown
- Proper context cancellation flow
- Signal handling integrated via
ListenForQuitSignals- StartInProcess correctly configured with the GetCtx hook
app/export.go (14)
3-26: LGTM! Import updates align with Cosmos SDK v0.53.x migration.The import changes properly reflect the upgrade:
- CometBFT replacing Tendermint references
- New error handling via
cosmossdk.io/errors- Store types from
cosmossdk.io/store/types- Updated module type imports from cosmos-sdk
47-50: Good error handling for module genesis export.The addition of error handling for
ExportGenesisForModulesis correct and aligns with safer error propagation patterns in the updated SDK.
71-87: Appropriate error handling for genesis preparation.The panic on malformed validator addresses is acceptable during zero-height genesis preparation, as it should fail fast if configuration is invalid. The deprecation notice is helpful for future planning.
91-107: LGTM! Correct error handling for validator commission withdrawal.The implementation properly:
- Uses
ValidatorAddressCodec().StringToBytes()for address conversion (new SDK pattern)- Handles the
ErrNoValidatorCommissioncase gracefully witherrorsmod.IsOf- Propagates all other errors appropriately
139-169: LGTM! Comprehensive error handling for validator reinitialization.All state operations properly check and propagate errors:
- Outstanding rewards retrieval
- Fee pool operations
- Validator creation hooks
172-191: LGTM! Proper error handling for delegation hooks.The delegation reinitialization correctly handles errors from both
BeforeDelegationCreatedandAfterDelegationModifiedhooks.
199-211: LGTM! Correct error handling for redelegations.The redelegation height reset properly handles errors from
SetRedelegation.
214-226: LGTM! Correct error handling for unbonding delegations.The unbonding delegation height reset properly handles errors from
SetUnbondingDelegation.
231-260: LGTM! Updated store access pattern and error handling.The code correctly:
- Uses
storetypes.KVStoreReversePrefixIteratorfor the updated SDK- Handles errors from
GetValidatorandSetValidator- Propagates errors from
ApplyAndReturnValidatorSetUpdates
265-278: LGTM! Proper error handling for slashing state reset.The signing info reset correctly handles errors from
SetValidatorSigningInfoand the iterator.
296-317: LGTM! Clean test app initialization with viper and options.The setup correctly:
- Uses an isolated viper instance for app options
- Generates a random genesis time for test determinism
- Applies encoding config and chain ID via options pattern
319-344: LGTM! Flexible genesis initialization with proper error handling.The conditional genesis initialization is well-designed:
- Supports custom genesis via
genesisFncallback- Properly sets
ChainIdinRequestInitChain(required in SDK v0.53.x)- Handles errors from
InitChain
282-294: No issues found. The options pattern types are properly defined.The verification confirms that
SetupAppOption(line 19 ofapp/option.go) andsetupAppOptionsstruct (line 11 ofapp/option.go) are correctly defined in the same package. The options pattern is fully implemented with helper functions (WithHome,WithChainID,WithCheckTx,WithGenesis,WithEncConfig), and the Setup function correctly uses these types.
36-36: Verify ifapp.NewContext()should replaceapp.NewContextLegacy()in the export function.NewContextLegacy is a backward-compatible constructor for legacy modules/APIs, while NewContext is the new constructor aligned with v0.50+ migration to use Go's context.Context and newer module signatures. In this codebase,
app.NewContext()is used elsewhere (e.g.,testutil/state/suite.go,app/sim_test.go), whileNewContextLegacyappears only once at line 36.However, the method signatures differ—
NewContextLegacyaccepts two parameters (bool and Header), whileapp.NewContext()is called with one parameter elsewhere. Without confirming the method definitions and whetherNewContextcan replicate the Header-setting behavior, you should verify:
- Can
app.NewContext(true)replace the current call, or does it require the Header argument?- Does the export functionality have specific requirements that justify using the legacy constructor?
Use NewContext for new code; use NewContextLegacy only when you must interoperate with legacy code that expects the pre-migration sdk.Context behavior.
app/testnet.go (10)
3-27: LGTM: Imports updated for CometBFT and Cosmos SDK v0.53.The import updates correctly reflect the migration from Tendermint to CometBFT and the adoption of modular cosmossdk.io packages.
29-64: LGTM: Type definitions align with testnet configuration requirements.The new and updated types (TestnetDelegation, TestnetGov, TestnetAccount, etc.) properly support the enhanced testnet initialization flow with delegation handling and governance configuration.
69-73: LGTM: Function signature updated to support store operations.The addition of the
dbparameter is necessary for the upgrade store loader setup at line 278.
88-101: Staking power store cleanup looks correct.The validator power store cleanup properly handles errors during iteration. The ignored error on
iterator.Close()at line 101 is acceptable as a minor issue.
113-126: LGTM: Validator and unbonding queue cleanup is correct.The cleanup logic for validators store and unbonding queue properly removes all entries.
127-140: LGTM: Account funding logic is correct.The bank funding section properly mints and transfers coins to testnet accounts with appropriate error handling.
192-230: LGTM: Distribution and slashing initialization is correct.The validator distribution records and slashing signing info are properly initialized with appropriate error handling.
232-243: Delegation creation logic is correct.The delegation loop properly retrieves validators and creates delegations. Note the minor inconsistency: line 235 uses
panic(err.Error())while line 240 usespanic(err).
248-263: LGTM: Governance parameter updates are correct.The governance parameters are properly retrieved, updated with testnet-specific values, and saved with appropriate error handling.
143-165: Bech32 address conversion is correct and necessary.The conversion is intentional and required. The
val.OperatorAddressfield stores ansdk.AccAddress(account address format with "akash" prefix), which must be converted to validator address format (with "akashvaloper" prefix) for thestakingtypes.Validatorstruct. This is a standard Cosmos SDK pattern when promoting an account address to a validator address role. The code is correct as-is.cmd/akash/cmd/testnetify/config.go (3)
3-16: LGTM: Imports updated for CometBFT migration.The imports correctly reflect the transition from Tendermint to CometBFT and align with the repository-wide import path updates.
18-67: LGTM: Type definitions align with testnet configuration requirements.The updated TestnetValidator fields (Status, Delegations, MinSelfDelegation type) and TestnetConfig fields (Accounts, Gov) are consistent with the corresponding types in app/testnet.go and support the enhanced testnet initialization flow.
69-108: LGTM: Helper functions for JSON unmarshalling are correct.The TrimQuotes utility and UnmarshalJSON methods for various address types properly handle JSON deserialization with appropriate error handling.
| Example: "testnetify", | ||
| Args: cobra.NoArgs, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| Args: cobra.ExactArgs(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix argument specification mismatch.
The command is configured with Args: cobra.ExactArgs(1), which requires exactly one positional argument, but:
- The command documentation and example show no required arguments
- The
RunEhandler ignores the args parameter (_ []string) - No argument is used anywhere in the function body
This will cause the command to reject valid invocations that match the documented usage.
Apply this diff to fix the issue:
- Args: cobra.ExactArgs(1),
+ Args: cobra.NoArgs,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Args: cobra.ExactArgs(1), | |
| Args: cobra.NoArgs, |
🤖 Prompt for AI Agents
In cmd/akash/cmd/testnetify/testnetify.go around line 78, the command is
incorrectly configured with Args: cobra.ExactArgs(1) while the command expects
no positional arguments and RunE ignores args; change the argument specification
to cobra.NoArgs (or remove the Args field) so the command accepts zero arguments
as documented, then run go vet/build to ensure no other call sites rely on a
single-arg requirement.
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/export.go (1)
125-125: Inconsistent error handling: why are these errors ignored?Line 125 explicitly ignores errors from
WithdrawDelegationRewardsusing_, _ =, while all other similar operations throughout this function panic on error (e.g., lines 97-101, 162-164). This inconsistency could mask legitimate failures during genesis preparation.Apply this diff if errors should be handled consistently:
- _, _ = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + _, err = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + if err != nil { + panic(err) + }Or add a comment explaining why these specific errors can be safely ignored.
♻️ Duplicate comments (9)
script/upgrades.sh (3)
131-132: Add error handling for metadata fetch and URL derivation.The curl/jq pipeline lacks error checking. If the metadata fetch fails or jq returns empty,
GENESIS_URLbecomes empty, causing downstream failures. Add validation to ensure both operations succeed andGENESIS_URLis non-empty.Apply this diff:
CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") +if [ -z "$CHAIN_METADATA" ]; then + echo "Failed to fetch chain metadata from $CHAIN_METADATA_URL" >&2 + exit 1 +fi GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')" +if [ -z "$GENESIS_URL" ]; then + echo "Failed to resolve GENESIS_URL from chain metadata" >&2 + exit 1 +fi
386-396: Fix command substitution syntax in validator.json generation.Line 388 uses
$(AKASH ...)(literal command name) instead of$($AKASH ...)(variable expansion), which will fail to execute. This was flagged previously but the fix is not present in the current code.Apply this diff:
cat >"$valdir/validator.json" <<EOL { - "pubkey": $(AKASH --home="$valdir" tendermint show-validator), + "pubkey": $($AKASH --home="$valdir" tendermint show-validator), "amount": "1000000uakt",
437-437: Fix incorrect addrbook file path assignment.Line 437 assigns
addrbook_filetogenesis.jsoninstead ofaddrbook.json. This is a copy-paste error that was previously flagged but the fix is not present in the current code.Apply this diff:
genesis_file=${valdir}/config/genesis.json - addrbook_file=${valdir}/config/genesis.json + addrbook_file=${valdir}/config/addrbook.json rm -f "$genesis_file"app/testnet.go (2)
104-107: Inconsistent error handling for iterator.Line 106 returns
nilon error, which is inconsistent with the panic pattern used at line 96 for a similar operation. This was flagged previously but the fix is not present.Apply this diff:
iterator, err = app.Keepers.Cosmos.Staking.LastValidatorsIterator(ctx) if err != nil { - return nil + panic(err.Error()) }
278-290: Fix upgrade store loader height calculation.Line 278 passes
LatestVersion()+1toUpgradeStoreLoader, but it must receive the actual upgrade height (upgradePlan.Heightfrom line 270). Using the wrong height will cause the loader to panic when the new binary boots at the real upgrade height.Apply this diff:
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Heightcmd/akash/cmd/testnetify/testnetify.go (2)
78-78: Fix argument specification mismatch.The command requires exactly one argument (
cobra.ExactArgs(1)), but the documentation shows no required arguments andRunEignores the args parameter. This will cause the command to reject valid invocations.Apply this diff:
- Args: cobra.ExactArgs(1), + Args: cobra.NoArgs,
283-286: Fix incorrect sort comparison function.The sort comparison function has an invalid signature (
func(i, _ int) bool) that ignores the second parameter and doesn't compare two elements. Use a stable partition to move the matching validator to the front.Apply this diff:
thisVal := config.PrivValidatorKeyFile() - sort.Slice(tcfg.Validators, func(i, _ int) bool { - return thisVal == tcfg.Validators[i].Home + sort.SliceStable(tcfg.Validators, func(i, j int) bool { + iMatch := thisVal == tcfg.Validators[i].Home + jMatch := thisVal == tcfg.Validators[j].Home + return iMatch && !jMatch })make/test-upgrade.mk (2)
32-32: Fix indentation: line still uses spaces instead of tabs.Despite the past review comment marked as addressed, line 32 still shows improper indentation with spaces before the variable assignment. Makefiles require tab characters for indentation within conditional blocks. This will cause "missing separator" errors.
Apply this diff to fix the indentation:
- CHAIN_METADATA_URL := https://raw.githubusercontent.com/akash-network/net/master/sandbox-2/meta.json + CHAIN_METADATA_URL := https://raw.githubusercontent.com/akash-network/net/master/sandbox-2/meta.jsonEnsure the line uses tabs (not spaces) for indentation, matching the pattern of lines 27-28 and 31.
84-86: Add missing--snapshot-urlflag toprepare-statetarget.Despite the past review comment marked as addressed, the standalone
prepare-statetarget (line 86) still omits the--snapshot-urlflag, while the same command invoked intest-reset(line 82) includes it. The underlyingprepare_statefunction inscript/upgrades.shuses theSNAPSHOT_URLvariable, so this flag should be passed for consistency.Apply this diff:
prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state
🧹 Nitpick comments (2)
app/export.go (1)
74-279: Consider breaking down this ~200-line function.While the error handling updates for SDK v0.53.x are correct,
prepForZeroHeightGenesishandles multiple distinct concerns (fee distribution, validator state, delegation state, staking state, slashing state) in a single 200+ line function. Consider extracting logical sections into helper methods (e.g.,prepFeeDistributionForZeroHeight,prepStakingForZeroHeight,prepSlashingForZeroHeight) to improve readability and testability.make/test-upgrade.mk (1)
33-34: Consider removing commented alternative sandbox configuration.The commented lines for
sandbox-01appear to be leftover configuration. If this alternative is no longer needed, remove these lines to reduce clutter. If they're kept for reference, add a brief comment explaining why.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
app/export.go(5 hunks)app/testnet.go(3 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(13 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(13 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
app/export.go (2)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)app/config.go (1)
ModuleBasics(70-72)
cmd/akash/cmd/testnetify/testnetify.go (2)
util/server/server.go (1)
GetAppDBBackend(221-231)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (3)
TestnetDelegation(29-32)TestnetAccount(54-57)TestnetGov(45-48)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: network-upgrade
- GitHub Check: release-dry-run
- GitHub Check: tests
- GitHub Check: sims
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: build-bins
- GitHub Check: build-macos
🔇 Additional comments (9)
meta.json (1)
43-47: Verify that v0.38.6-rc2 is the correct binary version for a production upgrade path.The new v1.0.0 upgrade entry uses a release candidate binary (
v0.38.6-rc2) rather than a stable release. This is unconventional for production upgrade metadata, as RC versions are typically used for testing only.Confirm whether:
- This binary version is intentional (e.g., for specific upgrade testing scenarios)
- A stable release version (e.g.,
v0.38.6without the-rc2suffix) should be used instead- This aligns with the project's release practices for upgrade paths
cmd/akash/cmd/testnetify/config.go (1)
44-67: LGTM: Testnet configuration types updated.The type updates (Status, Delegations fields, sdkmath.Int migration, TestnetAccount/TestnetGov references) properly align with the new testnet initialization flow introduced in app/testnet.go.
app/export.go (4)
3-26: LGTM! Import migrations align with Cosmos SDK v0.53.x.The import path updates correctly reflect the Cosmos SDK v0.53.x migration:
cosmossdk.io/*module organization, CometBFT replacing Tendermint, and the newcosmos-dbpackage.
71-71: Note: Verify deprecation timeline for zero height genesis.The comment states this feature is "temporary" and "will be deprecated." Consider documenting when this deprecation is planned and whether this extensive refactoring effort for SDK v0.53.x compatibility is necessary given the temporary status.
282-347: LGTM! Clean options pattern for test setup.The
Setupfunction uses a clean options pattern for flexible test configuration. The fixed random seed (line 302) is appropriate for deterministic testing, as indicated by thenolint: goseccomment. The conditionalInitChainlogic correctly handles both check-tx and normal initialization scenarios.
30-68: All callers correctly updated for the new signature.Verified that all five call sites have been properly updated to pass the
modulesToExportparameter:
testutil/sims/simulation_helpers.goandapp/sim/sim_utils.gopassnilapp/sim_test.gopasses empty slicescmd/akash/cmd/app_creator.goforwards the parameterThe implementation is sound and ready.
make/test-upgrade.mk (3)
47-59: LGTM: AKASH_INIT target properly configured.The enhanced initialization target now passes all necessary metadata including chain configuration, state config, snapshot URL, and validator count. The flag formatting and structure are correct.
62-62: LGTM: Proper dependency ordering.Adding
$(COSMOVISOR)as a dependency ensures the cosmovisor binary is available before running initialization. This is the correct approach.
88-93: LGTM: Conditionalbinstarget is well-structured.The conditional logic allows skipping binary builds when
SKIPcontains "build", which is useful for testing scenarios where binaries are already available. The flag set is appropriate for thebinscommand.
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 (11)
cmd/akash/cmd/testnetify/testnetify.go (3)
411-429: Fix undefined variable reference.
getCtxis referenced here but is not in scope. It's defined as a local variable inside theGetCmdfunction'sRunEhandler (lines 186-191) but is not passed to thetestnetifyfunction.Apply this diff:
- _, ctx := getCtx(sctx, true) + ctx := context.Background()Since this is a temporary proxy app used only for probing the initial application state, a simple background context is sufficient.
78-78: Fix argument specification mismatch.The command is configured with
Args: cobra.ExactArgs(1), which requires exactly one positional argument, but the command documentation shows no required arguments, theRunEhandler ignores the args parameter (_ []string), and no argument is used in the function body.Apply this diff:
- Args: cobra.ExactArgs(1), + Args: cobra.NoArgs,
283-286: Fix incorrect sort comparison function.The sort comparison function has an invalid signature and logic.
sort.Slicerequiresfunc(i, j int) boolto compare elements at positionsiandj, but the current implementationfunc(i, _ int) boolignores the second parameter and returns a boolean that doesn't compare two elements.Apply this diff to place the matching validator first:
- thisVal := config.PrivValidatorKeyFile() - sort.Slice(tcfg.Validators, func(i, _ int) bool { - return thisVal == tcfg.Validators[i].Home - }) + thisVal := config.PrivValidatorKeyFile() + sort.SliceStable(tcfg.Validators, func(i, j int) bool { + iMatch := thisVal == tcfg.Validators[i].Home + jMatch := thisVal == tcfg.Validators[j].Home + return iMatch && !jMatch + })app/testnet.go (2)
94-111: Inconsistent error handling during iterator cleanup.Line 106 returns
nilon error, which is inconsistent with the panic pattern used throughout this function (e.g., line 96). This could leave resources in an inconsistent state and doesn't match the error handling at other iterator operations.Apply this diff to maintain consistent error handling:
iterator, err = app.Keepers.Cosmos.Staking.LastValidatorsIterator(ctx) if err != nil { - return nil + panic(err.Error()) }
278-290: Fix upgrade store loader height calculation.
UpgradeStoreLoadermust receive the upgrade height (upgradePlan.Height). PassingLatestVersion()+1(typically 1, or at best current height + 1) will mismatch the scheduled height, so the loader panics when the new binary boots at the real upgrade height, halting the chain.Apply this diff:
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Heightmake/test-upgrade.mk (2)
78-78: Remove commented-out bins invocation.The commented-out
binscall is redundant sincebinsfunctionality has been moved to a separate conditional target (lines 86-91). Remove this line to avoid confusion.Apply this diff:
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) clean - #$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) keys
82-84: Add --snapshot-url flag to standalone prepare-state target.The
prepare_statefunction inscript/upgrades.shuses theSNAPSHOT_URLvariable (line 472). The standaloneprepare-statetarget omits--snapshot-url, while the same command intest-reset(line 80) includes it. This inconsistency means the standalone target relies on defaults rather than explicit configuration.Apply this diff:
.PHONY: prepare-state prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-statescript/upgrades.sh (4)
386-396: Fix command substitution syntax in validator.json generation.Line 388 uses
$(AKASH ...)(attempts to execute a command literally named "AKASH") instead of$($AKASH ...)(variable expansion + command substitution). This will fail because there's no command named "AKASH" in the PATH.Apply this diff:
cat >"$valdir/validator.json" <<EOL { - "pubkey": $(AKASH --home="$valdir" tendermint show-validator), + "pubkey": $($AKASH --home="$valdir" tendermint show-validator), "amount": "1000000uakt",
437-437: Fix incorrect variable assignment for addrbook file path.Line 437 assigns
addrbook_filetogenesis.jsoninstead ofaddrbook.json. This is a copy-paste error that will cause the script to operate on the wrong file.Apply this diff:
genesis_file=${valdir}/config/genesis.json - addrbook_file=${valdir}/config/genesis.json + addrbook_file=${valdir}/config/addrbook.json rm -f "$genesis_file"
453-469: Fix genesis download extraction to use tar_by_content_type.Lines 453 and 466 call
content_typewhich returns an extension string (e.g., "tar.gz"), then pipe intoeval "$tar_cmd". This attempts to execute the extension string as a command and will fail. Usetar_by_content_typeinstead, which returns the correct tar extraction command.Apply this diff:
- tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") + tar_cmd=$(tar_by_content_type "$(content_name "${GENESIS_URL}")") if [ "$tar_cmd" != "" ]; then # shellcheck disable=SC2086 wget -q -O - "${GENESIS_URL}" | pv $pv_args | eval "$tar_cmd" else wget -q --show-progress -O "$genesis_file" "${GENESIS_URL}" fi else echo "unable to download genesis" fi else echo "Unpacking genesis from ${GENESIS_URL}" - tar_cmd=$(content_type "${GENESIS_URL}") + tar_cmd=$(tar_by_content_type "${GENESIS_URL}") # shellcheck disable=SC2086 (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n' fi
131-132: Add error handling for metadata fetch and URL derivation.The curl and jq pipeline lacks error checking. If the metadata fetch fails or jq returns empty,
GENESIS_URLbecomes empty, causing confusing failures downstream.Apply this diff to add error handling:
CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") +if [ -z "$CHAIN_METADATA" ]; then + echo "Failed to fetch chain metadata from $CHAIN_METADATA_URL" >&2 + exit 1 +fi GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')" +if [ -z "$GENESIS_URL" ] || [ "$GENESIS_URL" = "null" ]; then + echo "Failed to resolve GENESIS_URL from chain metadata" >&2 + exit 1 +fi
🧹 Nitpick comments (1)
script/upgrades.sh (1)
171-180: Quote variable expansion in cleanup to handle multiple PIDs safely.If multiple background jobs exist,
$jbwill expand to multiple space-separated PIDs. The unquoted expansion at line 176 will work but is less robust. Consider quoting for clarity, or use an array.Apply this diff for safer expansion:
function cleanup() { jb=$(jobs -p) if [[ "$jb" != "" ]]; then # shellcheck disable=SC2086 - kill $jb + kill -SIGTERM $jb 2>/dev/null || true fi }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
app/export.go(5 hunks)app/testnet.go(3 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(13 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(13 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- meta.json
🧰 Additional context used
🧬 Code graph analysis (4)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (3)
TestnetDelegation(29-32)TestnetAccount(54-57)TestnetGov(45-48)
cmd/akash/cmd/testnetify/testnetify.go (2)
util/server/server.go (1)
GetAppDBBackend(221-231)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)
app/export.go (1)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: network-upgrade
- GitHub Check: tests
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: lint-shell
- GitHub Check: build-bins
- GitHub Check: lint-go
- GitHub Check: coverage
🔇 Additional comments (25)
app/export.go (4)
7-26: LGTM: Clean migration to CometBFT and cosmossdk.io packages.The import updates correctly migrate from Tendermint to CometBFT equivalents and adopt the new cosmossdk.io module paths. All imports are used appropriately throughout the file.
30-50: LGTM: Module-aware genesis export with proper error handling.The addition of the
modulesToExportparameter enables selective module export, and the explicit error handling forExportGenesisForModulesfollows best practices. The context creation usingNewContextLegacyaligns with the SDK migration patterns.
74-279: LGTM: Comprehensive error handling in zero-height genesis preparation.The extensive error checking with panic-on-error semantics throughout the validator, delegation, and distribution flows is appropriate for this critical genesis preparation path. All iterator operations now include proper error handling and cleanup.
282-346: LGTM: Clean functional options pattern for app setup.The refactored
Setupfunction uses a well-structured functional options pattern withSetupAppOption, providing flexibility for test configurations while maintaining clear defaults. The genesis initialization logic with configurablegenesisFnis a good design choice.app/testnet.go (2)
29-64: LGTM: Well-structured testnet configuration types.The new public structs (
TestnetDelegation,TestnetValidator,TestnetGov,TestnetAccount,TestnetConfig) provide a clean, type-safe API for testnet configuration. The field types appropriately use SDK types (sdk.AccAddress,sdk.Coin,sdkmath.Int) and the JSON tags enable proper serialization.
130-243: LGTM: Comprehensive testnet account and validator initialization.The account funding and validator setup logic properly:
- Mints and distributes coins to testnet accounts with explicit error checking
- Handles bech32 address encoding/decoding with proper validation
- Initializes validators across staking, distribution, and slashing modules
- Processes delegations with appropriate hooks
cmd/akash/cmd/testnetify/config.go (1)
44-67: LGTM: Struct updates align with testnet configuration evolution.The
TestnetValidatoradditions (Status,Delegations,sdkmath.IntforMinSelfDelegation) andTestnetConfigupdates (TestnetAccount,TestnetGovtypes) properly mirror the corresponding changes inapp/testnet.go. The type consistency ensures smooth integration across the testnet tooling.cmd/akash/cmd/testnetify/testnetify.go (10)
51-54: LGTM: Standard DB opener initialization.The default DB opener setup follows the SDK's
StartCmdOptionspattern and provides appropriate extensibility for custom database backends.
116-125: LGTM: Default balance initialization for testnet accounts.The logic provides sensible defaults (10M uakt + 1M axlUSDC) when balances are not specified, while respecting explicitly configured balances. The use of
NewCoinsensures proper coin validation.
170-192: LGTM: Proper server configuration and lifecycle management.The addition of server config validation, telemetry setup, and context-based cancellation with the
getCtxclosure provides robust lifecycle management for the testnet process. The quit signal handling ensures graceful shutdown.
200-248: LGTM: Monitoring goroutine for block height synchronization.The monitoring logic properly waits for the testnet to produce blocks and then triggers cancellation after the second block. The timeout handling prevents indefinite blocking.
250-252: LGTM: Integration with SDK's StartInProcess.The use of
StartInProcesswith theGetCtxoption correctly wires the lifecycle management and enables proper signal handling during testnet execution.
288-303: LGTM: Genesis file chain ID update.The migration to
AppGenesisFromFilealigns with the CometBFT patterns, and the chain ID modification with validation and persistence is correctly implemented.
305-342: LGTM: Proper initialization of block store and state DB.The setup of block store and state DB using
DefaultDBProviderandDefaultGenesisDocProviderFunc, along with the genesis doc hash update, correctly prepares the testnet state infrastructure.
387-402: LGTM: Validator configuration with delegations.The validator setup properly captures consensus pubkey, operator address, status, and delegations, aligning with the expanded
TestnetValidatorstructure.
498-508: LGTM: Voting power calculation from delegations.The logic correctly sums delegation amounts and applies the default power reduction to compute voting power for each validator.
511-575: LGTM: Comprehensive validator set and state persistence.The code properly:
- Constructs the new validator set with computed voting powers
- Updates block commit signatures
- Persists validator info to state DB at appropriate heights
- Saves the updated state through the state store
script/upgrades.sh (5)
190-229: LGTM: Archive handling functions are well-structured.The separation of
tar_by_content_type(returns executable commands) andcontent_type(returns extension strings) is clear and correctly handles multiple archive formats.
246-264: LGTM: Improved header parsing with case-insensitive matching.The addition of
-iflags for case-insensitive matching makes these functions more robust when handling HTTP headers.
365-384: LGTM: Well-structured environment configuration.The
.envrcfile provides a clean way to configure validator-specific environment variables for use with direnv or manual sourcing.
471-503: LGTM: Snapshot handling correctly uses tar functions.The snapshot download and extraction logic correctly uses
content_typefor filename construction (line 473) andtar_by_content_typefor extraction (line 483). The nested data directory relocation is a nice defensive touch.
735-792: LGTM: New command routing is well-structured.The
prepare-stateandsnapshot-sourcecommands are properly integrated into the case routing. The snapshot-source logic correctly parses semver build tokens to determine the network source.make/test-upgrade.mk (3)
46-57: LGTM: AKASH_INIT properly wired with new configuration flags.The init target correctly passes all new flags (
--chain-meta,--state-config,--snapshot-url,--max-validators) to the upgrades.sh script.
86-91: LGTM: Conditional bins target properly structured.The
binstarget correctly uses conditional make syntax and passes the necessary flags to the upgrades script.
24-37: No action needed—indentation is correct.Verification confirms all indented lines (27–28, 30–31, 33–34) use tab characters (
^Iin cat -A notation), not spaces. The Makefile syntax is correct.
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
♻️ Duplicate comments (10)
app/testnet.go (2)
104-107: Critical: Inconsistent error handling persists.Despite being marked as addressed, this code still returns
nilon error instead of using the panic pattern consistent with line 96 and the defer cleanup at lines 80-84. This inconsistency could leave resources in an inconsistent state.Apply this diff:
iterator, err = app.Keepers.Cosmos.Staking.LastValidatorsIterator(ctx) if err != nil { - return nil + panic(err.Error()) }
278-291: Critical: Incorrect upgrade store loader height calculation.
UpgradeStoreLoadermust receive the actual upgrade height (upgradePlan.Height). UsingLatestVersion()+1will cause a height mismatch when the upgrade triggers, resulting in a chain halt.Apply this diff:
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Heightcmd/akash/cmd/testnetify/testnetify.go (3)
78-78: Critical: Command argument specification mismatch.The command is configured with
Args: cobra.ExactArgs(1)but the handler ignores arguments and the documentation shows no required positional arguments. This will cause the command to reject valid invocations.Apply this diff:
- Args: cobra.ExactArgs(1), + Args: cobra.NoArgs,
283-286: Critical: Invalid sort comparison function.The sort comparator has an incorrect signature
func(i, _ int) boolthat ignores the second index parameter and doesn't compare two elements. This will not sort correctly.Apply this diff to properly partition the validator matching
thisValto the front:thisVal := config.PrivValidatorKeyFile() - sort.Slice(tcfg.Validators, func(i, _ int) bool { - return thisVal == tcfg.Validators[i].Home - }) + sort.SliceStable(tcfg.Validators, func(i, j int) bool { + iMatch := thisVal == tcfg.Validators[i].Home + jMatch := thisVal == tcfg.Validators[j].Home + return iMatch && !jMatch + })
411-412: Critical: Undefined variable reference.
getCtxis defined inside theRunEhandler (lines 186-191) but is referenced here in thetestnetifyfunction where it's not in scope. This would fail to compile.Apply this diff:
- cmtApp := NewCometABCIWrapper(testnetApp) - _, ctx := getCtx(sctx, true) + cmtApp := NewCometABCIWrapper(testnetApp) + ctx := context.Background()A simple background context is sufficient for this temporary proxy app used for probing initial state.
make/test-upgrade.mk (2)
78-78: Remove the commented-outbinsinvocation.The commented-out bins call at line 78 should be removed as it's redundant with the separate conditional target at lines 86-91.
Apply this diff:
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) clean - #$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) keys
82-84: Add--snapshot-urlflag to standaloneprepare-statetarget for consistency.The standalone
prepare-statetarget omits the--snapshot-url=$(SNAPSHOT_URL)flag, while the same command intest-reset(line 80) includes it. Since theprepare_statefunction uses theSNAPSHOT_URLvariable, this flag should be passed for consistency.Apply this diff:
.PHONY: prepare-state prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-statescript/upgrades.sh (3)
131-132: Add error handling for metadata fetch and URL derivation.The curl and jq pipeline lacks error checking. If the metadata fetch fails or the jq path is missing,
GENESIS_URLbecomes empty, leading to confusing failures downstream. Add validation to ensure the fetch succeeds andGENESIS_URLis non-empty.Apply this diff:
CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") +if [ -z "$CHAIN_METADATA" ]; then + echo "Failed to fetch chain metadata from $CHAIN_METADATA_URL" >&2 + exit 1 +fi GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')" +if [ -z "$GENESIS_URL" ] || [ "$GENESIS_URL" = "null" ]; then + echo "Failed to resolve GENESIS_URL from chain metadata" >&2 + exit 1 +fi
446-474: Fix incorrect function usage in genesis extraction.Lines 458 and 471 use
content_typewhich returns a file extension (e.g., "tar.gz"), but then attempt to execute it witheval "$tar_cmd". This will fail because the extension string is not an executable command.Apply this diff:
- tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") + tar_cmd=$(tar_by_content_type "$(content_name "${GENESIS_URL}")") if [ "$tar_cmd" != "" ]; then # shellcheck disable=SC2086 wget -q -O - "${GENESIS_URL}" | pv $pv_args | eval "$tar_cmd" else wget -q --show-progress -O "$genesis_file" "${GENESIS_URL}" fi else echo "unable to download genesis" fi else echo "Unpacking genesis from ${GENESIS_URL}" - tar_cmd=$(content_type "${GENESIS_URL}") + tar_cmd=$(tar_by_content_type "${GENESIS_URL}") # shellcheck disable=SC2086 (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n' fi
523-613: Add error handling for validator startup and transaction submissions.The multi-validator setup lacks critical error handling:
- Line 536: No verification that
$AKASH startsucceeded before capturingrpid- Line 538: No check that
$AKASH versionsucceeded before usingakashversion- Lines 552-566: No error handling for
create-validatortransaction failures- Line 577: No validation that
rpidis valid before callingkillIf the validator fails to start,
rpidcaptures an invalid process ID, causingkill -SIGINT $rpidto potentially terminate an unrelated process or fail silently.Consider adding:
- Verify the process started:
sleep 2 && kill -0 $rpid 2>/dev/null || { echo "Validator failed to start"; exit 1; }- Check version command:
akashversion=$($AKASH version) || { echo "Failed to get version"; exit 1; }- Validate transactions: Check exit status after each
create-validatorcommand- Validate rpid:
[ -n "$rpid" ] && kill -0 $rpid 2>/dev/nullbefore killing
🧹 Nitpick comments (2)
app/export.go (2)
36-36: Verify legacy context usage is intentional.The switch to
NewContextLegacymay be temporary during the SDK migration. Confirm whether this is intended as a permanent change or if it should be updated to the modern context creation API in a follow-up.
91-278: Consider consistent error panic pattern.Throughout
prepForZeroHeightGenesis, errors are handled with panics (appropriate for unrecoverable genesis preparation failures), but there's minor inconsistency: some usepanic(err)(lines 94, 100, etc.) while others might benefit frompanic(err.Error())for clearer error messages. Consider standardizing topanic(err)throughout for consistency.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
app/export.go(5 hunks)app/testnet.go(3 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(13 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(13 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
app/export.go (2)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)app/config.go (1)
ModuleBasics(70-72)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (3)
TestnetDelegation(29-32)TestnetAccount(54-57)TestnetGov(45-48)
cmd/akash/cmd/testnetify/testnetify.go (2)
util/server/server.go (1)
GetAppDBBackend(221-231)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: network-upgrade
- GitHub Check: release-dry-run
- GitHub Check: coverage
- GitHub Check: sims
- GitHub Check: tests
- GitHub Check: lint-go
- GitHub Check: build-macos
- GitHub Check: build-bins
🔇 Additional comments (26)
meta.json (1)
43-47: Verify the RC version source for production upgrade.The new v1.0.0 upgrade entry is syntactically valid and follows the established pattern. However, using an RC version (
v0.38.6-rc2) as thefrom_binarysource for a major production release (v1.0.0) is atypical. For upgrades to stable releases, the upgrade path should typically originate from a stable binary version.Please confirm:
- Whether
v0.38.6-rc2is intentional or if this should be a stable release (e.g.,v0.38.6).- Whether this
from_version("v0.38.0") correctly reflects the minimum version for this upgrade path in the context of the cosmos-sdk v0.53.x migration.app/export.go (3)
30-34: Good API extension for module-aware genesis export.The addition of
modulesToExportparameter enables selective module export, aligning with the broader module orchestration improvements in this PR.
47-50: Proper error handling for module-aware genesis export.The error handling for
ExportGenesisForModulesis correctly implemented with proper propagation.
282-346: Well-designed Setup function with options pattern.The refactored
Setupfunction uses a clean functional options pattern, enabling flexible app initialization with configurable genesis functions and deterministic genesis time. The implementation properly handles errors fromInitChainand aligns with modern Go API design practices.app/testnet.go (3)
29-64: Well-structured testnet configuration types.The new type definitions (
TestnetDelegation,TestnetAccount,TestnetGov) and updated structures properly support the enhanced testnet initialization flow with delegation support, account balances, and governance parameter configuration.
143-150: Proper bech32 address conversion for validators.The operator address conversion logic correctly handles bech32 encoding/decoding with appropriate error handling.
251-263: Correct governance parameter configuration.The governance parameter setup properly uses pointer fields for voting periods, aligning with the updated SDK API.
cmd/akash/cmd/testnetify/config.go (1)
44-67: Type definitions align with testnet architecture.The updated
TestnetValidatorandTestnetConfigstructures properly reflect the enhanced testnet capabilities (delegation support, status tracking) and align with the corresponding types inapp/testnet.go.cmd/akash/cmd/testnetify/testnetify.go (4)
170-183: Proper configuration and telemetry setup.The addition of config validation and telemetry initialization follows Cosmos SDK best practices with appropriate error handling.
290-303: Correct genesis file API migration.The migration from
GenesisDocFromFiletoAppGenesisFromFilealigns with CometBFT patterns and includes proper validation withValidateAndComplete.
340-342: Modern store initialization with configurable options.The use of
sm.StoreOptionswithDiscardABCIResponsesproperly integrates configuration-driven store behavior.
498-508: Voting power calculation from delegations.The voting power calculation correctly accumulates delegation amounts divided by the default power reduction factor. Ensure that the delegation amounts in the testnet config are properly set to achieve the desired validator voting powers.
make/test-upgrade.mk (4)
15-43: LGTM! Well-structured snapshot source configuration.The conditional logic for selecting snapshot networks (mainnet, sandbox, sandbox1) is clear and includes appropriate error handling for invalid sources. The derived variables (SNAPSHOT_URL, MAX_VALIDATORS) are properly wired from the configuration.
45-57: LGTM! Comprehensive flag passing to init flow.The init target correctly passes all new CLI options (chain-meta, snapshot-url, state-config, max-validators) to the upgrade script, aligning with the modernized upgrade tooling.
66-73: LGTM! Test target properly wired.The test target correctly depends on init and passes the necessary arguments to the upgrade test suite.
86-91: LGTM! Conditional bins target properly isolated.The conditional bins target correctly isolates the binary building logic and can be skipped via the SKIP variable, providing flexibility in the test workflow.
script/upgrades.sh (10)
36-43: LGTM! New CLI options properly wired.The new command-line options (chain-meta, snapshot-url, state-config, max-validators) are correctly defined with sensible defaults and properly parsed in the getopts handler.
Also applies to: 115-127
134-180: LGTM! Robust trap management infrastructure.The stack-based trap management (
trap_add,trap_show) and cleanup function provide a clean way to ensure background processes are terminated on exit. The implementation correctly handles both new and existing trap handlers.
190-229: LGTM! Clear separation of archive utilities.The
tar_by_content_typefunction returns executable tar commands for unpacking, whilecontent_typereturns file extensions for naming. This separation is clean and supports multiple compression formats (gzip, xz, lz4, zstd).
246-264: LGTM! Improved content header parsing.The
content_nameandcontent_locationfunctions properly extract metadata from HTTP headers with appropriate fallbacks when headers are missing.
319-412: LGTM! Comprehensive per-validator initialization.The init function properly sets up per-validator directories, binaries, environment configuration, and key files. The command substitution in validator.json generation is correct, and the flow naturally transitions to prepare_state at the end.
476-521: LGTM! Comprehensive snapshot handling with nested directory support.The snapshot download and extraction logic correctly handles various archive formats, detects and relocates nested data directories, and initializes minimal state for non-primary validators.
615-649: LGTM! Clean function properly resets validator state.The clean function correctly removes logs, data, and upgrade artifacts, then resets the symlink to genesis for a fresh start.
651-682: LGTM! Key import handles format upgrades.The import_keys function properly resets the keyring to handle potential format changes across upgrades, then correctly recovers keys from mnemonics with the appropriate index.
684-720: LGTM! Bins function properly isolated.The bins function correctly handles binary building or copying for all validators, mirroring the logic from the init function.
722-796: LGTM! New command routing and snapshot-source logic.The new command routing properly exposes
prepare-stateand adds thesnapshot-sourcecommand. The snapshot-source logic correctly parses semver build tokens to extract network information and falls back to mainnet for main branches.
7ecc16e to
7a1e86a
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/export.go (1)
125-125: Inconsistent error handling for WithdrawDelegationRewards.Line 125 explicitly ignores errors from
WithdrawDelegationRewardsusing_, _ =, while all other operations in this function panic on errors. This inconsistency could mask issues during genesis preparation.Please clarify why errors are ignored here. If errors should be handled, apply this diff:
- _, _ = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + _, err = app.Keepers.Cosmos.Distr.WithdrawDelegationRewards(ctx, delAddr, valAddr) + if err != nil { + if !errorsmod.IsOf(err, distrtypes.ErrEmptyDelegationDistInfo) { + panic(err) + } + }
♻️ Duplicate comments (12)
script/upgrades.sh (5)
131-132: Add error handling for metadata fetch and URL derivation.The curl and jq pipeline can fail silently; curl failures on the left-hand side of a pipeline are ignored. If
CHAIN_METADATAfetch fails or jq resolution returns empty,GENESIS_URLbecomes empty, leading to confusing failures downstream at line 447+.Apply this diff to add error handling:
CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") +if [ -z "$CHAIN_METADATA" ]; then + echo "Failed to fetch chain metadata from $CHAIN_METADATA_URL" >&2 + exit 1 +fi GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')" +if [ -z "$GENESIS_URL" ]; then + echo "Failed to resolve GENESIS_URL from chain metadata" >&2 + exit 1 +fi
458-462: Fix genesis download extraction command — usetar_by_content_type.Line 458 uses
content_typewhich only yields an extension string (e.g.,tar.gz), soeval "$tar_cmd"executes a non-existent command and the genesis tarball never extracts. Replace withtar_by_content_type(as correctly done at line 488 for snapshots).Apply this diff:
- tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") + tar_cmd=$(tar_by_content_type "$(content_name "${GENESIS_URL}")") if [ "$tar_cmd" != "" ]; then
470-474: Fix genesis unpacking command — usetar_by_content_typefor local files too.Line 471 has the same issue as line 458: uses
content_type(extension string) instead oftar_by_content_type(extraction command). Theeval "$tar_cmd"will fail.Apply this diff:
else - echo "Unpacking genesis from ${GENESIS_URL}" - tar_cmd=$(content_type "${GENESIS_URL}") + echo "Unpacking genesis from ${GENESIS_URL}" + tar_cmd=$(tar_by_content_type "${GENESIS_URL}") # shellcheck disable=SC2086 - (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n' + (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n'
441-445: Fix incorrect variable assignment for addrbook file path.Line 442 assigns
addrbook_filetogenesis.jsoninstead ofaddrbook.json. This is clearly a copy-paste error. Both files are then removed at lines 443-444, butaddrbook_fileshould reference the correct file.Apply this diff:
genesis_file=${valdir}/config/genesis.json - addrbook_file=${valdir}/config/genesis.json + addrbook_file=${valdir}/config/addrbook.json rm -f "$genesis_file" rm -f "$addrbook_file"
534-578: Add error handling for validator startup and process management.The validator startup at line 536 lacks verification that the process started successfully. If
$AKASH startfails,rpidwill capture an invalid process ID, causing subsequent operations to fail or kill unrelated processes. Additionally, there are no checks after$AKASH version(line 538) or transaction submissions (lines 543-573).Apply this diff to add error handling:
if [[ $MAX_VALIDATORS -gt 1 ]]; then echo "starting testnet validator" - $AKASH start --home="$rvaldir" >/dev/null 2>&1 & rpid=$! + $AKASH start --home="$rvaldir" >/dev/null 2>&1 & rpid=$! + + # Verify process is running + sleep 1 + if ! kill -0 $rpid 2>/dev/null; then + echo "Failed to start validator process" >&2 + exit 1 + fi akashversion=$($AKASH version) + if [ -z "$akashversion" ]; then + echo "Failed to get AKASH version" >&2 + kill -SIGINT $rpid 2>/dev/null || true + exit 1 + fi sleep 10 echo "adding remaining validators to the state" cnt=0 for val in $(jq -c '.validators[]' <<<"$config"); do local valdir local valjson valdir=$validators_dir/.akash${cnt} 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 "$valjson" --home="$rvaldir" --from="validator$cnt" --yes + if ! $AKASH tx staking create-validator "$valjson" --home="$rvaldir" --from="validator$cnt" --yes; then + echo "Warning: Failed to create validator $cnt, continuing..." >&2 + fi else - $AKASH tx staking create-validator \ + if ! $AKASH tx staking create-validator \ --home="$rvaldir" \ --moniker="$(jq -rc '.moniker' <<<"$valjson")" \ --amount="$(jq -rc '.amount' <<<"$valjson")" \ --min-self-delegation="$(jq -rc '."min-self-delegation"' <<<"$valjson")" \ --commission-max-change-rate="$(jq -rc '."commission-max-change-rate"' <<<"$valjson")" \ --commission-max-rate="$(jq -rc '."commission-max-rate"' <<<"$valjson")" \ --commission-rate="$(jq -rc '."commission-rate"' <<<"$valjson")" \ --pubkey="$($AKASH tendermint show-validator --home="$valdir")" \ --from="validator$cnt" \ --yes + then + echo "Warning: Failed to create validator $cnt, continuing..." >&2 + fi fi fi ((cnt++)) || true if [[ $cnt -eq $MAX_VALIDATORS ]]; then break fi done sleep 10 + if ! kill -0 $rpid 2>/dev/null; then + echo "Validator process exited prematurely" >&2 + fi + kill -SIGINT $rpid wait $rpidmake/test-upgrade.mk (2)
78-78: Remove the commented-outbinsline.This commented-out
binsinvocation was flagged in a previous review and marked as addressed in commit 54d8dc0, but it still appears in the current code. Thebinsfunctionality has been moved to a separate conditional target (lines 88-91), so this commented line should be removed to avoid confusion.
82-84: Add--snapshot-urlflag for consistency withtest-resetinvocation.The standalone
prepare-statetarget (line 84) omits the--snapshot-url=$(SNAPSHOT_URL)flag that is present in thetest-resetinvocation at line 80. This inconsistency was flagged in a previous review and marked as addressed in commit 2e33215, but it still appears to be missing in the current code.For consistency and to ensure the snapshot URL is available to the
prepare-statecommand in all contexts, the standalone target should also pass this flag.Apply this diff:
.PHONY: prepare-state prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-stateapp/testnet.go (2)
104-107: Fix inconsistent error handling (still present).This returns
nilimmediately on iterator error, inconsistent with the panic pattern used at lines 95-97 and throughout this function. The defer cleanup at lines 80-84 expects panic-based error handling.Apply this diff to maintain consistent error handling:
iterator, err = app.Keepers.Cosmos.Staking.LastValidatorsIterator(ctx) if err != nil { - return nil + panic(err.Error()) }
278-290: Fix upgrade store loader height calculation (still present).
UpgradeStoreLoaderrequires the actual scheduled upgrade height from the plan. PassingLatestVersion() + 1creates a mismatch: if the upgrade is scheduled at height 1000 but LatestVersion is 500, passing 501 causes the loader to panic when the binary boots at the real upgrade height (1010 per line 270).Apply this diff:
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Heightcmd/akash/cmd/testnetify/testnetify.go (3)
78-79: Fix argument specification mismatch (still present).The command requires exactly one positional argument via
Args: cobra.ExactArgs(1), but theRunEhandler ignores args (line 79), the example shows no arguments (line 77), and no positional arguments are used. This rejects valid invocations.Apply this diff:
- Args: cobra.ExactArgs(1), + Args: cobra.NoArgs,
283-286: Fix incorrect sort comparison function (still present).
sort.Slicerequiresfunc(i, j int) boolto compare elements at positionsiandj. The current implementation ignores the second parameter and doesn't perform a comparison between two elements, so sorting won't work correctly.Apply this diff to properly move the matching validator to the front:
thisVal := config.PrivValidatorKeyFile() - sort.Slice(tcfg.Validators, func(i, _ int) bool { - return thisVal == tcfg.Validators[i].Home - }) + sort.SliceStable(tcfg.Validators, func(i, j int) bool { + iMatch := thisVal == tcfg.Validators[i].Home + jMatch := thisVal == tcfg.Validators[j].Home + return iMatch && !jMatch + })
411-420: Fix undefined variable reference (still present).
getCtxis referenced at line 412 but is not in scope. It's defined as a local variable inside theGetCmdfunction'sRunEhandler (lines 186-191) and is not passed to thetestnetifyfunction. This code would fail to compile.Apply this diff:
cmtApp := NewCometABCIWrapper(testnetApp) - _, ctx := getCtx(sctx, true) + ctx := context.Background() clientCreator := proxy.NewLocalClientCreator(cmtApp)Since this is a temporary proxy app used only for probing initial application state (line 420), a simple background context is sufficient.
🧹 Nitpick comments (1)
app/export.go (1)
312-312: Consider making invCheckPeriod configurable.The
invCheckPeriodis hardcoded to5. Consider adding this as a configurable option viaSetupAppOptionif different test scenarios require varying invariant check frequencies.Add a new option to the setupAppOptions struct:
type setupAppOptions struct { encCfg sdkutil.EncodingConfig home string checkTx bool chainID string + invCheckPeriod uint genesisFn SetupGenesisFn }Then use it in NewApp:
app := NewApp( log.NewNopLogger(), db, nil, true, - 5, + cfg.invCheckPeriod, map[int64]bool{}, cfg.encCfg, appOpts, baseapp.SetChainID(cfg.chainID), )And provide a setter function in
app/option.go:func WithInvCheckPeriod(period uint) SetupAppOption { return func(cfg *setupAppOptions) { cfg.invCheckPeriod = period } }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
app/export.go(5 hunks)app/testnet.go(3 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(13 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)script/upgrades.sh(13 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- meta.json
🧰 Additional context used
🧬 Code graph analysis (4)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (3)
TestnetDelegation(29-32)TestnetAccount(54-57)TestnetGov(45-48)
cmd/akash/cmd/testnetify/testnetify.go (4)
util/server/server.go (1)
GetAppDBBackend(221-231)app/testnet.go (1)
TestnetConfig(59-64)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)testutil/network/network.go (2)
DefaultConfig(603-651)Validator(137-159)
app/export.go (2)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)app/config.go (1)
ModuleBasics(70-72)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
⏰ 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: lint-shell
- GitHub Check: lint-go
- GitHub Check: sims
- GitHub Check: release-dry-run
- GitHub Check: network-upgrade-names
- GitHub Check: build-bins
- GitHub Check: coverage
- GitHub Check: tests
🔇 Additional comments (24)
script/upgrades.sh (3)
190-229: Function implementations are correct.The separation of
tar_by_content_type(returns extraction command) andcontent_type(returns extension) is appropriate and correctly implemented.
414-522: Approveprepare_statefunction structure with conditional fixes.The
prepare_statefunction shows good separation of concerns between per-validator setup and snapshot/genesis handling. Once the critical issues at lines 442, 458, and 471 are addressed, the overall logic flow is sound.
739-796: New command routing is correct.The
prepare-stateandsnapshot-sourcecommands are properly integrated into the case statement. The snapshot-source semver parsing logic is sound and correctly handles the network token extraction.make/test-upgrade.mk (4)
24-37: LGTM! Good validation of SNAPSHOT_SOURCE.The conditional logic properly validates
SNAPSHOT_SOURCEwith three supported network options and fails fast with a clear error message for invalid values. The consistent setting of bothSNAPSHOT_NETWORKandCHAIN_METADATA_URLin each branch is good practice.
43-43: LGTM! MAX_VALIDATORS derivation is appropriate.The
jqcommand will fail loudly ifTEST_CONFIGis missing or malformed, which is acceptable behavior for a Makefile (fail-fast is preferable to silent failures).
46-57: LGTM! Extended AKASH_INIT invocation is well-structured.The addition of
--chain-meta,--state-config,--snapshot-url, and--max-validatorsflags properly integrates the new configuration variables. The multi-line formatting with backslash continuation is clean and readable.
87-91: LGTM! Conditional bins target is well-implemented.The use of
ifneq ($(findstring build,$(SKIP)),build)to conditionally skip the bins target is a proper Makefile pattern. The addition of--gbvand--chain-metaflags appropriately extends the functionality.app/testnet.go (4)
29-32: LGTM: Clean delegation type definition.The new
TestnetDelegationtype provides a clear structure for testnet delegation configuration.
45-48: LGTM: Clean governance config type.The
TestnetGovtype provides clear configuration for governance parameters in testnet environments.
130-140: LGTM: Proper account funding flow.The bank operations correctly mint coins to the mint module and transfer to target accounts with appropriate error handling.
143-151: Address conversion logic is correct.The bech32 decode/encode pattern properly converts account addresses to validator operator addresses with the "akashvaloper" prefix.
cmd/akash/cmd/testnetify/config.go (2)
44-57: LGTM: TestnetValidator structure updated consistently.The struct properly reflects the new testnet capabilities including delegation data and bond status. Type alignment with
app/testnet.gois correct.
61-67: LGTM: TestnetConfig aligned with app types.The config struct correctly references the new
TestnetAccountandTestnetGovtypes from the app package, maintaining consistency across the testnet infrastructure.cmd/akash/cmd/testnetify/testnetify.go (6)
50-55: LGTM: Standard server options initialization.The
StartCmdOptionssetup with defaultDBOpenerfollows the expected pattern.
116-125: LGTM: Sensible default account balances.The logic properly normalizes existing balances and provides reasonable defaults (uakt + IBC USDC) for testnet accounts without explicit balances.
170-192: LGTM: Proper server lifecycle setup.The config validation, telemetry initialization, and context management with quit signal handling follow best practices for long-running server processes.
200-248: LGTM: Proper block synchronization monitoring.The goroutine correctly waits for the first block to be committed and ensures at least one height increment before allowing shutdown, with appropriate timeout protection.
290-303: LGTM: Genesis handling properly migrated.The code correctly uses
AppGenesisFromFilefrom the new CometBFT-aligned API with proper validation and persistence.
498-508: LGTM: Correct voting power calculation.The delegation amounts are properly aggregated and converted to voting power using the standard power reduction divisor.
app/export.go (5)
282-294: LGTM: Clean option-based setup pattern.The refactored
Setupfunction with theSetupAppOptionpattern provides a clean, extensible API for test and development setup. The option-based configuration is a significant improvement over the previous implementation.
302-303: LGTM: Fixed seed for deterministic testing.Using a fixed seed (0) for the random number generator ensures deterministic genesis times across test runs, which is appropriate for the
Setupfunction's use case in testing and development.
319-344: LGTM: Proper InitChain setup with flexible genesis.The conditional
InitChaincall with support for custom genesis functions viagenesisFnprovides good flexibility for different test scenarios. Error handling is appropriate with panics for setup failures.
30-34: No action needed; behavior is documented and correct.The
modulesToExportparameter behavior is already documented inutil/server/server.go:198: "Comma-separated list of modules to export. If empty, will export all modules". This matches Cosmos SDK v0.53 behavior where nil or emptymodulesToExportexports all modules, which is the intended design per the Cosmos SDK ModuleManager API.
36-36: Confirm whether NewContextLegacy is required for genesis export or should use NewContext.Based on codebase analysis, NewContextLegacy should only be used when you must run legacy Amino/codec-dependent behavior or preserve old wiring during upgrades, while NewContext is recommended for v0.50+ code. This is the only use of NewContextLegacy in the codebase—all other context creation uses NewContext, including genesis-related operations in sim_test.go. Verify whether ExportGenesisForModules actually requires legacy codec support or if this should align with the rest of the codebase using NewContext.
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
🧹 Nitpick comments (1)
go.mod (1)
60-64: Verify maintenance status of Akash network forks.The PR introduces custom Akash-maintained forks for three critical dependencies:
github.com/akash-network/cometbft v0.38.19-akash.1github.com/akash-network/cosmos-sdk v0.53.4-akash.7github.com/akash-network/gogoproto v1.7.0-akash.2Ensure these forks are actively maintained, have security patches, and are kept in sync with upstream where appropriate. Consider documenting the fork divergence rationale for future maintainers.
📜 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 (1)
go.mod(1 hunks)
🧰 Additional context used
🪛 OSV Scanner (2.2.3)
go.mod
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks in github.com/hashicorp/go-getter
(GO-2025-3892)
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: network-upgrade
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: network-upgrade-names
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: tests
- GitHub Check: build-macos
- GitHub Check: build-bins
- GitHub Check: lint-go
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-shell
- GitHub Check: tests
- GitHub Check: coverage
- GitHub Check: build-macos
- GitHub Check: build-bins
🔇 Additional comments (3)
go.mod (3)
3-3: Verify Go 1.25.2 compatibility across all dependencies.The Go version was bumped from 1.23.x to 1.25.2. While this is generally safe, verify that all dependencies—especially the custom Akash forks (cometbft, cosmos-sdk, gogoproto)—are compatible with Go 1.25.2 and that the upgrade path has been tested.
70-76: Verify compatibility pins are correctly aligned with v0.53.x constraints.The replace block pins three dependencies for v0.53.x compatibility:
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7golang.org/x/exp v0.0.0-20230711153332-06a737ee72cbpgregory.net/rapid v0.5.5Confirm these pins are still the recommended versions per the cosmos-sdk v0.53.x migration guide, and verify there are no newer patched versions available that address security issues or bugs.
1-1: Module path migration verified; update hardcoded GitHub releases URL.The import migration from
github.com/akash-network/nodetopkg.akt.dev/nodehas been completed across the codebase—no old import statements remain.However,
util/cli/upgrade_info.go:68contains a hardcoded GitHub releases URL that still references the old path:https://github.com/akash-network/node/releases/download/%s. Verify and update this URL if the repository is now located atpkg.akt.devor if releases are published elsewhere.
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 (1)
go.mod (1)
178-178: 🔴 CRITICAL (Duplicate): Upgrade go-getter from v1.7.8 to patch version immediately.The dependency
github.com/hashicorp/go-getter v1.7.8has a HIGH severity vulnerability (GO-2025-3892, GHSA-wjrx-6529-hcj3) related to symlink attacks. This issue was flagged in the previous review and remains unresolved.Patched versions are available: v1.7.9, v1.7.10, v1.8.1, v1.8.2.
Apply this fix immediately before merging:
go get github.com/hashicorp/[email protected] go mod tidyVerify the fix resolves the vulnerability.
#!/bin/bash # Description: Verify go-getter vulnerability is resolved # Check current go-getter version in resolved dependencies go mod graph | grep go-getter # Verify patched version is now in use grep 'hashicorp/go-getter' go.mod go.sum | head -5
📜 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 (1)
go.mod(1 hunks)
🧰 Additional context used
🪛 OSV Scanner (2.2.3)
go.mod
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks in github.com/hashicorp/go-getter
(GO-2025-3892)
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks
⏰ 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: sims
- GitHub Check: network-upgrade-names
- GitHub Check: lint-go
- GitHub Check: release-dry-run
- GitHub Check: tests
- GitHub Check: build-macos
- GitHub Check: coverage
- GitHub Check: build-bins
- GitHub Check: sims
- GitHub Check: network-upgrade-names
- GitHub Check: build-macos
- GitHub Check: lint-go
- GitHub Check: tests
- GitHub Check: build-bins
- GitHub Check: coverage
- GitHub Check: release-dry-run
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
📜 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 (1)
go.mod(1 hunks)
🧰 Additional context used
🪛 OSV Scanner (2.2.3)
go.mod
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks in github.com/hashicorp/go-getter
(GO-2025-3892)
[HIGH] 178-178: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks
⏰ 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: sims
- GitHub Check: build-bins
- GitHub Check: lint-shell
- GitHub Check: build-macos
- GitHub Check: lint-go
- GitHub Check: release-dry-run
- GitHub Check: tests
- GitHub Check: network-upgrade-names
- GitHub Check: lint-go
- GitHub Check: coverage
- GitHub Check: network-upgrade-names
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: tests
- GitHub Check: build-bins
- GitHub Check: build-macos
51aaa96 to
f3a0466
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: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
script/upgrades.sh (1)
190-210: Fix archive extension patterns: use .tar.xz, not .tar.cz.Current patterns won’t match .tar.xz archives.
function tar_by_content_type() { case "$1" in - *.tar.cz*) + *.tar.xz*) tar_cmd="tar -xJ -" ;; *.tar.gz*) tar_cmd="tar xzf -" ;; @@ function content_type() { case "$1" in - *.tar.cz*) - tar_cmd="tar.cz" + *.tar.xz*) + tar_cmd="tar.xz" ;; *.tar.gz*) tar_cmd="tar.gz" ;;Also applies to: 212-230
app/types/app_test.go (1)
63-64: Fix test to actually assert type mismatch.It currently references unknown field "Vals", so it never reaches the type-mismatch path.
- _, err := FindStructField[int](&testStruct, "Vals") + _, err := FindStructField[int](&testStruct, "Val")
♻️ Duplicate comments (40)
.golangci.yaml (1)
35-37: Fix directory exclusion regexes (previously flagged, still unresolved).The patterns
third_party$,builtin$, andexamples$use end-of-string anchors, so they only match paths that are exactly those names. Files likethird_party/foo/bar.gowill still be linted, defeating the exclusion intent and surfacing third-party noise.Replace with patterns that match directory prefixes:
exclusions: rules: - path: (.+)\.go$ text: comment on exported (method|function|type|const|var) paths: - - third_party$ - - builtin$ - - examples$ + - third_party/ + - builtin/ + - examples/ formatters: enable: - gofmt exclusions: generated: lax paths: - - third_party$ - - builtin$ - - examples$ + - third_party/ + - builtin/ + - examples/Also applies to: 44-46
_docs/adr/adr-001-network-upgrades.md (1)
43-48: Replace hard tabs with spaces in code examples.The code block still uses hard tabs (detected by markdownlint). This issue was flagged in a previous review and should be addressed.
Apply this diff to replace tabs with spaces:
import ( - "github.com/cometbft/cometbft/libs/log" + "github.com/cometbft/cometbft/libs/log" - storetypes "cosmossdk.io/store" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "cosmossdk.io/x/upgrade/types" + storetypes "cosmossdk.io/store" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "cosmossdk.io/x/upgrade/types"make/setup-cache.mk (1)
8-8: DefineAKASH_RUN_BINbefore use.This issue was previously flagged:
$(AKASH_RUN_BIN)is not defined in any Makefile. Themkdir -p $(AKASH_RUN_BIN)command will fail if the variable is undefined or empty. Ensure the variable is defined in an included Makefile (e.g.,make/init.mk) before this file is processed.app/genesis.go (1)
67-154: Unresolved: Inconsistent error handling remains.The error handling issues flagged in the previous review are still present:
- Lines 75, 92-93, 111: Errors are silently ignored with
_- Lines 148-151: Generic panic message without context
Please address the previous review feedback by either:
- Propagating errors by returning
(GenesisState, error), or- Using consistent panics with descriptive messages for all error cases
cmd/akash/cmd/genaccounts.go (1)
96-100: Unresolved: Avoid panicking on user input errors.The panic on
authvesting.NewBaseVestingAccounterror remains from the previous review. This will crash the CLI on invalid vesting parameters instead of returning a proper error message to the user.Please replace the panic with error propagation:
baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) if err != nil { - panic(err) + return fmt.Errorf("failed to create vesting account: %w", err) }app/upgrades.go (2)
19-21: Unresolved: Early return prevents upgrade handler registration.This issue from the previous review remains: returning early when the height is skipped prevents registration of upgrade handlers, which will cause panics when a later upgrade plan is executed.
The suggested fix is to propagate a skip flag instead:
-if app.Keepers.Cosmos.Upgrade.IsSkipHeight(upgradeInfo.Height) { - return nil -} +skip := app.Keepers.Cosmos.Upgrade.IsSkipHeight(upgradeInfo.Height)Then guard the store-loading section with
if !skip && upgradeInfo.Name == name { ... }.
37-43: Unresolved: Redundant condition check.The redundant check
upgradeInfo.Name == nameon line 39 remains from the previous review. This condition is already guaranteed by the outerifblock on line 37.Apply this fix:
if upgradeInfo.Name == name { app.Logger().Info(fmt.Sprintf("configuring upgrade `%s`", name)) - if storeUpgrades := upgrade.StoreLoader(); storeUpgrades != nil && upgradeInfo.Name == name { + if storeUpgrades := upgrade.StoreLoader(); storeUpgrades != nil { app.Logger().Info(fmt.Sprintf("setting up store upgrades for `%s`", name)) app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades)) }go.mod (2)
152-152: Unresolved CRITICAL: CVE-2025-8959 in go-getter v1.7.8.The HIGH severity vulnerability in
go-getter v1.7.8flagged in previous reviews remains unresolved. This is a symlink traversal attack (CVE-2025-8959, GHSA-wjrx-6529-hcj3) that allows unauthorized reads outside the target directory.Upgrade to v1.7.9 or later immediately:
go get github.com/hashicorp/[email protected] go mod tidy
270-274: Unresolved: Verify Akash fork tags exist.Previous reviews flagged that
cosmos-sdk v0.53.4-akash.7may not exist in the Akash fork repository. This will cause dependency resolution failures.Please verify all three fork tags exist:
github.com/akash-network/cometbft v0.38.19-akash.1github.com/akash-network/cosmos-sdk v0.53.4-akash.7github.com/akash-network/gogoproto v1.7.0-akash.2Run this script to verify the tags exist:
#!/bin/bash # Verify Akash fork tags exist for repo in cometbft cosmos-sdk gogoproto; do echo "=== Checking $repo fork ===" gh api repos/akash-network/$repo/tags --jq '.[].name' | grep -E "(v0.38.19-akash.1|v0.53.4-akash.7|v1.7.0-akash.2)" || echo "Tag not found in $repo" donemake/test-upgrade.mk (2)
78-78: Remove stale commented-out bins invocation.This was moved to a separate conditional target; delete to avoid confusion.
- #$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins
82-85: Pass --snapshot-url to prepare-state.Without it, prepare-state defaults to mainnet snapshots, mismatching CHAIN_METADATA_URL and SNAPSHOT_SOURCE.
prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-stateapp/modules.go (1)
207-213: Remove duplicate authz simulation module registration.
authzmodule.NewAppModuleis added twice in appSimModules, doubling weights/ops. Keep a single registration.authzmodule.NewAppModule( app.cdc, app.Keepers.Cosmos.Authz, app.Keepers.Cosmos.Acct, app.Keepers.Cosmos.Bank, app.interfaceRegistry, ), @@ - authzmodule.NewAppModule( - app.cdc, - app.Keepers.Cosmos.Authz, - app.Keepers.Cosmos.Acct, - app.Keepers.Cosmos.Bank, - app.interfaceRegistry, - ),Also applies to: 227-233
script/upgrades.sh (3)
131-133: Add error handling for chain metadata and genesis URL resolution.Prevent silent failures leading to empty GENESIS_URL.
-CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") -GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')" +CHAIN_METADATA="$(curl -fsSL "${CHAIN_METADATA_URL}")" || { + echo "Failed to fetch chain metadata from ${CHAIN_METADATA_URL}" >&2 + exit 1 +} +GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')" || { + echo "Failed to parse chain metadata JSON" >&2 + exit 1 +} +if [ -z "$GENESIS_URL" ] || [ "$GENESIS_URL" = "null" ]; then + echo "GENESIS_URL not found in chain metadata" >&2 + exit 1 +}
441-445: Fix addrbook path.
addrbook_fileincorrectly points togenesis.json. Useaddrbook.json.- addrbook_file=${valdir}/config/genesis.json + addrbook_file=${valdir}/config/addrbook.json
534-541: Harden validator start/stop handling in prepare_state.Verify process started, capture PID safely, and guard kill/wait to avoid terminating unrelated PIDs.
- echo "starting testnet validator" - $AKASH start --home="$rvaldir" >/dev/null 2>&1 & rpid=$! - - akashversion=$($AKASH version) - - sleep 10 + echo "starting testnet validator" + set +e + $AKASH start --home="$rvaldir" >/dev/null 2>&1 & rpid=$! + set -e + if [ -z "$rpid" ] || ! kill -0 "$rpid" 2>/dev/null; then + echo "failed to start validator process" >&2 + exit 1 + fi + akashversion="$($AKASH version || true)" + if [ -z "$akashversion" ]; then + echo "failed to read akash version" >&2 + kill -SIGINT "$rpid" || true + wait "$rpid" || true + exit 1 + fi + sleep 10 @@ - kill -SIGINT $rpid - wait $rpid + if [ -n "$rpid" ] && kill -0 "$rpid" 2>/dev/null; then + kill -SIGINT "$rpid" || true + wait "$rpid" || true + fiAlso applies to: 575-579
app/testnet.go (2)
104-107: Use consistent error handling for iterator failure.Return here bypasses the deferred exit logic. Panic like other branches in this function.
- if err != nil { - return nil - } + if err != nil { + panic(err.Error()) + }
278-291: Pass the actual upgrade height to UpgradeStoreLoader.
LatestVersion()+1is not the scheduled height and can panic at runtime. UseupgradePlan.Height.- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Heightapp/types/app_test.go (1)
1-1: Avoid blanket revive suppression; narrow or document.Replace broad
//nolint: revivewith a targeted rule or a brief rationale.-package types //nolint: revive +// Package types provides test helpers for reflection-based field lookup. +package typesOr, if you truly need to suppress package comment only:
-package types //nolint: revive +package types //nolint:revive:package-comments // Test file does not require package docmake/init.mk (1)
50-54: Fix inverted vendor directory check.Error should trigger only when vendor dir is missing.
ifeq ($(GOMOD),vendor) - ifneq ($(wildcard ./vendor/.),) + ifeq ($(wildcard ./vendor/.),) $(error "go -mod is in vendor mode but vendor dir has not been found. consider to run go mod vendor") endif endifmake/releasing.mk (2)
12-12: Remove duplicateRELEASE_DOCKER_IMAGEdefinition.-RELEASE_DOCKER_IMAGE ?= ghcr.io/akash-network/node
16-18: Guard against emptyGOWORKbefore container path rewrite.-GORELEASER_GOWORK := $(GOWORK) -ifneq ($(GOWORK), off) - GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work -endif +GORELEASER_GOWORK := $(GOWORK) +ifneq ($(strip $(GOWORK)),) +ifneq ($(GOWORK), off) + GORELEASER_GOWORK := /go/src/$(GORELEASER_MOD_MOUNT)/go.work +endif +endifscript/tools.sh (2)
125-129: Use exact path match when skipping files.- for excluded_file in "${modules_to_upgrade_manually[@]}"; do - if [[ "$file" == *"$excluded_file"* ]]; then - continue 2 - fi - done + for excluded_file in "${modules_to_upgrade_manually[@]}"; do + if [[ "$file" == "$excluded_file" ]]; then + continue 2 + fi + done
191-196: Fix Debian package detection to avoid substring false positives.- if ! dpkg -l "$dep" >/dev/null 2>&1; then + if ! dpkg -W -f='${Status}' "$dep" 2>/dev/null | grep -q "^install ok"; then tools="$tools $dep" status="(not installed)" fiapp/sim/sim_utils.go (1)
31-36: Don’t construct a faketesting.Tfor the logger.Use a production‑safe logger or accept a real
*testing.Tfrom caller.- var logger log.Logger - if FlagVerboseValue { - logger = log.NewTestLogger(&testing.T{}) - } else { - logger = log.NewNopLogger() - } + var logger log.Logger + if FlagVerboseValue { + logger = log.NewLogger(os.Stdout) + } else { + logger = log.NewNopLogger() + }Also remove the unused
testingimport.app/export.go (2)
90-107: Make validator address conversion consistent.Two different patterns are used here. Use one consistently (suggest sdk.ValAddressFromBech32 for v0.53 code clarity).
- err := app.Keepers.Cosmos.Staking.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - valBz, err := app.Keepers.Cosmos.Staking.ValidatorAddressCodec().StringToBytes(val.GetOperator()) - if err != nil { - panic(err) - } + err := app.Keepers.Cosmos.Staking.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := sdk.ValAddressFromBech32(val.GetOperator()) + if err != nil { + panic(err) + } _, err = app.Keepers.Cosmos.Distr.WithdrawValidatorCommission(ctx, valBz) if err != nil { if !errorsmod.IsOf(err, distrtypes.ErrNoValidatorCommission) { panic(err) } } return false }) ... - err = app.Keepers.Cosmos.Staking.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - valBz, err := sdk.ValAddressFromBech32(val.GetOperator()) + err = app.Keepers.Cosmos.Staking.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := sdk.ValAddressFromBech32(val.GetOperator()) if err != nil { panic(err) }Also applies to: 138-170
231-233: Use keeper’s power‑store iterator instead of direct KV access.Prefer
ValidatorsPowerStoreIterator()to align with SDK abstractions.- store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) - iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter, err := app.Keepers.Cosmos.Staking.ValidatorsPowerStoreIterator(ctx) + if err != nil { + panic(err) + }cmd/akash/cmd/testnetify/testnetify.go (3)
78-80: Fix CLI arg spec: command takes no positional args.It’s declared as
ExactArgs(1)but ignores args; users can’t run it as documented.- Args: cobra.ExactArgs(1), + Args: cobra.NoArgs,
283-286: Fix invalid sort comparator.Comparator ignores j; use a proper comparison or a stable partition to move the current validator first.
- thisVal := config.PrivValidatorKeyFile() - sort.Slice(tcfg.Validators, func(i, _ int) bool { - return thisVal == tcfg.Validators[i].Home - }) + thisVal := config.PrivValidatorKeyFile() + sort.SliceStable(tcfg.Validators, func(i, j int) bool { + iMatch := thisVal == tcfg.Validators[i].Home + jMatch := thisVal == tcfg.Validators[j].Home + return iMatch && !jMatch + })
411-413: Fix undefinedgetCtxusage.
getCtxisn’t in scope here. Use a simple background context for the proxy Info call.- cmtApp := NewCometABCIWrapper(testnetApp) - _, ctx := getCtx(sctx, true) + cmtApp := NewCometABCIWrapper(testnetApp) + ctx := context.Background()cmd/akash/cmd/genesis.go (4)
27-27: Use gov v1 types instead of deprecated v1beta1.The code imports and uses deprecated
govtypesv1from v1beta1. Since this PR upgrades to SDK v0.53+, migrate to v1 gov types.
115-115: Fix nil pointer dereference.
genesisParams.ConsensusParamsis never initialized inMainnetGenesisParams()orTestnetGenesisParams(), causing a nil pointer dereference.Initialize in the constructor functions or add a nil check here.
108-180: Apply bank module genesis state for metadata and reserve accounts.The
GenesisParamsstruct includesNativeCoinMetadatasandStrategicReserveAccountsfields that are populated in constructors but never applied to the bank module genesis state. Denom metadata and reserve account balances won't be set.
161-162: Remove incorrect TODO comment.This TODO references
distributionGenStatebut appears in the crisis module section - likely a copy-paste error from lines 139-140.cmd/akash/cmd/testnet.go (2)
99-99: Correct default node daemon home to "akash".The default value "osmosisd" is a copy-paste leftover. Use "akash" to match this repository's daemon.
384-395: IP calculation has potential overflow issue.The function increments the last octet without checking for overflow. If
iis large enough, the octet could overflow to 0 without incrementing the third octet.Consider implementing proper carry-over or returning an error when the address space is exhausted.
app/app.go (3)
59-61: Fix IBC imports (compile-time breakage).
ibchost.ModuleNamelives incore/24-host, notcore/exported07-tendermintis not a module and should not be referenced in module orderingApply the correct import path and remove 07-tm from module ordering lists.
217-219: Mount memory stores to avoid runtime panics.Memory stores are not mounted. Modules that declare MemStoreKey will panic at runtime.
Add:
app.MountMemoryStores(app.GetMemoryStoreKey())
194-196: Set EndBlockers ordering.You define
OrderEndBlockersbut never set it on the module manager.Add:
app.MM.SetOrderEndBlockers(OrderEndBlockers(app.MM.ModuleNames())...)tests/e2e/market_cli_test.go (1)
5-21: Add the exported suite runner.Same issue previously noted on this file: tests won’t run without it.
@@ import ( "context" "path/filepath" + "testing" @@ - "pkg.akt.dev/node/testutil" + "pkg.akt.dev/node/testutil" + "github.com/stretchr/testify/suite" ) @@ } + +func TestMarketIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(marketIntegrationTestSuite)) +}#!/bin/bash # Ensure this new runner is discoverable rg -nP 'func\s+TestMarketIntegrationTestSuite\(' tests/e2eAlso applies to: 502-502
tests/e2e/deployment_cli_test.go (1)
139-145: Fix undefined DefaultDeposit: use the suite’s computed deposit.Use
s.defaultDeposit. This was flagged before; applying here too.- WithDeposit(DefaultDeposit). + WithDeposit(s.defaultDeposit). @@ - WithBroadcastModeBlock(). - WithDeposit(DefaultDeposit). + WithBroadcastModeBlock(). + WithDeposit(s.defaultDeposit).Also applies to: 286-291
🧹 Nitpick comments (35)
make/lint.mk (1)
23-29: Consider pinning the Docker image version.The shellcheck Docker configuration looks correct. However, using the
stabletag may lead to inconsistent behavior across different environments and over time.Consider pinning to a specific version for reproducible builds:
.PHONY: lint-shell lint-shell: docker run --rm \ --volume ${PWD}:/shellcheck \ --entrypoint sh \ - koalaman/shellcheck-alpine:stable \ + koalaman/shellcheck-alpine:v0.10.0 \ -x /shellcheck/script/shellcheck.shAlso verify that
script/shellcheck.shexists and is executable.make/mod.mk (1)
11-15: Remove commented-out code.The commented-out
modtarget serves no functional purpose and adds clutter. Either implement the target or remove the comment block entirely.Apply this diff to remove the commented code:
.PHONY: deps-tidy deps-tidy: go mod tidy - -#.PHONY: mod -#mod: go.mod -# -#go.mod: -# go mod tidyCHANGELOG.md (1)
41-41: Wrap the bare URL in angle brackets.The URL should be wrapped in angle brackets to comply with markdown best practices and avoid linter warnings.
Apply this diff:
-* (ibc-go) Use ibc v4.4.0 https://pkg.akt.dev/node/pull/1825 +* (ibc-go) Use ibc v4.4.0 <https://pkg.akt.dev/node/pull/1825>cmd/akash/cmd/testnetify/cmt_abci.go (1)
15-17: Consider returning a pointer receiver.The constructor returns a concrete
cometABCIWrappervalue. While this works for small structs, returning a pointer (*cometABCIWrapper) would be more conventional and consistent with typical Go interface implementations, especially for types that implement large interfaces likeabci.Application.Apply this diff:
-func NewCometABCIWrapper(app servertypes.ABCI) abci.Application { - return cometABCIWrapper{app: app} +func NewCometABCIWrapper(app servertypes.ABCI) abci.Application { + return &cometABCIWrapper{app: app} }app/genesis.go (1)
33-59: Consider more robust token filtering approach.The
genesisFilterTokensfunction uses string replacement on marshaled JSON, which is fragile and could unintentionally replace "stake" in unintended contexts (e.g., in comments, field names, or other string values). Consider implementing token filtering at the data structure level instead of string manipulation.For example:
// Filter at the data structure level instead func genesisFilterTokens(from GenesisState, cdc codec.Codec) GenesisState { genesisState := make(GenesisState) for k, v := range from { // Unmarshal, transform specific fields, remarshal // This is more explicit and less error-prone genesisState[k] = transformModuleGenesis(k, v, cdc) } return genesisState }app/upgrades.go (1)
46-51: Consider logging migration registrations.The migration registration block panics on errors, which is appropriate during startup. However, consider adding debug logging to track which migrations are being registered for troubleshooting purposes.
Example:
utypes.IterateMigrations(func(module string, version uint64, initfn utypes.NewMigrationFn) { + app.Logger().Debug(fmt.Sprintf("registering migration for module %s version %d", module, version)) migrator := initfn(utypes.NewMigrator(app.cdc, app.GetKey(module))) if err := app.Configurator.RegisterMigration(module, version, migrator.GetHandler()); err != nil { panic(err) } }).envrc (1)
111-111: Avoid side-effectfulmakein .envrc.Running
make cacheon every shell load is surprising and slow. Gate it behind an opt-in.-make cache +[ -n "${AKASH_DIRENV_RUN_MAKE_CACHE:-}" ] && make cachescript/upgrades.sh (1)
658-670: Remove duplicate local declaration.
local validators_diris declared twice.- local validators_dir - local cosmovisor_dir - local genesis_bin - local validators_dir + local validators_dir + local cosmovisor_dir + local genesis_binapp/testnet.go (1)
220-228: Avoid negative StartHeight in slashing info.
app.LastBlockHeight()-1can be negative at genesis.- newValidatorSigningInfo := slashingtypes.ValidatorSigningInfo{ - Address: newConsAddr.String(), - StartHeight: app.LastBlockHeight() - 1, - Tombstoned: false, - } + startHeight := app.LastBlockHeight() + newValidatorSigningInfo := slashingtypes.ValidatorSigningInfo{ + Address: newConsAddr.String(), + StartHeight: startHeight, + Tombstoned: false, + }README.md (1)
37-38: Use CometBFT name to match the link.Align anchor text with the CometBFT project to avoid confusion.
-The Suite is composed of one binary, `akash`, which contains a ([tendermint](https://github.com/cometbft/cometbft)-powered) blockchain node that +The Suite is composed of one binary, `akash`, which contains a ([CometBFT](https://github.com/cometbft/cometbft)-powered) blockchain node that.github/actions/setup-ubuntu/action.yaml (2)
15-17: Precede apt install with update; prefer apt-get for CI reliability.- run: sudo apt install -y make direnv unzip lz4 wget curl npm jq pv coreutils + run: | + sudo apt-get update -y + sudo apt-get install -y make direnv unzip lz4 wget curl npm jq pv coreutils
18-21: Node 18 is EOL; use current LTS (20) unless constrained.- node-version: 18 + node-version: 20make/init.mk (1)
45-47: Make error message reflect actual -mod value (and mod case).-$(error '-mod may only be set to readonly or vendor when in workspace mode, but it is set to ""') +$(error -mod may only be set to readonly or vendor in workspace mode; got "$(GOMOD)").github/workflows/release.yaml (1)
28-28: Quote env file and arguments (shellcheck SC2086).Prevent word-splitting/globbing when writing to
$GITHUB_ENVand passing$RELEASE_TAG.- - name: Set release version into env variable - run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Set release version into env variable + run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV" - name: configure variables run: | - test_required=$(./script/upgrades.sh test-required ${{ env.RELEASE_TAG }}) - echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV + test_required=$(./script/upgrades.sh test-required "${{ env.RELEASE_TAG }}") + echo "TEST_REQUIRED=$test_required" >> "$GITHUB_ENV" - - name: release version - run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: release version + run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV"Also applies to: 60-63, 90-90
app/mac.go (1)
13-24: Avoid reallocating the perms map on every call (optional).If called frequently, define a package-level map and return a cloned copy to keep immutability.
-func ModuleAccountPerms() map[string][]string { - return map[string][]string{ +var moduleAccountPerms = map[string][]string{ authtypes.FeeCollectorName: nil, emodule.ModuleName: nil, distrtypes.ModuleName: nil, minttypes.ModuleName: {authtypes.Minter}, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - } -} +} + +func ModuleAccountPerms() map[string][]string { + // Go 1.21+ + return maps.Clone(moduleAccountPerms) +}cmd/akash/cmd/testnetify/utils.go (3)
35-38: Avoid mutating the named returnerrinside cleanup.Use a local error variable to prevent confusing capture and potential data race in async shutdown paths.
- cleanup = func() { - if err = traceWriter.Close(); err != nil { - svrCtx.Logger.Error("failed to close trace writer", "err", err) - } - } + cleanup = func() { + if cerr := traceWriter.Close(); cerr != nil { + svrCtx.Logger.Error("failed to close trace writer", "err", cerr) + } + }
48-52: Tighten trace file permissions.Trace logs can contain sensitive data. Prefer 0600 over 0666.
- return os.OpenFile( //nolint: gosec + return os.OpenFile( //nolint: gosec traceWriterFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, - 0o666, + 0o600, )
55-62: Small ctx/shutdown ergonomics.
- Avoid ctx shadowing; name the derived context
gctxfor clarity.- Defensive: if
sctxis nil, still register signal handling using a no-op logger to avoid panic.-func getCtx(sctx *sdksrv.Context, block bool) (*errgroup.Group, context.Context) { - ctx, cancelFn := context.WithCancel(context.Background()) - g, ctx := errgroup.WithContext(ctx) - // listen for quit signals so the calling parent process can gracefully exit - server.ListenForQuitSignals(g, block, cancelFn, sctx.Logger) - return g, ctx +func getCtx(sctx *sdksrv.Context, block bool) (*errgroup.Group, context.Context) { + base, cancelFn := context.WithCancel(context.Background()) + g, gctx := errgroup.WithContext(base) + logger := sdksrv.ZeroLogWrapper(nil) + if sctx != nil { + logger = sctx.Logger + } + server.ListenForQuitSignals(g, block, cancelFn, logger) + return g, gctx }Please confirm
sdksrv.ZeroLogWrapper(nil)(or an equivalent no-op) is available; otherwise, substitute a known no-op logger.app/sim/sim_config.go (2)
57-76: Map all available flags intosimulation.Config.
PeriodandGenesisTimeflags are defined but not set on the returned config. Add them so CLI flags take effect.return simulation.Config{ GenesisFile: FlagGenesisFileValue, ParamsFile: FlagParamsFileValue, ExportParamsPath: FlagExportParamsPathValue, ExportParamsHeight: FlagExportParamsHeightValue, ExportStatePath: FlagExportStatePathValue, ExportStatsPath: FlagExportStatsPathValue, Seed: FlagSeedValue, InitialBlockHeight: FlagInitialBlockHeightValue, NumBlocks: FlagNumBlocksValue, BlockSize: FlagBlockSizeValue, Lean: FlagLeanValue, Commit: FlagCommitValue, OnOperation: FlagOnOperationValue, AllInvariants: FlagAllInvariantsValue, + Period: FlagPeriodValue, + GenesisTime: FlagGenesisTimeValue, DBBackend: "goleveldb", }Confirm
simulation.Configin SDK v0.53 still includesPeriodandGenesisTime.
32-55: Consider exposing DB backend as a flag.Hardcoding
"goleveldb"limits perf tests; letting callers choose (e.g.,"pebbledb") via a flag improves coverage..github/workflows/tests.yaml (3)
21-25: Addgnu-sedfor macOS build job.Your scripts use
gsed; install it to prevent failures.- brew install bash direnv pv lz4 + brew install bash direnv pv lz4 gnu-sed
118-118: Composite action metadata missingdescription.
.github/actions/setup-ubuntu/action.yamlshould include adescription:field to satisfy actionlint.
178-182: Quote variable expansions in shell snippets (SC2086).Prevents word splitting/globbing in upgrade job.
- test_required=$(./script/upgrades.sh test-required ${{ github.ref }}) + test_required=$(./script/upgrades.sh test-required "${{ github.ref }}") #snapshot_source=$(./script/upgrades.sh snapshot-source ${{ github.ref }}) echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV #echo "SNAPSHOT_SOURCE=$snapshot_source" >> $GITHUB_ENVapp/sim/sim_utils.go (1)
24-26: Nil logger when skipping can surprise callers.You return
nillogger withskip=true. Ensure all call sites gate onskipbefore using the logger, or return a no‑op logger to be safer.- return simtypes.Config{}, nil, "", nil, true, nil + return simtypes.Config{}, nil, "", log.NewNopLogger(), true, nilapp/app_configure.go (1)
55-81: Unify ModuleName constants (use one source).You mix audittypes/taketypes with cert/take/audit modules. Prefer using the module aliases consistently to avoid accidental divergence.
Apply this minimal change:
- audittypes.ModuleName, + audit.ModuleName, ... - taketypes.ModuleName, + take.ModuleName,Optionally remove now-unused imports:
audittypes "pkg.akt.dev/go/node/audit/v1"andtaketypes "pkg.akt.dev/go/node/take/v1".cmd/akash/cmd/root.go (1)
50-56: Docs: s/Tendermint/CometBFT in comments.These blocks still reference “Tendermint RPC”. Update wording to CometBFT for accuracy.
Also applies to: 60-67
cmd/akash/cmd/app_creator.go (2)
54-66: More robust chain‑ID fallback when viper key is absent.If
genesis_fileisn’t set, building a path fromhome/config/genesis.jsonavoids a panic.- genDocFile := filepath.Join(homeDir, cast.ToString(appOpts.Get("genesis_file"))) + genDocFile := cast.ToString(appOpts.Get("genesis_file")) + if genDocFile == "" { + genDocFile = filepath.Join(homeDir, "config", "genesis.json") + } + genDocFile = filepath.Clean(genDocFile)
67-76: Unify DB backend selection with util helper.The local
util/server.GetAppDBBackendwrapper handles both "app-db-backend" and "db_backend" configuration flags with proper fallback. This pattern is already used elsewhere (e.g.,testnetify.go). Update to match for consistency:+ "pkg.akt.dev/node/util/server" ... - snapshotDB, err := dbm.NewDB("metadata", sdkserver.GetAppDBBackend(appOpts), snapshotDir) + snapshotDB, err := dbm.NewDB("metadata", server.GetAppDBBackend(appOpts), snapshotDir)cmd/akash/cmd/testnetify/testnetify.go (1)
498-508: Ensure at least one validator has non‑zero voting power.If all
Delegationssum to zero, consensus may fail. Add a guard or default power.Add a check after computing
newValidatorsto enforce> 0total power, or inject a minimal stake for the first validator in testnet mode.Also applies to: 513-517
tests/e2e/provider_grpc_test.go (2)
60-67: Make provider assertions resilient; avoid hard-coding total count.Relying on
Len(...)=1andoffset=2 -> 0is brittle if more providers exist. Prefer asserting the expected owner exists in the collection and that pagination behaves relative to total.Example:
- s.Require().Len(out.Providers, 1, "Provider Creation Failed") - s.Require().Equal(val.Address.String(), providers[0].Owner) + var found bool + for _, p := range out.Providers { + if p.Owner == val.Address.String() { found = true; break } + } + s.Require().True(found, "expected provider owner not found") - s.Require().Len(providers.Providers, tc.expLen) - if tc.expLen != 0 { - s.Require().Equal(tc.expResp, providers.Providers[0]) - } + if tc.expLen == 0 { + s.Require().Empty(providers.Providers) + } else { + var got types.Provider + for _, p := range providers.Providers { + if p.Owner == tc.expResp.Owner { got = p; break } + } + s.Require().Equal(tc.expResp.Owner, got.Owner) + }Also applies to: 82-94, 102-109
146-161: Negative-case checks should assert HTTP error semantics, not just JSON unmarshal failure.Current tests pass if unmarshalling fails, but won't catch a handler mistakenly returning 200 with an error payload. Check HTTP status or error structure.
If available, use a helper that returns status code; otherwise parse
{code,message}error JSON and assert non-zerocode.Do we have a status-aware helper in your test utils? If yes, point me to it and I’ll patch the tests accordingly.
tests/e2e/provider_cli_test.go (2)
33-46: Validate tx success, not just lack of CLI error.Check ABCI code to catch failed transactions.
- _, err = clitestutil.TxCreateProviderExec( + res, err := clitestutil.TxCreateProviderExec( @@ ) s.Require().NoError(err) s.Require().NoError(s.Network().WaitForNextBlock()) + clitestutil.ValidateTxSuccessful(ctx, s.T(), cctx, res.Bytes()) @@ - _, err = clitestutil.TxUpdateProviderExec( + res, err = clitestutil.TxUpdateProviderExec( @@ ) s.Require().NoError(err) + clitestutil.ValidateTxSuccessful(ctx, s.T(), cctx, res.Bytes())Also applies to: 79-91
56-63: Avoid assuming exactly one provider exists.Assert presence of the expected owner instead of
Len(...)=1.Minimal change:
- s.Require().Len(out.Providers, 1, "Provider Creation Failed") - providers := out.Providers - s.Require().Equal(addr.String(), providers[0].Owner) + var found bool + for _, p := range out.Providers { if p.Owner == addr.String() { found = true; break } } + s.Require().True(found, "expected provider owner not found")tests/e2e/market_cli_test.go (1)
280-294: Assert ABCI success for bid/lease/close operations.Catch failed txs early.
- _, err = clitestutil.TxCreateBidExec( + res, err := clitestutil.TxCreateBidExec( @@ ) s.Require().NoError(err) s.Require().NoError(s.Network().WaitForNextBlock()) + clitestutil.ValidateTxSuccessful(ctx, s.T(), cctx, res.Bytes()) @@ - _, err = clitestutil.TxCreateLeaseExec( + res, err = clitestutil.TxCreateLeaseExec( @@ ) s.Require().NoError(err) s.Require().NoError(s.Network().WaitForNextBlock()) + clitestutil.ValidateTxSuccessful(ctx, s.T(), cctx, res.Bytes()) @@ - _, err = clitestutil.TxCloseBidExec( + res, err = clitestutil.TxCloseBidExec( @@ ) s.Require().NoError(err) s.Require().NoError(s.Network().WaitForNextBlock()) + clitestutil.ValidateTxSuccessful(ctx, s.T(), cctx, res.Bytes())Also applies to: 364-377, 416-429
tests/e2e/deployment_cli_test.go (1)
424-427: Avoid hardcoding denom and int64 math in fee/balance checks.Use the chain’s bond denom and
Intops to prevent overflow/denom drift.- s.Require().Equal(ownerBal.SubRaw(fees.GetFee().AmountOf("uakt").Int64()), curOwnerBal) + s.Require().Equal(ownerBal.Sub(fees.GetFee().AmountOf(s.Config().BondDenom)), curOwnerBal) @@ - s.Require().Equal(ownerBal.Sub(s.defaultDeposit.Amount).SubRaw(fees.GetFee().AmountOf("uakt").Int64()), curOwnerBal) + s.Require().Equal(ownerBal.Sub(s.defaultDeposit.Amount).Sub(fees.GetFee().AmountOf(s.Config().BondDenom)), curOwnerBal) @@ - s.Require().Equal(ownerBal.Add(s.defaultDeposit.Amount).SubRaw(fees.GetFee().AmountOf("uakt").Int64()), s.getAccountBalance(s.addrDeployer)) + s.Require().Equal(ownerBal.Add(s.defaultDeposit.Amount).Sub(fees.GetFee().AmountOf(s.Config().BondDenom)), s.getAccountBalance(s.addrDeployer))Also applies to: 448-451, 530-532
📜 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 (147)
.env(1 hunks).envrc(1 hunks).github/.repo(1 hunks).github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/concommits.yaml(1 hunks).github/workflows/release.yaml(3 hunks).github/workflows/tests.yaml(7 hunks).golangci.yaml(1 hunks).goreleaser-docker.yaml(1 hunks).goreleaser-test-bins.yaml(1 hunks).goreleaser.yaml(5 hunks).mockery.yaml(1 hunks)CHANGELOG.md(1 hunks)Makefile(3 hunks)README.md(1 hunks)_build/single-node.sh(2 hunks)_docs/adr/adr-001-network-upgrades.md(1 hunks)app/ante.go(1 hunks)app/app.go(7 hunks)app/app_configure.go(3 hunks)app/app_test.go(0 hunks)app/config.go(2 hunks)app/decorators/gov_filter.go(0 hunks)app/decorators/min_commision.go(0 hunks)app/export.go(5 hunks)app/genesis.go(2 hunks)app/mac.go(2 hunks)app/modules.go(1 hunks)app/option.go(1 hunks)app/params/proto.go(0 hunks)app/sim/sim_config.go(1 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(4 hunks)app/testnet.go(5 hunks)app/types/app.go(3 hunks)app/types/app_test.go(1 hunks)app/upgrades.go(2 hunks)client/client.go(0 hunks)client/utils.go(3 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/auth.go(2 hunks)cmd/akash/cmd/bech32.go(1 hunks)cmd/akash/cmd/flag_test.go(0 hunks)cmd/akash/cmd/genaccounts.go(6 hunks)cmd/akash/cmd/genesis.go(1 hunks)cmd/akash/cmd/root.go(3 hunks)cmd/akash/cmd/testnet.go(1 hunks)cmd/akash/cmd/testnetify/cmt_abci.go(1 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(14 hunks)cmd/akash/cmd/testnetify/utils.go(2 hunks)cmd/akash/main.go(1 hunks)cmd/common/flags.go(0 hunks)cmd/common/signal.go(0 hunks)cmd/common/util.go(0 hunks)cmd/common/util_test.go(0 hunks)docgen/main.go(1 hunks)events/cmd/root.go(0 hunks)events/publish.go(0 hunks)events/publish_test.go(0 hunks)events/query.go(0 hunks)go.mod(1 hunks)install.sh(0 hunks)make/codegen.mk(1 hunks)make/init.mk(4 hunks)make/lint.mk(1 hunks)make/mod.mk(1 hunks)make/releasing.mk(6 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(2 hunks)make/test-simulation.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)pubsub/bus_test.go(1 hunks)script/tools.sh(1 hunks)script/upgrades.sh(13 hunks)sdl/_testdata/deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/private_service.yaml(0 hunks)sdl/_testdata/profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/service-mix.yaml(0 hunks)sdl/_testdata/service-mix2.yaml(0 hunks)sdl/_testdata/simple-double-ram.yaml(0 hunks)sdl/_testdata/simple-gpu.yaml(0 hunks)sdl/_testdata/simple-with-ip.yaml(0 hunks)sdl/_testdata/simple.yaml(0 hunks)sdl/_testdata/simple2.yaml(0 hunks)sdl/_testdata/simple3.yaml(0 hunks)sdl/_testdata/simple4.yaml(0 hunks)sdl/_testdata/storageClass1.yaml(0 hunks)sdl/_testdata/storageClass2.yaml(0 hunks)sdl/_testdata/storageClass3.yaml(0 hunks)sdl/_testdata/storageClass4.yaml(0 hunks)sdl/_testdata/storageClass5.yaml(0 hunks)sdl/_testdata/storageClass6.yaml(0 hunks)sdl/_testdata/v2.1-credentials-error.yaml(0 hunks)sdl/_testdata/v2.1-credentials.yaml(0 hunks)sdl/_testdata/v2.1-deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-private_service.yaml(0 hunks)sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-service-mix.yaml(0 hunks)sdl/_testdata/v2.1-service-mix2.yaml(0 hunks)sdl/_testdata/v2.1-simple-gpu.yaml(0 hunks)sdl/_testdata/v2.1-simple-with-ip.yaml(0 hunks)sdl/_testdata/v2.1-simple.yaml(0 hunks)sdl/_testdata/v2.1-simple2.yaml(0 hunks)sdl/_testdata/v2.1-simple3.yaml(0 hunks)sdl/_testdata/v2.1-simple4.yaml(0 hunks)sdl/coin.go(0 hunks)sdl/coin_test.go(0 hunks)sdl/cpu.go(0 hunks)sdl/cpu_test.go(0 hunks)sdl/expose.go(0 hunks)sdl/full_test.go(0 hunks)sdl/gpu.go(0 hunks)sdl/gpu_test.go(0 hunks)sdl/groupBuilder_v2.go(0 hunks)sdl/groupBuilder_v2_1.go(0 hunks)sdl/memory.go(0 hunks)sdl/placement.go(0 hunks)sdl/pricing.go(0 hunks)sdl/resources.go(0 hunks)sdl/sdl.go(0 hunks)sdl/sdl_test.go(0 hunks)sdl/storage.go(0 hunks)sdl/storage_test.go(0 hunks)sdl/units.go(0 hunks)sdl/units_test.go(0 hunks)sdl/util/util.go(0 hunks)sdl/util/util_test.go(0 hunks)sdl/utils.go(0 hunks)sdl/v2.go(0 hunks)sdl/v2_1.go(0 hunks)sdl/v2_1_ip_test.go(0 hunks)sdl/v2_1_test.go(0 hunks)sdl/v2_ip_test.go(0 hunks)sdl/v2_test.go(0 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.json(1 hunks)
💤 Files with no reviewable changes (75)
- sdl/_testdata/v2.1-credentials-error.yaml
- events/publish_test.go
- client/client.go
- sdl/_testdata/v2.1-service-mix2.yaml
- sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml
- sdl/_testdata/storageClass4.yaml
- sdl/_testdata/v2.1-simple3.yaml
- sdl/_testdata/simple2.yaml
- cmd/common/util.go
- sdl/expose.go
- sdl/cpu.go
- cmd/common/util_test.go
- sdl/memory.go
- app/params/proto.go
- sdl/_testdata/simple4.yaml
- sdl/storage_test.go
- cmd/common/signal.go
- sdl/_testdata/v2.1-simple4.yaml
- sdl/coin.go
- events/cmd/root.go
- sdl/_testdata/storageClass5.yaml
- events/publish.go
- sdl/units_test.go
- sdl/v2_1_ip_test.go
- sdl/pricing.go
- sdl/v2_ip_test.go
- sdl/v2_test.go
- sdl/resources.go
- sdl/cpu_test.go
- sdl/utils.go
- app/decorators/min_commision.go
- events/query.go
- sdl/_testdata/profile-svc-name-mismatch.yaml
- sdl/units.go
- sdl/_testdata/deployment-svc-mismatch.yaml
- sdl/_testdata/simple.yaml
- cmd/common/flags.go
- sdl/_testdata/v2.1-simple.yaml
- sdl/_testdata/v2.1-simple-with-ip.yaml
- install.sh
- sdl/_testdata/v2.1-service-mix.yaml
- sdl/groupBuilder_v2.go
- sdl/full_test.go
- sdl/_testdata/simple-gpu.yaml
- sdl/_testdata/private_service.yaml
- sdl/gpu_test.go
- sdl/placement.go
- sdl/sdl.go
- sdl/_testdata/storageClass1.yaml
- sdl/gpu.go
- sdl/_testdata/v2.1-deployment-svc-mismatch.yaml
- app/decorators/gov_filter.go
- sdl/v2.go
- sdl/_testdata/storageClass6.yaml
- sdl/coin_test.go
- sdl/util/util_test.go
- sdl/_testdata/v2.1-private_service.yaml
- sdl/_testdata/v2.1-simple2.yaml
- sdl/_testdata/simple3.yaml
- sdl/_testdata/service-mix2.yaml
- app/app_test.go
- sdl/_testdata/storageClass3.yaml
- sdl/groupBuilder_v2_1.go
- sdl/_testdata/storageClass2.yaml
- sdl/v2_1.go
- sdl/_testdata/simple-double-ram.yaml
- sdl/_testdata/service-mix.yaml
- sdl/_testdata/v2.1-credentials.yaml
- sdl/_testdata/v2.1-simple-gpu.yaml
- sdl/_testdata/simple-with-ip.yaml
- sdl/v2_1_test.go
- sdl/storage.go
- cmd/akash/cmd/flag_test.go
- sdl/util/util.go
- sdl/sdl_test.go
🚧 Files skipped from review as they are similar to previous changes (21)
- cmd/akash/cmd/bech32.go
- .env
- make/codegen.mk
- app/option.go
- tests/e2e/deployment_grpc_test.go
- tests/e2e/market_grpc_test.go
- tests/e2e/grpc_test.go
- docgen/main.go
- cmd/akash/cmd/auth.go
- tests/e2e/certs_grpc_test.go
- Makefile
- .goreleaser-docker.yaml
- tests/e2e/cli_test.go
- _build/single-node.sh
- pubsub/bus_test.go
- .mockery.yaml
- client/utils.go
- tests/upgrade/config.json
- tests/e2e/certs_cli_test.go
- make/test-integration.mk
- make/test-simulation.mk
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-08T15:59:15.441Z
Learnt from: troian
PR: akash-network/node#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.mk
🧬 Code graph analysis (12)
cmd/akash/main.go (1)
cmd/akash/cmd/root.go (2)
NewRootCmd(31-46)Execute(49-58)
app/sim_test.go (3)
app/app.go (4)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)AppName(78-78)app/mac.go (1)
ModuleAccountAddrs(26-33)app/config.go (1)
ModuleBasics(70-72)
cmd/akash/cmd/app_creator.go (3)
util/server/server.go (1)
GetAppDBBackend(221-231)app/app.go (2)
NewApp(105-261)AkashApp(92-102)app/testnet.go (2)
TestnetConfig(59-64)InitAkashAppForTestnet(69-297)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (1)
TestnetGov(45-48)
cmd/akash/cmd/root.go (6)
app/config.go (1)
ModuleBasics(70-72)app/app.go (1)
DefaultHome(82-82)cmd/akash/cmd/bech32.go (1)
ConvertBech32Cmd(12-47)cmd/akash/cmd/auth.go (1)
AuthCmd(24-32)cmd/akash/cmd/testnetify/testnetify.go (1)
GetCmd(50-276)cmd/akash/cmd/genaccounts.go (1)
AddGenesisAccountCmd(35-195)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
app/app_configure.go (3)
x/take/alias.go (1)
ModuleName(11-11)x/market/alias.go (1)
ModuleName(13-13)x/cert/alias.go (1)
ModuleName(13-13)
app/export.go (2)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)app/config.go (1)
ModuleBasics(70-72)
app/app.go (6)
app/types/app.go (1)
App(123-134)app/mac.go (2)
ModuleAccountPerms(13-24)ModuleAccountAddrs(26-33)app/app_configure.go (1)
OrderInitGenesis(54-82)app/ante.go (1)
NewAnteHandler(21-61)upgrades/types/types.go (1)
GetHeightPatchesList(99-101)app/config.go (1)
ModuleBasics(70-72)
app/types/app.go (4)
x/deployment/keeper/keeper.go (2)
Keeper(36-44)NewKeeper(47-54)x/escrow/keeper/keeper.go (2)
Keeper(30-50)NewKeeper(52-68)x/take/keeper/keeper.go (2)
Keeper(24-30)NewKeeper(33-39)x/market/hooks/hooks.go (1)
Hooks(13-16)
cmd/akash/cmd/testnetify/testnetify.go (2)
util/server/server.go (1)
GetAppDBBackend(221-231)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)
app/upgrades.go (3)
upgrades/types/types.go (5)
GetUpgradesList(95-97)IterateMigrations(119-125)NewMigrationFn(27-27)NewMigrator(60-65)RegisterMigration(107-117)app/types/app.go (1)
App(123-134)app/app.go (1)
AkashApp(92-102)
🪛 actionlint (1.7.8)
.github/workflows/release.yaml
13-13: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
22-22: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
45-45: label "gh-runner-test" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
58-58: shellcheck reported issue in this script: SC2086:info:1:48: Double quote to prevent globbing and word splitting
(shellcheck)
60-60: shellcheck reported issue in this script: SC2086:info:2:40: Double quote to prevent globbing and word splitting
(shellcheck)
.github/workflows/tests.yaml
109-109: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
118-118: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
172-172: shellcheck reported issue in this script: SC2086:info:3:38: Double quote to prevent globbing and word splitting
(shellcheck)
172-172: shellcheck reported issue in this script: SC2086:info:4:40: Double quote to prevent globbing and word splitting
(shellcheck)
178-178: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 markdownlint-cli2 (0.18.1)
CHANGELOG.md
41-41: Bare URL used
(MD034, no-bare-urls)
_docs/adr/adr-001-network-upgrades.md
43-43: Hard tabs
Column: 1
(MD010, no-hard-tabs)
45-45: Hard tabs
Column: 1
(MD010, no-hard-tabs)
46-46: Hard tabs
Column: 1
(MD010, no-hard-tabs)
47-47: Hard tabs
Column: 1
(MD010, no-hard-tabs)
48-48: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🪛 OSV Scanner (2.2.3)
go.mod
[HIGH] 152-152: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks in github.com/hashicorp/go-getter
(GO-2025-3892)
[HIGH] 152-152: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks
⏰ 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
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: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
script/upgrades.sh (1)
191-207: Fix archive extension patterns (.tar.xz) and default handlingUse .tar.xz (not .tar.cz). Also, have content_type emit empty for non-archives (e.g., .json).
case "$1" in - *.tar.cz*) - tar_cmd="tar -xJ -" + *.tar.xz*) + tar_cmd="tar -xJ -" @@ function content_type() { case "$1" in - *.tar.cz*) - tar_cmd="tar.cz" + *.tar.xz*) + tar_cmd="tar.xz" ;; *.tar.gz*) tar_cmd="tar.gz" ;; *.tar.lz4*) tar_cmd="tar.lz4" ;; *.tar.zst*) tar_cmd="tar.zst" ;; + *.json|*.ndjson|*.txt) + tar_cmd="" + ;; + *) + tar_cmd="" + ;; esacAlso applies to: 212-229
♻️ Duplicate comments (45)
cmd/akash/cmd/genaccounts.go (1)
96-101: Panic on invalid vesting input still not fixed.As noted in the previous review, panicking on error from
authvesting.NewBaseVestingAccountwill crash the CLI on invalid user input. This should return an error instead to allow graceful failure.make/init.mk (1)
50-54: Fix inverted vendor directory check logic.This issue was already identified in a previous review: the condition checks if the vendor directory exists (
ifneq) but then errors saying it hasn't been found. The logic is inverted.Apply this diff to fix the logic:
ifeq ($(GOMOD),vendor) - ifneq ($(wildcard ./vendor/.),) + ifeq ($(wildcard ./vendor/.),) $(error "go -mod is in vendor mode but vendor dir has not been found. consider to run go mod vendor") endif endifmake/setup-cache.mk (1)
8-8: AKASH_RUN_BIN is undefined (duplicate concern).This issue was already flagged in previous reviews. The variable
$(AKASH_RUN_BIN)is not defined in any Makefile, which will cause themkdir -pcommand to fail or create an incorrect directory path.tests/e2e/provider_cli_test.go (1)
5-15: Add exported suite runner so the test executes (same issue as earlier).Without a Test* entrypoint, go test won’t run this suite. Add testing + suite imports and a runner at EOF.
import ( "context" "path/filepath" + "testing" "pkg.akt.dev/go/cli" clitestutil "pkg.akt.dev/go/cli/testutil" types "pkg.akt.dev/go/node/provider/v1beta4" "pkg.akt.dev/node/testutil" + "github.com/stretchr/testify/suite" ) @@ func (s *providerIntegrationTestSuite) TestProvider() { @@ } + +func TestProviderIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(providerIntegrationTestSuite)) +}Also applies to: 107-107
tests/e2e/deployment_grpc_test.go (3)
142-160: Fix REST error handling: assert on non-200 before unmarshalling.sdktestutil.GetRequest returns error on non-200; current flow calls NoError(err) then checks expErr, which masks error-path assertions.
s.Run(tc.name, func() { resp, err := sdktestutil.GetRequest(tc.url) - s.Require().NoError(err) - - var deployments v1beta4.QueryDeploymentsResponse - err = val.ClientCtx.Codec.UnmarshalJSON(resp, &deployments) - - if tc.expErr { - s.Require().NotNil(err) - s.Require().Empty(deployments.Deployments) - } else { - s.Require().NoError(err) - s.Require().Len(deployments.Deployments, tc.expLen) - s.Require().Equal(tc.expResp, deployments.Deployments[0]) - } + if tc.expErr { + s.Require().Error(err) + return + } + s.Require().NoError(err) + var deployments v1beta4.QueryDeploymentsResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, &deployments)) + s.Require().Len(deployments.Deployments, tc.expLen) + s.Require().Equal(tc.expResp, deployments.Deployments[0]) })
205-221: Same fix for TestGetDeployment.s.Run(tc.name, func() { resp, err := sdktestutil.GetRequest(tc.url) - s.Require().NoError(err) - - var out v1beta4.QueryDeploymentResponse - err = s.cctx.Codec.UnmarshalJSON(resp, &out) - - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expResp, out) - } + if tc.expErr { + s.Require().Error(err) + return + } + s.Require().NoError(err) + var out v1beta4.QueryDeploymentResponse + s.Require().NoError(s.cctx.Codec.UnmarshalJSON(resp, &out)) + s.Require().Equal(tc.expResp, out) })
269-286: Same fix for TestGetGroup.s.Run(tc.name, func() { resp, err := sdktestutil.GetRequest(tc.url) - s.Require().NoError(err) - - var out v1beta4.QueryGroupResponse - err = s.cctx.Codec.UnmarshalJSON(resp, &out) - - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expResp, out.Group) - } + if tc.expErr { + s.Require().Error(err) + return + } + s.Require().NoError(err) + var out v1beta4.QueryGroupResponse + s.Require().NoError(s.cctx.Codec.UnmarshalJSON(resp, &out)) + s.Require().Equal(tc.expResp, out.Group) })tests/e2e/provider_grpc_test.go (1)
5-17: Add exported suite runner so this suite runs (same issue as earlier).import ( "context" "fmt" "path/filepath" + "testing" "pkg.akt.dev/go/cli" clitestutil "pkg.akt.dev/go/cli/testutil" sdktestutil "github.com/cosmos/cosmos-sdk/testutil" types "pkg.akt.dev/go/node/provider/v1beta4" "pkg.akt.dev/node/testutil" + "github.com/stretchr/testify/suite" ) @@ func (s *providerGRPCRestTestSuite) TestGetProvider() { @@ } + +func TestProviderGRPCRestTestSuite(t *testing.T) { + suite.Run(t, new(providerGRPCRestTestSuite)) +}Also applies to: 163-163
tests/e2e/deployment_cli_test.go (2)
139-145: Use suite’s computed deposit; DefaultDeposit is undefined here.Replace DefaultDeposit with s.defaultDeposit.
WithFrom(s.addrDeployer.String()). - WithDeposit(DefaultDeposit). + WithDeposit(s.defaultDeposit). WithSkipConfirm(). WithGasAutoFlags(). WithBroadcastModeBlock()..., @@ WithBroadcastModeBlock(). - WithDeposit(DefaultDeposit). + WithDeposit(s.defaultDeposit). WithGasAutoFlags()...,Also applies to: 287-291
5-26: Add exported suite runner so this suite runs (same issue as earlier).import ( "context" "path/filepath" + "testing" sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdktestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" dv1 "pkg.akt.dev/go/node/deployment/v1" dv1beta4 "pkg.akt.dev/go/node/deployment/v1beta4" types "pkg.akt.dev/go/node/deployment/v1beta4" "pkg.akt.dev/go/cli" clitestutil "pkg.akt.dev/go/cli/testutil" "pkg.akt.dev/node/testutil" + "github.com/stretchr/testify/suite" ) @@ func (s *deploymentIntegrationTestSuite) getAccountBalance(address sdk.AccAddress) sdkmath.Int { @@ } + +func TestDeploymentIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(deploymentIntegrationTestSuite)) +}Also applies to: 542-542
tests/e2e/market_cli_test.go (1)
23-31: Add an exported Test function to actually run this suite*Without a
Test*entrypoint that callssuite.Run, these tests may never execute (unless wired elsewhere). Add a minimal runner.@@ package e2e import ( + "testing" "context" "path/filepath" @@ - "pkg.akt.dev/node/testutil" + "pkg.akt.dev/node/testutil" + "github.com/stretchr/testify/suite" ) +func TestMarketIntegrationTestSuite(t *testing.T) { + s := &marketIntegrationTestSuite{} + s.NetworkTestSuite = testutil.NewNetworkTestSuite(nil, s) + suite.Run(t, s) +}#!/bin/bash # Confirm no other runner already invokes this specific suite. rg -nP 'suite\.Run\([^)]+marketIntegrationTestSuite' --type=goapp/types/app_test.go (1)
1-1: Document the reason for lint suppression.The past review comment about the broad
//nolint: revivedirective remains unaddressed. This suppresses all revive linter rules without specifying which rule or explaining why, which can mask legitimate issues._docs/adr/adr-001-network-upgrades.md (1)
43-48: Replace hard tabs with spaces in code examples.The past review comment about hard tabs (flagged by markdownlint) remains unaddressed. For consistency and markdown best practices, the code block should use spaces for indentation.
.golangci.yaml (1)
35-37: Fix directory exclusion regexes.The past review comment remains valid. The patterns
third_party$,builtin$, andexamples$only match paths ending exactly with those names, sothird_party/foo/bar.gowill still get linted. This defeats the exclusion and will surface third-party noise.make/test-upgrade.mk (2)
78-78: Remove stale commented-out bins lineIt’s obsolete and confuses the flow. Delete it.
- #$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins
82-85: Pass --snapshot-url to prepare-state for parity with other callsStandalone prepare-state omits --snapshot-url, causing diverging behavior. Add it.
prepare-state: - $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state + $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-statego.mod (2)
269-275: Verify akash cosmos-sdk tag exists; update if neededThe replace points to github.com/akash-network/cosmos-sdk v0.53.4-akash.7. This tag was previously reported missing; confirm it exists or switch to an existing tag/commit.
#!/bin/bash # Verify the fork tag exists; print close matches gh api repos/akash-network/cosmos-sdk/tags --jq '.[] | .name' | rg -n 'v0\.53\.4-akash' gh api repos/akash-network/cosmos-sdk/git/refs/tags --jq '.[] | .ref' | rg -n 'v0\.53\.4-akash'
151-156: Critical: bump hashicorp/go-getter to patched version (CVE-2025-8959)v1.7.8 is vulnerable. Pin to v1.7.9+ via replace to ensure transitive consumers are patched.
Apply within the existing replace block:
replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + // CVE-2025-8959 fix + github.com/hashicorp/go-getter => github.com/hashicorp/go-getter v1.7.9 )script/upgrades.sh (4)
131-133: Add error handling for chain metadata fetch and GENESIS_URL derivationEmpty/failed fetch yields blank GENESIS_URL and confusing failures downstream. Validate both steps.
-CHAIN_METADATA=$(curl -s "${CHAIN_METADATA_URL}") -GENESIS_URL="$(echo "$CHAIN_METADATA" | jq -r '.codebase.genesis.genesis_url? // .genesis?')" +CHAIN_METADATA="$(curl -fsSL "${CHAIN_METADATA_URL}")" || { echo "Failed to fetch $CHAIN_METADATA_URL" >&2; exit 1; } +GENESIS_URL="$(printf '%s' "$CHAIN_METADATA" | jq -er '.codebase.genesis.genesis_url? // .genesis?')" || { echo "Failed to resolve GENESIS_URL from chain metadata" >&2; exit 1; }
441-445: addrbook_file points to genesis.jsonUse addrbook.json. This breaks addrbook handling.
- addrbook_file=${valdir}/config/genesis.json + addrbook_file=${valdir}/config/addrbook.json
458-466: content_type returns an extension, not a tar command; use tar_by_content_type and fallback to raw fileAs written, eval "$tar_cmd" fails. Also support plain JSON/local files.
- tar_cmd=$(content_type "$(content_name "${GENESIS_URL}")") - - if [ "$tar_cmd" != "" ]; then - # shellcheck disable=SC2086 - wget -q -O - "${GENESIS_URL}" | pv $pv_args | eval "$tar_cmd" - else - wget -q --show-progress -O "$genesis_file" "${GENESIS_URL}" - fi + name="$(content_name "${GENESIS_URL}")" + ext="$(content_type "$name")" + if [ -n "$ext" ]; then + tar_cmd="$(tar_by_content_type "$name")" + # shellcheck disable=SC2086 + wget -q -O - "${GENESIS_URL}" | pv $pv_args | eval "$tar_cmd" + else + wget -q --show-progress -O "$genesis_file" "${GENESIS_URL}" + fi @@ - tar_cmd=$(content_type "${GENESIS_URL}") - # shellcheck disable=SC2086 - (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n' + ext="$(content_type "${GENESIS_URL}")" + if [ -n "$ext" ]; then + tar_cmd="$(tar_by_content_type "${GENESIS_URL}")" + # shellcheck disable=SC2086 + (pv -petrafb -i 5 "${GENESIS_URL}" | eval "$tar_cmd") 2>&1 | stdbuf -o0 tr '\r' '\n' + else + cp -f "${GENESIS_URL}" "$genesis_file" + fiAlso applies to: 470-474
535-541: Add checks around validator process start and tx submissionValidate $AKASH start succeeded and rpid is valid; check tx exits to avoid killing the wrong PID.
- $AKASH start --home="$rvaldir" >/dev/null 2>&1 & rpid=$! + $AKASH start --home="$rvaldir" >/dev/null 2>&1 & rpid=$! + sleep 2 + if ! kill -0 "$rpid" 2>/dev/null; then + echo "validator failed to start" >&2 + exit 1 + fi @@ - kill -SIGINT $rpid - wait $rpid + if [ -n "$rpid" ]; then + kill -SIGINT "$rpid" || true + wait "$rpid" || true + fiAlso applies to: 577-579
app/sim/sim_utils.go (1)
31-36: Do not construct a fake testing.Tlog.NewTestLogger calls t.Log to write entries, and using a zero-valued testing.T would cause a panic when the logger attempts to emit any messages. While the current code doesn't manifest this bug because the returned logger is never actually called in the test files, this is a latent defect that violates API contract expectations.
The proposed fix is correct: use
log.NewNopLogger()for the verbose path (or implement a structured stdout logger if verbose output is genuinely needed). If you want test logs visible during failures, accept a real*testing.Tparameter and pass it through.- var logger log.Logger - if FlagVerboseValue { - logger = log.NewTestLogger(&testing.T{}) - } else { - logger = log.NewNopLogger() - } + var logger log.Logger + // Use a production-safe logger; avoid fake *testing.T + if FlagVerboseValue { + logger = log.NewNopLogger() // or wire a structured stdout logger if desired + } else { + logger = log.NewNopLogger() + }.github/actions/setup-ubuntu/action.yaml (1)
1-3: Add action description for actionlint and discoverability.--- name: setup-ubuntu +description: Setup Ubuntu build environment (apt deps, Node.js, Go toolchain via tools.sh, direnv) runs:script/tools.sh (3)
8-13: Install gnu-sed on macOS or add a BSD sed fallback.replace_paths uses gsed; ensure it’s installed.
macos_deps=( "bash" "direnv" "pv" "lz4" + "gnu-sed" )Alternatively, detect gsed and fall back:
- if [[ "$OSTYPE" == "darwin"* ]]; then - sedcmd=gsed - fi + if [[ "$OSTYPE" == "darwin"* ]]; then + if command -v gsed >/dev/null 2>&1; then + sedcmd=gsed + else + sedcmd="sed -E -i ''" + fi + fi
188-197: Use exact dpkg checks to avoid false positives.dpkg -l matches substrings. Check exact install status.
- if ! dpkg -l "$dep" >/dev/null 2>&1; then + if ! dpkg -W -f='${Status}' "$dep" 2>/dev/null | grep -q "^install ok"; then tools="$tools $dep" status="(not installed)" fiAlso applies to: 199-213
125-131: Avoid substring path matches when excluding files.Match exact paths to prevent unintended skips.
- for excluded_file in "${modules_to_upgrade_manually[@]}"; do - if [[ "$file" == *"$excluded_file"* ]]; then - continue 2 - fi - done + for excluded_file in "${modules_to_upgrade_manually[@]}"; do + if [[ "$file" == "$excluded_file" ]]; then + continue 2 + fi + doneapp/app_configure.go (1)
49-54: Outdated capability note; remove or update.Capability module isn’t present; the comment misleads future readers.
-// NOTE: Capability module must occur first so that it can initialize any capabilities -// so that other modules that want to create or claim capabilities afterwards in InitChain -// can do so safely.app/testnet.go (2)
278-291: UpgradeStoreLoader must use the scheduled upgrade height, not LatestVersion()+1.Passing LatestVersion()+1 risks a panic at upgrade height and chain halt. Use upgradePlan.Height.
- version := store.NewCommitMultiStore(db, log.NewNopLogger(), nil).LatestVersion() + 1 + version := upgradePlan.Height @@ - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(version, storeUpgrades)) + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(version, storeUpgrades))
103-108: Inconsistent error handling on iterator acquisition; returning nil breaks flow and leaks state.Match the panic behavior used elsewhere; don’t return nil in the middle of setup.
- iterator, err = app.Keepers.Cosmos.Staking.LastValidatorsIterator(ctx) - if err != nil { - return nil - } + iterator, err = app.Keepers.Cosmos.Staking.LastValidatorsIterator(ctx) + if err != nil { + panic(err.Error()) + }app/genesis.go (1)
69-76: Handle errors explicitly; avoid generic/ignored error paths.Current code drops or hides errors in key genesis wiring. Panic with context (or return errors) for faster diagnostics.
- pubKey, _ := privVal.GetPubKey() + pubKey, err := privVal.GetPubKey() + if err != nil { + panic(fmt.Errorf("get pubkey: %w", err)) + } @@ - pk, _ := cryptocodec.FromCmtPubKeyInterface(val.PubKey) - pkAny, _ := codectypes.NewAnyWithValue(pk) + pk, err := cryptocodec.FromCmtPubKeyInterface(val.PubKey) + if err != nil { + panic(fmt.Errorf("convert consensus pubkey: %w", err)) + } + pkAny, err := codectypes.NewAnyWithValue(pk) + if err != nil { + panic(fmt.Errorf("wrap pubkey Any: %w", err)) + } @@ - pub, _ := val.ToProto() + pub, err := val.ToProto() + if err != nil { + panic(fmt.Errorf("validator to proto: %w", err)) + } @@ - _, err := tmtypes.PB2TM.ValidatorUpdates(initValPowers) - if err != nil { - panic("failed to get vals") - } + _, err = tmtypes.PB2TM.ValidatorUpdates(initValPowers) + if err != nil { + panic(fmt.Errorf("PB2TM validator updates: %w", err)) + }Also applies to: 91-97, 111-116, 148-151
cmd/akash/cmd/testnet.go (2)
99-101: Default node daemon home should be Akash-specific"default: osmosisd" looks like a leftover. Use "akash" to match this repo.
-cmd.Flags().String(flagNodeDaemonHome, "osmosisd", "Home directory of the node's daemon configuration") +cmd.Flags().String(flagNodeDaemonHome, "akash", "Home directory of the node's daemon configuration")
384-395: IP calculation overflows last octetIncrementing only ipv4[3] will wrap without carry, producing invalid/duplicate peers.
-func calculateIP(ip string, i int) (string, error) { - ipv4 := net.ParseIP(ip).To4() - if ipv4 == nil { - return "", fmt.Errorf("%v: non ipv4 address", ip) - } - for j := 0; j < i; j++ { - ipv4[3]++ - } - return ipv4.String(), nil -} +func calculateIP(ip string, i int) (string, error) { + ipv4 := net.ParseIP(ip).To4() + if ipv4 == nil { + return "", fmt.Errorf("%v: non ipv4 address", ip) + } + // Convert to uint32, add with bounds check, convert back + n := uint32(ipv4[0])<<24 | uint32(ipv4[1])<<16 | uint32(ipv4[2])<<8 | uint32(ipv4[3]) + if n+uint32(i) > 0xFFFFFFFF { + return "", fmt.Errorf("IP address space exhausted for base %s and offset %d", ip, i) + } + n += uint32(i) + return net.IPv4(byte(n>>24), byte(n>>16), byte(n>>8), byte(n)).String(), nil +}cmd/akash/cmd/testnetify/testnetify.go (3)
78-80: Fix argument spec: command expects no positional argsRunE ignores args; keep usage consistent.
- Args: cobra.ExactArgs(1), + Args: cobra.NoArgs,
283-287: Invalid sort comparator: wrong signature/logicComparator ignores j and does not define a strict ordering; sorting is incorrect.
-thisVal := config.PrivValidatorKeyFile() -sort.Slice(tcfg.Validators, func(i, _ int) bool { - return thisVal == tcfg.Validators[i].Home -}) +thisVal := config.PrivValidatorKeyFile() +sort.SliceStable(tcfg.Validators, func(i, j int) bool { + iMatch := thisVal == tcfg.Validators[i].Home + jMatch := thisVal == tcfg.Validators[j].Home + return iMatch && !jMatch +})
411-416: Undefined getCtx in this scopegetCtx is defined as a local closure in RunE, not visible here; this won’t compile.
-cmtApp := NewCometABCIWrapper(testnetApp) -_, ctx := getCtx(sctx, true) +cmtApp := NewCometABCIWrapper(testnetApp) +ctx := context.Background()app/export.go (2)
91-107: Inconsistent validator address conversion patterns persist.The code still uses two different validator address conversion methods:
- Lines 92-95:
ValidatorAddressCodec().StringToBytes(val.GetOperator())- Lines 140-143:
sdk.ValAddressFromBech32(val.GetOperator())These methods may not be equivalent and could lead to inconsistent behavior. Use a single conversion approach throughout the function.
Apply this diff to use consistent address conversion:
err := app.Keepers.Cosmos.Staking.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - valBz, err := app.Keepers.Cosmos.Staking.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + valBz, err := sdk.ValAddressFromBech32(val.GetOperator()) if err != nil { panic(err) }Also applies to: 139-169
231-232: Use keeper method instead of direct store access.Direct KVStore access with
storetypes.KVStoreReversePrefixIteratorshould be replaced with the staking keeper'sValidatorsPowerStoreIterator()method to align with SDK v0.53.x abstraction patterns.- store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) - iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter, err := app.Keepers.Cosmos.Staking.ValidatorsPowerStoreIterator(ctx) + if err != nil { + panic(err) + }cmd/akash/cmd/genesis.go (4)
27-27: Migrate from deprecated gov v1beta1 to v1 types.The code imports and uses
govtypesv1from the deprecated v1beta1 package. Since this PR upgrades to SDK v0.53.x, you must migrate to the v1 gov types. The v1 structure uses a flatParamsstruct rather than separateDepositParams,TallyParams, andVotingParamsfields.Replace the import and update usages:
- govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"Then update the GenesisParams struct (line 193) and usages at lines 148-151 and 235-242 to use the flat v1 Params structure.
115-115: Initialize ConsensusParams to prevent nil pointer dereference.
genesisParams.ConsensusParamsis never initialized inMainnetGenesisParams()orTestnetGenesisParams(), so this assignment will cause a nil pointer dereference.Initialize in the constructor functions:
func MainnetGenesisParams() GenesisParams { genParams := GenesisParams{} + genParams.ConsensusParams = tmtypes.DefaultConsensusParams() + // Configure as needed... + genParams.GenesisTime = time.Date(2021, 6, 18, 17, 0, 0, 0, time.UTC)
108-180: Apply bank module genesis state for metadata and reserve accounts.The
GenesisParamsstruct includesNativeCoinMetadatasandStrategicReserveAccountsfields that are populated but never applied to the bank module genesis state. This means denom metadata and reserve account balances won't be set in the genesis file.Add bank module genesis configuration after line 115:
genDoc.Consensus.Params = genesisParams.ConsensusParams + // bank module genesis + bankGenState := banktypes.GetGenesisStateFromAppState(depCdc, appState) + bankGenState.DenomMetadata = genesisParams.NativeCoinMetadatas + if len(genesisParams.StrategicReserveAccounts) > 0 { + bankGenState.Balances = append(bankGenState.Balances, genesisParams.StrategicReserveAccounts...) + } + bankGenStateBz, err := cdc.MarshalJSON(bankGenState) + if err != nil { + return nil, nil, fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + appState[banktypes.ModuleName] = bankGenStateBz + // --- // staking module genesis
161-162: Remove incorrect TODO comment.This TODO comment references
distributionGenStatebut appears in the crisis module section. It's a copy-paste error from lines 139-140.crisisGenState := crisistypes.DefaultGenesisState() crisisGenState.ConstantFee = genesisParams.CrisisConstantFee - // TODO Set initial community pool - // distributionGenState.FeePool.CommunityPool = sdk.NewDecCoins() crisisGenStateBz, err := cdc.MarshalJSON(crisisGenState)app/app.go (3)
59-62: Fix IBC imports and remove 07-tendermint from module ordering.Critical issues that will cause compilation failures:
ibchost.ModuleNamelives incore/24-host, notcore/exported07-tendermintis a light client, not a module—removeibctm.ModuleNamefrom orderingApply:
- ibchost "github.com/cosmos/ibc-go/v10/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint" + ibchost "github.com/cosmos/ibc-go/v10/modules/core/24-host"And remove from module ordering:
func orderBeginBlockers(_ []string) []string { return []string{ upgradetypes.ModuleName, // ... other modules ... - ibctm.ModuleName, ibchost.ModuleName, feegrant.ModuleName, } }Also applies to: 263-292, 295-321
194-197: Set EndBlockers ordering on module manager.
OrderEndBlockersis defined but never applied to the module manager, so end-block hooks may not execute in the intended order.// Tell the app's module manager how to set the order of BeginBlockers, which are run at the beginning of every block. app.MM.SetOrderBeginBlockers(orderBeginBlockers(app.MM.ModuleNames())...) app.MM.SetOrderInitGenesis(OrderInitGenesis(app.MM.ModuleNames())...) + app.MM.SetOrderEndBlockers(OrderEndBlockers(app.MM.ModuleNames())...)
217-220: Mount memory stores to prevent runtime panics.Memory stores are not mounted. Modules that declare
MemStoreKeywill panic at runtime when attempting to access their memory stores.// initialize stores app.MountKVStores(app.GetKVStoreKey()) app.MountTransientStores(app.GetTransientStoreKey()) + app.MountMemoryStores(app.GetMemoryStoreKey())
🧹 Nitpick comments (25)
make/codegen.mk (1)
8-9: Add.PHONYdeclaration and verify workflow integration.The new
mockstarget is implemented correctly, but consider the following:
- Add a
.PHONYdeclaration for themockstarget to prevent conflicts if a file named "mocks" exists in the directory.- The
mockstarget is currently standalone and not integrated into thecodegenworkflow. Verify whether mocks generation should be part of the standard codegen flow (e.g., as a dependency ofcodegenorgenerate).Apply this diff to add the
.PHONYdeclaration:.PHONY: codegen codegen: generate +.PHONY: mocks mocks: $(MOCKERY) $(MOCKERY)If mocks should be part of the standard codegen workflow, consider integrating it:
.PHONY: codegen -codegen: generate +codegen: generate mocksmake/test-integration.mk (1)
21-23: Consider adding an explicit timeout for integration tests.The new
test-integrationtarget looks good and correctly uses thee2e.integrationbuild tag. However, it relies on Go's default 10-minute timeout. For clarity and consistency with thetesttarget (line 11), consider specifying an explicit timeout:.PHONY: test-integration test-integration: - $(GO_TEST) -v -tags="e2e.integration" $(TEST_MODULES) + $(GO_TEST) -v -timeout 900s -tags="e2e.integration" $(TEST_MODULES)This makes the timeout explicit and gives integration tests 15 minutes, acknowledging that e2e tests typically take longer than unit tests.
cmd/akash/main.go (1)
6-6: Document the purpose of the blank import.The blank import
_ "pkg.akt.dev/go/sdkutil"suggests this package has important side effects (e.g., codec registration or global initialization). Add a comment explaining why this import is required.+ // sdkutil import is required for [reason: e.g., amino codec registration, protobuf setup, etc.] _ "pkg.akt.dev/go/sdkutil"make/init.mk (1)
39-43: Remove commented-out code.The commented-out GOWORK assignment logic should be removed if it's no longer needed.
Apply this diff to remove the dead code:
ifneq ($(GOWORK),off) -# ifeq ($(shell test -e $(AKASH_ROOT)/go.work && echo -n yes),yes) -# GOWORK=${AKASH_ROOT}/go.work -# else -# GOWORK=off -# endif - ifeq ($(GOMOD),$(filter $(GOMOD),mod ""))tests/e2e/market_cli_test.go (3)
118-122: Avoid order-dependent tests inside a suiteRelying on method names (
Test1*,Test2*, …) for sequencing is brittle. Collapse these into a single test with subtests or persist prerequisites inSetupSuiteand assert preconditions per test.
284-287: Use configured bond denom instead of hard-coded "uakt"Hard-coding the denom risks drift across networks. Prefer
testutil.CoinDenomors.Config().BondDenom.- WithDeposit(sdk.NewCoin("uakt", sdk.NewInt(5000000))). + WithDeposit(sdk.NewCoin(s.Config().BondDenom, sdk.NewInt(5_000_000))).
127-139: Validate TX success and add a second block wait to reduce flakinessAfter sending/tx broadcasts, assert success with
clitestutil.ValidateTxSuccessfuland considerWaitForBlocks(2)to allow state/indexers to catch up before queries._, err = clitestutil.TxCreateDeploymentExec( @@ ) s.Require().NoError(err) -s.Require().NoError(s.Network().WaitForNextBlock()) +// Ensure commit and indexing before subsequent queries +s.Require().NoError(s.Network().WaitForBlocks(2)) +clitestutil.ValidateTxSuccessful(ctx, s.T(), cctx, res.Bytes()) // if you capture resAlso applies to: 235-247, 280-294, 365-377
tests/e2e/market_grpc_test.go (2)
204-206: Avoid mutating cached on‑chain objects to match expected stateSetting
s.order.State/s.bid.Statelocally can mask real state transitions. Re‑query after lease creation and use the returned state for filters/expectations.- s.order.State = v1beta5.OrderActive - s.bid.State = v1beta5.BidActive + // Re-query order/bid to capture actual on-chain states after lease creation + // (omitted for brevity): QueryOrdersExec/QueryBidsExec and assign results to s.order/s.bid
188-199: Optional: add timeouts to HTTP requests and a second block wait between lifecycle stepsUse
context.WithTimeoutfor REST GETs and preferWaitForBlocks(2)after create/publish/lease to reduce flakiness under CI load.Also applies to: 257-275, 396-405, 541-559
app/sim/sim_config.go (2)
58-76: Consider making DBBackend configurable.The
DBBackendis hardcoded to "goleveldb" inNewConfigFromFlags. Consider adding a flag to make this configurable, allowing users to test with different database backends (e.g., memdb for faster tests, rocksdb for production-like scenarios).Apply this diff to add a configurable DBBackend:
var ( FlagGenesisFileValue string FlagParamsFileValue string + FlagDBBackendValue string // ... other flags ) func GetSimulatorFlags() { // config fields flag.StringVar(&FlagGenesisFileValue, "Genesis", "", "custom simulation genesis file; cannot be used with params file") flag.StringVar(&FlagParamsFileValue, "Params", "", "custom simulation params file which overrides any random params; cannot be used with genesis") + flag.StringVar(&FlagDBBackendValue, "DBBackend", "goleveldb", "database backend to use (goleveldb, memdb, rocksdb)") // ... other flags } func NewConfigFromFlags() simulation.Config { return simulation.Config{ // ... other fields - DBBackend: "goleveldb", + DBBackend: FlagDBBackendValue, } }
23-23: Address or document the TODO comment.The TODO comment indicates that
FlagOnOperationValueshould be removed in favor of binary search for invariant violation. Consider either implementing this improvement or creating an issue to track it if it's deferred.Would you like me to open a new issue to track this technical debt?
app/config.go (1)
46-54: Confirm legacy gov ProposalHandlers are still needed under v0.53Gov is message-based in 0.53; passing []govclient.ProposalHandler with only paramsclient.ProposalHandler may be redundant. If unnecessary, drop govclient import and the handler list to reduce surface. Otherwise, keep with a brief comment.
app/sim_test.go (2)
129-131: Use t.Logf instead of fmt.Printf in tests.Route logs through the testing.T logger for better surfacing and -v control.
- fmt.Printf("config--------\n%v", config) + t.Logf("config--------\n%v", config) - fmt.Printf("exporting genesis...\n") + t.Logf("exporting genesis...") - fmt.Printf("importing genesis...\n") + t.Logf("importing genesis...") - fmt.Printf("exporting genesis...\n") + t.Logf("exporting genesis...") - fmt.Printf( - "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", - config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, - ) + t.Logf( + "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d", + config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, + )Also applies to: 182-183, 187-188, 430-431, 499-503
463-471: Align simulation config.GenesisTime with appOpts GenesisTime for determinism.Set config.GenesisTime to the same sdksim.RandTimestamp value you pass via appOpts to avoid time mismatches across runs.
- config := sim.NewConfigFromFlags() + config := sim.NewConfigFromFlags() config.InitialBlockHeight = 1 config.ExportParamsPath = "" - config.ChainID = AppChainID - config.GenesisTime = time.Now().UTC().Unix() + config.ChainID = AppChainID @@ - genTime := sdksim.RandTimestamp(r) + genTime := sdksim.RandTimestamp(r) appOpts.Set("GenesisTime", genTime) + // Ensure sim engine and app use the same genesis time + config.GenesisTime = genTime.Unix()Also applies to: 492-496
app/testnet.go (1)
142-155: Prefer addresscodec for bech32 HRP conversions over manual decode/encode.Use the SDK’s bech32 codecs to avoid HRP drift and future changes.
- _, bz, err := bech32.DecodeAndConvert(val.OperatorAddress.String()) - if err != nil { - panic(err.Error()) - } - bech32Addr, err := bech32.ConvertAndEncode("akashvaloper", bz) + valCodec := addresscodec.NewBech32Codec("akashvaloper") + accCodec := addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + bz, err := accCodec.StringToBytes(val.OperatorAddress.String()) + if err != nil { + panic(err.Error()) + } + bech32Addr, err := valCodec.BytesToString(bz) if err != nil { panic(err.Error()) }.github/actions/setup-ubuntu/action.yaml (1)
14-18: Run apt-get update before installing packages.Prevents intermittent 404s on GitHub runners.
- - name: Install dependencies + - name: Install dependencies # Shell must explicitly specify the shell for each step. https://github.com/orgs/community/discussions/18597 shell: bash - run: sudo apt install -y make direnv unzip lz4 wget curl npm jq pv coreutils + run: | + sudo apt-get update + sudo apt-get install -y make direnv unzip lz4 wget curl npm jq pv coreutils.github/workflows/release.yaml (2)
13-13: Runner labels: configure for self-hosted or use composite labels.If using self-hosted runners, add labels accordingly or configure actionlint to accept them.
Options:
- Use arrays with self-hosted:
runs-on: [self-hosted, core-e2e]and
runs-on: [self-hosted, gh-runner-test]
- Or add these labels to actionlint.yaml runner-label allowlist.
Also applies to: 45-46
58-63: Quote variables in shell to satisfy shellcheck and avoid word splitting.- run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV" @@ - test_required=$(./script/upgrades.sh test-required ${{ env.RELEASE_TAG }}) - echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV + test_required="$(./script/upgrades.sh test-required "${{ env.RELEASE_TAG }}")" + echo "TEST_REQUIRED=$test_required" >> "$GITHUB_ENV"app/ante.go (2)
14-16: GovKeeper enforced but unused; CDC field unused
- options.GovKeeper isn’t used in the decorator chain; requiring it blocks wiring for no benefit.
- CDC is defined but unused.
Either use them or drop the field and the nil-check to simplify initialization.
Apply this diff to drop the guard (keep if you reintroduce a gov-dependent decorator):
@@ - if options.GovKeeper == nil { - return nil, sdkerrors.ErrLogic.Wrap("akash governance keeper is required for ante builder") - }
38-44: Wording nit in error messagesMessages say “akash … keeper is required” for generic SDK keepers. Consider neutral phrasing (“governance keeper is required”, “feegrant keeper is required”) to reduce confusion.
.github/workflows/tests.yaml (4)
171-176: Shell quoting (SC2086) in bash blocksQuote vars to avoid word-splitting/globbing.
-DOCKER_USER=$(id -u) -DOCKER_GROUP=$(id -g) - echo "DOCKER_USER=$DOCKER_USER" >> $GITHUB_ENV - echo "DOCKER_GROUP=$DOCKER_GROUP" >> $GITHUB_ENV +DOCKER_USER="$(id -u)" +DOCKER_GROUP="$(id -g)" + echo "DOCKER_USER=${DOCKER_USER}" >> "$GITHUB_ENV" + echo "DOCKER_GROUP=${DOCKER_GROUP}" >> "$GITHUB_ENV" @@ -test_required=$(./script/upgrades.sh test-required ${{ github.ref }}) +test_required="$(./script/upgrades.sh test-required "${{ github.ref }}")"Also applies to: 178-183
92-99: Pin third‑party actions to a commit SHArokroskar/workflow-run-cleanup-action@master and benc-uk/workflow-dispatch@v1 should be pinned to a specific commit to reduce supply-chain risk.
Also applies to: 217-220
1-16: Set least-privilege permissions at workflow topAdd explicit permissions to restrict token scope.
name: tests +permissions: + contents: read
21-25: macOS: avoid chsh unless strictly neededChanging the default shell with sudo on GitHub runners is brittle. Prefer invoking bash explicitly (shebang/env) over switching the login shell.
cmd/akash/cmd/testnet.go (1)
61-63: Example uses osmosisd; update to akashSmall doc polish.
- osmosisd testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 + akash testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2
📜 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 (147)
.env(1 hunks).envrc(1 hunks).github/.repo(1 hunks).github/actions/setup-ubuntu/action.yaml(1 hunks).github/workflows/concommits.yaml(1 hunks).github/workflows/release.yaml(3 hunks).github/workflows/tests.yaml(7 hunks).golangci.yaml(1 hunks).goreleaser-docker.yaml(1 hunks).goreleaser-test-bins.yaml(1 hunks).goreleaser.yaml(5 hunks).mockery.yaml(1 hunks)CHANGELOG.md(1 hunks)Makefile(3 hunks)README.md(1 hunks)_build/single-node.sh(2 hunks)_docs/adr/adr-001-network-upgrades.md(1 hunks)app/ante.go(1 hunks)app/app.go(7 hunks)app/app_configure.go(3 hunks)app/app_test.go(0 hunks)app/config.go(2 hunks)app/decorators/gov_filter.go(0 hunks)app/decorators/min_commision.go(0 hunks)app/export.go(5 hunks)app/genesis.go(2 hunks)app/mac.go(2 hunks)app/modules.go(1 hunks)app/option.go(1 hunks)app/params/proto.go(0 hunks)app/sim/sim_config.go(1 hunks)app/sim/sim_utils.go(1 hunks)app/sim_test.go(4 hunks)app/testnet.go(5 hunks)app/types/app.go(3 hunks)app/types/app_test.go(1 hunks)app/upgrades.go(2 hunks)client/client.go(0 hunks)client/utils.go(3 hunks)cmd/akash/cmd/app_creator.go(1 hunks)cmd/akash/cmd/auth.go(2 hunks)cmd/akash/cmd/bech32.go(1 hunks)cmd/akash/cmd/flag_test.go(0 hunks)cmd/akash/cmd/genaccounts.go(6 hunks)cmd/akash/cmd/genesis.go(1 hunks)cmd/akash/cmd/root.go(3 hunks)cmd/akash/cmd/testnet.go(1 hunks)cmd/akash/cmd/testnetify/cmt_abci.go(1 hunks)cmd/akash/cmd/testnetify/config.go(3 hunks)cmd/akash/cmd/testnetify/testnetify.go(14 hunks)cmd/akash/cmd/testnetify/utils.go(2 hunks)cmd/akash/main.go(1 hunks)cmd/common/flags.go(0 hunks)cmd/common/signal.go(0 hunks)cmd/common/util.go(0 hunks)cmd/common/util_test.go(0 hunks)docgen/main.go(1 hunks)events/cmd/root.go(0 hunks)events/publish.go(0 hunks)events/publish_test.go(0 hunks)events/query.go(0 hunks)go.mod(1 hunks)install.sh(0 hunks)make/codegen.mk(1 hunks)make/init.mk(4 hunks)make/lint.mk(1 hunks)make/mod.mk(1 hunks)make/releasing.mk(6 hunks)make/setup-cache.mk(2 hunks)make/test-integration.mk(2 hunks)make/test-simulation.mk(1 hunks)make/test-upgrade.mk(3 hunks)meta.json(1 hunks)pubsub/bus_test.go(1 hunks)script/tools.sh(1 hunks)script/upgrades.sh(13 hunks)sdl/_testdata/deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/private_service.yaml(0 hunks)sdl/_testdata/profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/service-mix.yaml(0 hunks)sdl/_testdata/service-mix2.yaml(0 hunks)sdl/_testdata/simple-double-ram.yaml(0 hunks)sdl/_testdata/simple-gpu.yaml(0 hunks)sdl/_testdata/simple-with-ip.yaml(0 hunks)sdl/_testdata/simple.yaml(0 hunks)sdl/_testdata/simple2.yaml(0 hunks)sdl/_testdata/simple3.yaml(0 hunks)sdl/_testdata/simple4.yaml(0 hunks)sdl/_testdata/storageClass1.yaml(0 hunks)sdl/_testdata/storageClass2.yaml(0 hunks)sdl/_testdata/storageClass3.yaml(0 hunks)sdl/_testdata/storageClass4.yaml(0 hunks)sdl/_testdata/storageClass5.yaml(0 hunks)sdl/_testdata/storageClass6.yaml(0 hunks)sdl/_testdata/v2.1-credentials-error.yaml(0 hunks)sdl/_testdata/v2.1-credentials.yaml(0 hunks)sdl/_testdata/v2.1-deployment-svc-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-private_service.yaml(0 hunks)sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml(0 hunks)sdl/_testdata/v2.1-service-mix.yaml(0 hunks)sdl/_testdata/v2.1-service-mix2.yaml(0 hunks)sdl/_testdata/v2.1-simple-gpu.yaml(0 hunks)sdl/_testdata/v2.1-simple-with-ip.yaml(0 hunks)sdl/_testdata/v2.1-simple.yaml(0 hunks)sdl/_testdata/v2.1-simple2.yaml(0 hunks)sdl/_testdata/v2.1-simple3.yaml(0 hunks)sdl/_testdata/v2.1-simple4.yaml(0 hunks)sdl/coin.go(0 hunks)sdl/coin_test.go(0 hunks)sdl/cpu.go(0 hunks)sdl/cpu_test.go(0 hunks)sdl/expose.go(0 hunks)sdl/full_test.go(0 hunks)sdl/gpu.go(0 hunks)sdl/gpu_test.go(0 hunks)sdl/groupBuilder_v2.go(0 hunks)sdl/groupBuilder_v2_1.go(0 hunks)sdl/memory.go(0 hunks)sdl/placement.go(0 hunks)sdl/pricing.go(0 hunks)sdl/resources.go(0 hunks)sdl/sdl.go(0 hunks)sdl/sdl_test.go(0 hunks)sdl/storage.go(0 hunks)sdl/storage_test.go(0 hunks)sdl/units.go(0 hunks)sdl/units_test.go(0 hunks)sdl/util/util.go(0 hunks)sdl/util/util_test.go(0 hunks)sdl/utils.go(0 hunks)sdl/v2.go(0 hunks)sdl/v2_1.go(0 hunks)sdl/v2_1_ip_test.go(0 hunks)sdl/v2_1_test.go(0 hunks)sdl/v2_ip_test.go(0 hunks)sdl/v2_test.go(0 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.json(1 hunks)
💤 Files with no reviewable changes (75)
- sdl/cpu_test.go
- cmd/common/util.go
- cmd/common/util_test.go
- sdl/utils.go
- sdl/_testdata/v2.1-profile-svc-name-mismatch.yaml
- sdl/util/util.go
- sdl/_testdata/storageClass4.yaml
- sdl/memory.go
- sdl/_testdata/simple-gpu.yaml
- app/params/proto.go
- sdl/_testdata/storageClass1.yaml
- sdl/gpu_test.go
- events/publish_test.go
- sdl/_testdata/v2.1-credentials-error.yaml
- sdl/_testdata/v2.1-service-mix.yaml
- sdl/_testdata/v2.1-simple2.yaml
- sdl/v2_ip_test.go
- cmd/common/signal.go
- sdl/_testdata/v2.1-credentials.yaml
- sdl/groupBuilder_v2_1.go
- sdl/storage_test.go
- cmd/akash/cmd/flag_test.go
- sdl/_testdata/simple2.yaml
- sdl/_testdata/v2.1-simple.yaml
- sdl/_testdata/simple4.yaml
- app/decorators/gov_filter.go
- sdl/sdl.go
- sdl/_testdata/private_service.yaml
- sdl/_testdata/v2.1-deployment-svc-mismatch.yaml
- sdl/units.go
- sdl/_testdata/simple-with-ip.yaml
- sdl/_testdata/simple3.yaml
- events/query.go
- sdl/groupBuilder_v2.go
- cmd/common/flags.go
- sdl/expose.go
- sdl/_testdata/v2.1-simple-with-ip.yaml
- sdl/v2.go
- sdl/_testdata/v2.1-service-mix2.yaml
- sdl/coin.go
- sdl/gpu.go
- sdl/sdl_test.go
- sdl/_testdata/v2.1-private_service.yaml
- sdl/v2_1.go
- sdl/v2_test.go
- sdl/v2_1_ip_test.go
- app/app_test.go
- sdl/_testdata/storageClass2.yaml
- sdl/_testdata/storageClass5.yaml
- sdl/util/util_test.go
- sdl/_testdata/service-mix2.yaml
- sdl/_testdata/v2.1-simple-gpu.yaml
- sdl/storage.go
- sdl/_testdata/service-mix.yaml
- install.sh
- sdl/v2_1_test.go
- sdl/units_test.go
- client/client.go
- events/publish.go
- sdl/full_test.go
- sdl/_testdata/deployment-svc-mismatch.yaml
- sdl/resources.go
- events/cmd/root.go
- sdl/_testdata/storageClass6.yaml
- app/decorators/min_commision.go
- sdl/cpu.go
- sdl/_testdata/storageClass3.yaml
- sdl/_testdata/simple.yaml
- sdl/_testdata/profile-svc-name-mismatch.yaml
- sdl/_testdata/v2.1-simple4.yaml
- sdl/pricing.go
- sdl/placement.go
- sdl/_testdata/simple-double-ram.yaml
- sdl/_testdata/v2.1-simple3.yaml
- sdl/coin_test.go
✅ Files skipped from review due to trivial changes (2)
- .github/.repo
- make/mod.mk
🚧 Files skipped from review as they are similar to previous changes (23)
- cmd/akash/cmd/testnetify/cmt_abci.go
- .goreleaser.yaml
- cmd/akash/cmd/auth.go
- tests/e2e/cli_test.go
- tests/e2e/certs_cli_test.go
- README.md
- pubsub/bus_test.go
- .github/workflows/concommits.yaml
- meta.json
- app/upgrades.go
- app/modules.go
- app/option.go
- cmd/akash/cmd/bech32.go
- docgen/main.go
- tests/upgrade/config.json
- .goreleaser-test-bins.yaml
- .envrc
- .mockery.yaml
- make/test-simulation.mk
- make/releasing.mk
- make/lint.mk
- .env
- Makefile
🧰 Additional context used
🧬 Code graph analysis (12)
cmd/akash/cmd/testnetify/config.go (1)
app/testnet.go (1)
TestnetGov(45-48)
_build/single-node.sh (1)
script/upgrades.sh (1)
init(319-412)
app/app_configure.go (3)
x/market/alias.go (1)
ModuleName(13-13)x/take/alias.go (1)
ModuleName(11-11)x/cert/alias.go (1)
ModuleName(13-13)
cmd/akash/main.go (1)
cmd/akash/cmd/root.go (2)
NewRootCmd(31-46)Execute(49-58)
app/export.go (1)
app/app.go (3)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)
cmd/akash/cmd/root.go (4)
app/config.go (1)
ModuleBasics(70-72)app/app.go (1)
DefaultHome(82-82)cmd/akash/cmd/bech32.go (1)
ConvertBech32Cmd(12-47)cmd/akash/cmd/genaccounts.go (1)
AddGenesisAccountCmd(35-195)
app/app.go (5)
app/types/app.go (1)
App(123-134)app/mac.go (2)
ModuleAccountPerms(13-24)ModuleAccountAddrs(26-33)app/app_configure.go (1)
OrderInitGenesis(54-82)app/ante.go (1)
NewAnteHandler(21-61)upgrades/types/types.go (1)
GetHeightPatchesList(99-101)
app/sim_test.go (3)
app/app.go (4)
AkashApp(92-102)DefaultHome(82-82)NewApp(105-261)AppName(78-78)app/mac.go (1)
ModuleAccountAddrs(26-33)app/config.go (1)
ModuleBasics(70-72)
cmd/akash/cmd/app_creator.go (4)
util/server/server.go (1)
GetAppDBBackend(221-231)app/app.go (2)
NewApp(105-261)AkashApp(92-102)app/testnet.go (2)
TestnetConfig(59-64)InitAkashAppForTestnet(69-297)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)
app/testnet.go (4)
cmd/akash/cmd/testnetify/config.go (4)
AccAddress(32-34)ConsAddress(40-42)TestnetValidator(44-57)TestnetConfig(61-67)app/app.go (1)
AkashApp(92-102)upgrades/types/types.go (1)
GetUpgradesList(95-97)app/types/app.go (1)
App(123-134)
app/types/app.go (4)
x/deployment/keeper/keeper.go (2)
Keeper(36-44)NewKeeper(47-54)x/escrow/keeper/keeper.go (2)
Keeper(30-50)NewKeeper(52-68)x/take/keeper/keeper.go (2)
Keeper(24-30)NewKeeper(33-39)x/market/hooks/hooks.go (1)
Hooks(13-16)
cmd/akash/cmd/testnetify/testnetify.go (2)
util/server/server.go (1)
GetAppDBBackend(221-231)cmd/akash/cmd/testnetify/config.go (1)
TestnetConfig(61-67)
🪛 actionlint (1.7.8)
.github/workflows/tests.yaml
98-98: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
109-109: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
172-172: shellcheck reported issue in this script: SC2086:info:3:38: Double quote to prevent globbing and word splitting
(shellcheck)
172-172: shellcheck reported issue in this script: SC2086:info:4:40: Double quote to prevent globbing and word splitting
(shellcheck)
178-178: shellcheck reported issue in this script: SC2086:info:3:40: Double quote to prevent globbing and word splitting
(shellcheck)
.github/workflows/release.yaml
13-13: label "core-e2e" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
22-22: description is required in metadata of "setup-ubuntu" action at "/home/jailuser/git/.github/actions/setup-ubuntu/action.yaml"
(action)
45-45: label "gh-runner-test" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
58-58: shellcheck reported issue in this script: SC2086:info:1:48: Double quote to prevent globbing and word splitting
(shellcheck)
60-60: shellcheck reported issue in this script: SC2086:info:2:40: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 markdownlint-cli2 (0.18.1)
_docs/adr/adr-001-network-upgrades.md
43-43: Hard tabs
Column: 1
(MD010, no-hard-tabs)
45-45: Hard tabs
Column: 1
(MD010, no-hard-tabs)
46-46: Hard tabs
Column: 1
(MD010, no-hard-tabs)
47-47: Hard tabs
Column: 1
(MD010, no-hard-tabs)
48-48: Hard tabs
Column: 1
(MD010, no-hard-tabs)
CHANGELOG.md
41-41: Bare URL used
(MD034, no-bare-urls)
🪛 OSV Scanner (2.2.3)
go.mod
[HIGH] 152-152: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks in github.com/hashicorp/go-getter
(GO-2025-3892)
[HIGH] 152-152: github.com/hashicorp/go-getter 1.7.8: HashiCorp go-getter Vulnerable to Symlink Attacks
⏰ 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: coverage
- GitHub Check: tests
- GitHub Check: release-dry-run
- GitHub Check: sims
- GitHub Check: lint-shell
- GitHub Check: lint-go
- GitHub Check: build-bins
- GitHub Check: build-macos
| - name: Setup environment | ||
| uses: ./.github/actions/setup-ubuntu | ||
| - run: make bins |
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.
Add action metadata: description required for setup-ubuntu
actionlint flags .github/actions/setup-ubuntu/action.yaml for missing description. Add “name” and “description” in that action’s metadata to silence the check.
Also applies to: 58-60, 66-67, 76-77, 86-87, 98-99, 118-119
🤖 Prompt for AI Agents
In .github/workflows/tests.yaml around lines 48 to 50 (and similarly at 58-60,
66-67, 76-77, 86-87, 98-99, 118-119), the workflow references local actions
(./.github/actions/setup-ubuntu) whose action.yaml is missing required metadata;
open each referenced action's action.yaml and add a top-level name and
description fields (e.g., name: "setup-ubuntu" and description: "Sets up Ubuntu
runner environment for tests") so actionlint stops flagging the missing
description; ensure the name and description are present in all affected
action.yaml files and commit the updated metadata.
| - formats: | ||
| - binary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Approved: Archives format migration is correct for GoReleaser v2.1+.
The formats: (plural) syntax supports multiple format definitions, and format: has been deprecated in favor of formats: since GoReleaser v2.6. The change is correct and follows the modern GoReleaser schema.
However, verify that related .goreleaser.yaml and .goreleaser-test-bins.yaml files consistently use ids: instead of builds: in their archives sections, as this was renamed in GoReleaser v2.8.
🏁 Script executed:
#!/bin/bash
# Description: Verify consistency across all goreleaser config files
# Check all goreleaser*.yaml files for consistent schema usage
echo "=== Checking archives sections across all goreleaser configs ==="
for file in .goreleaser*.yaml; do
if [ -f "$file" ]; then
echo "--- File: $file ---"
rg -A 5 '^\s*archives:' "$file" || echo "No archives section found"
fi
done
# Verify builds sections have ids defined
echo -e "\n=== Checking builds sections for id definitions ==="
for file in .goreleaser*.yaml; do
if [ -f "$file" ]; then
echo "--- File: $file ---"
rg -A 3 '^\s*- id:' "$file" | head -20 || echo "No id definitions found"
fi
doneLength of output: 1418
Critical: .goreleaser-docker.yaml archives section is missing the ids: field.
The archives configuration in .goreleaser-docker.yaml (lines 79-80) contains only formats: [- binary] but is missing the required ids: field that references the builds to include in the archive.
Comparison with other files:
.goreleaser-test-bins.yamland.goreleaser.yamlboth use:ids: [akash-darwin-universal, akash-linux-amd64, akash-linux-arm64].goreleaser-docker.yamldefines builds (akash-linux-amd64,akash-linux-arm64) but doesn't reference them in archives
The formats: key specifies output formats (binary, tar, zip), not which builds to archive. The missing ids: reference will cause GoReleaser to fail or produce unexpected results.
Fix required: Add the ids: field to the archives section referencing the appropriate build IDs.
🤖 Prompt for AI Agents
.goreleaser-docker.yaml around lines 79-80: the archives section only lists
formats and is missing the required ids field that tells GoReleaser which builds
to include; add an ids: entry referencing the build IDs used in this file (e.g.,
akash-linux-amd64 and akash-linux-arm64, or the same list used in other
goreleaser files) so the archives block includes both ids and formats to
correctly package the specified builds.
🧩 Analysis chain
Verify GoReleaser schema compatibility for the formats list syntax.
The archives section now uses formats: as a list (line 79-80), which suggests a migration to a newer GoReleaser version. This change needs validation against the target GoReleaser version to ensure compatibility.
🏁 Script executed:
#!/bin/bash
# Description: Verify GoReleaser configuration schema compatibility and consistency across related files
# 1. Find all .goreleaser*.yaml files and check for related schema changes
echo "=== Checking all goreleaser config files for consistency ==="
fd '.goreleaser.*\.yaml' --exec cat {} \; -exec echo "--- File: {} ---" \;
# 2. Check if there's a go.mod or go.sum that specifies goreleaser version
echo -e "\n=== Checking for goreleaser version in dependencies ==="
if [ -f "go.mod" ]; then
rg -A2 -B2 'goreleaser' go.mod
fi
# 3. Check if there's a Makefile or CI config that specifies goreleaser version
echo -e "\n=== Checking for goreleaser version in Makefile/CI ==="
rg 'goreleaser|GORELEASER' --type=makefile --type=yaml -A2 -B2
# 4. Verify the `ids` reference if `builds` was changed to `ids`
echo -e "\n=== Checking builds section for id references ==="
rg -A3 '^\s*builds:' .goreleaser*.yamlLength of output: 1095
🏁 Script executed:
#!/bin/bash
# View complete goreleaser files to see archives and builds sections
echo "=== Content of .goreleaser-docker.yaml ==="
cat .goreleaser-docker.yaml
echo -e "\n=== Content of .goreleaser.yaml ==="
cat .goreleaser.yaml
echo -e "\n=== Content of .goreleaser-test-bins.yaml ==="
cat .goreleaser-test-bins.yamlLength of output: 10482
🏁 Script executed:
#!/bin/bash
# Search for GoReleaser version specification in CI, Dockerfile, and config files
echo "=== Searching for goreleaser version in CI configs ==="
find . -name "*.yml" -o -name "*.yaml" -o -name "Dockerfile*" -o -name ".tool-versions" -o -name ".goreleaser.yml" | head -20 | while read f; do
if grep -l "goreleaser" "$f" 2>/dev/null; then
echo "--- File: $f ---"
grep -A2 -B2 -i "goreleaser\|version" "$f" | head -20
fi
done
echo -e "\n=== Searching for version strings ==="
rg -i 'goreleaser.*v[0-9]|version.*goreleaser' -A1 -B1
echo -e "\n=== Checking for .tool-versions or similar ==="
find . -maxdepth 2 -type f \( -name ".tool-versions" -o -name ".versions" -o -name ".go-version" \) -exec cat {} \;Length of output: 1798
---
🌐 Web query:
```web
GoReleaser v2 archives format schema formats list syntax
💡 Result:
Summary — archive formats and config syntax (GoReleaser v2)
Valid archive format names:
- tar.gz (aka tgz)
- tar.xz (aka txz)
- tar.zst (aka tzst) — since v2.1
- tar
- gz
- zip
- binary (no archive; upload binaries directly)
- none (skip archive; valid in format_overrides only) . [1]
Recommended syntax (v2.x):
- Use the plural field formats (accepts list). Example:
formats: ["zip","tar.gz"]. - Older singular format is still accepted but deprecated:
format: "zip". [2][3]
Format overrides per GOOS:
- Use format_overrides with goos and formats (list). Example:
format_overrides:- goos: windows
formats: ["zip","tar.gz"]
- goos: windows
- The override may also use the deprecated singular format. [1][2]
Notes:
- "binary" produces no archive (be careful with name_template). [1]
- For source archives, valid formats are tar, tgz, tar.gz, zip. [1]
Sources: GoReleaser docs — Archives, Source, and Deprecations. [1][2][3]
Add missing ids field and project_name to .goreleaser-docker.yaml archives section.
The archives section (lines 79-80) is missing the ids field to specify which builds to include. Without it, GoReleaser will attempt to archive all builds. Additionally, .goreleaser-docker.yaml lacks the project_name field present in .goreleaser.yaml and .goreleaser-test-bins.yaml, which may cause template substitution issues.
Update the archives section to:
archives:
- ids:
- akash-linux-amd64
- akash-linux-arm64
formats:
- binaryAnd add project_name: node after version: 2 to match the other configurations.
🤖 Prompt for AI Agents
.goreleaser-docker.yaml around lines 79-80: the archives entry currently lists
only formats and needs an ids list to restrict which build artifacts are
archived; add an ids array containing akash-linux-amd64 and akash-linux-arm64
under the archives entry so only those builds are packaged, and also add
project_name: node immediately after version: 2 at the top of the file to match
the other GoReleaser configs and ensure template substitutions work.
| totalSupply := sdk.NewCoins() | ||
| for _, b := range balances { | ||
| // add genesis acc tokens to total supply | ||
| totalSupply = totalSupply.Add(b.Coins...) | ||
| } | ||
|
|
||
| for range delegations { | ||
| // add delegated tokens to total supply | ||
| totalSupply = totalSupply.Add(sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)) | ||
| } | ||
|
|
||
| // add bonded amount to bonded pool module account | ||
| balances = append(balances, banktypes.Balance{ | ||
| Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), | ||
| Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)}, | ||
| }) | ||
|
|
||
| // update total supply | ||
| bankGenesis := banktypes.NewGenesisState( | ||
| banktypes.DefaultGenesisState().Params, | ||
| balances, | ||
| totalSupply, | ||
| []banktypes.Metadata{}, | ||
| []banktypes.SendEnabled{}, | ||
| ) | ||
| genesisState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankGenesis) | ||
|
|
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.
🛠️ Refactor suggestion | 🟠 Major
Token denom filter is bypassed by later module writes; apply at the end as well.
Manual staking/bank genesis writes reintroduce "stake". Filter once more before returning.
- return genesisState
+ return genesisFilterTokens(genesisState)Also applies to: 153-154
🤖 Prompt for AI Agents
In app/genesis.go around lines 121-147 (and also for the similar block at
153-154), later additions to balances and totalSupply reintroduce the "stake"
denom after earlier filtering; before marshaling bankGenesis and before
returning genesisState, re-run the token-denom filter to remove
sdk.DefaultBondDenom (stake) from balances and totalSupply (and any bank module
metadata/send-enabled lists if needed), rebuild bankGenesis with the filtered
balances and cleaned totalSupply, and then marshal that into genesisState so the
"stake" denom is not present in the final bank genesis.
| newConsAddr := val.ConsensusAddress | ||
|
|
||
| // Set validator signing info for our new validator. | ||
| newValidatorSigningInfo := slashingtypes.ValidatorSigningInfo{ | ||
| Address: newConsAddr.String(), | ||
| StartHeight: app.LastBlockHeight() - 1, | ||
| Tombstoned: false, | ||
| } | ||
|
|
||
| _, err = app.Keepers.Cosmos.Staking.ApplyAndReturnValidatorSetUpdates(ctx) | ||
| err = app.Keepers.Cosmos.Slashing.SetValidatorSigningInfo(ctx, newConsAddr, newValidatorSigningInfo) | ||
| if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against negative StartHeight in ValidatorSigningInfo.
If LastBlockHeight() is 0, StartHeight becomes -1. Use max(0, lastHeight-1).
- newValidatorSigningInfo := slashingtypes.ValidatorSigningInfo{
- Address: newConsAddr.String(),
- StartHeight: app.LastBlockHeight() - 1,
- Tombstoned: false,
- }
+ lh := app.LastBlockHeight()
+ start := lh - 1
+ if start < 0 {
+ start = 0
+ }
+ newValidatorSigningInfo := slashingtypes.ValidatorSigningInfo{
+ Address: newConsAddr.String(),
+ StartHeight: start,
+ Tombstoned: false,
+ }🤖 Prompt for AI Agents
In app/testnet.go around lines 220 to 228, the code sets StartHeight to
app.LastBlockHeight() - 1 which can produce a negative value when
LastBlockHeight() is 0; change the assignment to compute lastHeight :=
app.LastBlockHeight() and use StartHeight: int64Max(0, lastHeight-1) (or
equivalent logic) so StartHeight never goes below 0, ensuring types match
(convert to int64 if needed) before calling SetValidatorSigningInfo.
| func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", | ||
| Use: "add-account [address_or_key_name] [coin][,[coin]]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify the breaking command name change is intentional.
The command name has changed from add-genesis-account to add-account. This is a breaking change that will affect existing scripts, documentation, and automation tools that reference the old command name.
Ensure this change is:
- Intentional and documented in the migration guide
- Reflected in all documentation and examples
- Communicated to users in the CHANGELOG or release notes
🏁 Script executed:
#!/bin/bash
# Search for references to the old command name in docs and scripts
rg -n -C3 'add-genesis-account' -g '!cmd/akash/cmd/genaccounts.go'Length of output: 560
Now let me check if _build/single-node.sh is part of the PR changes:
Based on the script output showing references to the old command name in _build/single-node.sh, and my verification that this is a breaking change, I can now generate the rewritten review comment:
Update _build/single-node.sh to use the new command name.
The command name has changed from add-genesis-account to add-account. This is a breaking change that will break the build/test setup script at _build/single-node.sh (lines 20–21), which still references the old command name.
Ensure all scripts, documentation, and examples in the repository are updated to use the new add-account command name.
🤖 Prompt for AI Agents
In cmd/akash/cmd/genaccounts.go around line 37, the command Use string was
changed to "add-account ..." which breaks scripts referencing the old
"add-genesis-account" command; update the _build/single-node.sh script (lines
20–21) to replace any occurrences of "add-genesis-account" with "add-account"
and scan other scripts, docs, and examples in the repo to consistently replace
the old command name so CI/build scripts and documentation use the new command.
| MOCKERY_MAJOR=$(shell $(SEMVER) get major $(MOCKERY_VERSION)) | ||
| $(MOCKERY_VERSION_FILE): $(AKASH_DEVCACHE) | ||
| @echo "installing mockery $(MOCKERY_VERSION) ..." | ||
| rm -f $(MOCKERY) | ||
| GOBIN=$(AKASH_DEVCACHE_BIN) go install -ldflags '-s -w -X github.com/vektra/mockery/v2/pkg/config.SemVer=$(MOCKERY_VERSION)' github.com/vektra/mockery/v2@v$(MOCKERY_VERSION) | ||
| GOBIN=$(AKASH_DEVCACHE_BIN) go install -ldflags '-s -w -X github.com/vektra/mockery/v$(MOCKERY_MAJOR)/pkg/config.SemVer=$(MOCKERY_VERSION)' github.com/vektra/mockery/v$(MOCKERY_MAJOR)@v$(MOCKERY_VERSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify SEMVER is defined and handle Go module versioning edge cases.
Lines 20 and 24 extract and use the major version for mockery's module path. Potential issues:
-
SEMVERavailability: If$(SEMVER)is undefined or not yet available, the shell command fails silently andMOCKERY_MAJORbecomes empty, resulting in a malformed module path likegithub.com/vektra/mockery/v/@v.... -
Go module versioning for v0/v1: Go modules do not use
/v0or/v1suffixes—only/v2,/v3, etc. IfMOCKERY_VERSIONis v0.x or v1.x, the path should omit the major version segment entirely.
Run the following script to verify the necessary definitions and version values:
Consider adding a guard to handle v0 and v1 correctly:
MOCKERY_MAJOR=$(shell $(SEMVER) get major $(MOCKERY_VERSION))
MOCKERY_MODULE_PATH=$(if $(filter-out 0 1,$(MOCKERY_MAJOR)),github.com/vektra/mockery/v$(MOCKERY_MAJOR),github.com/vektra/mockery)Then use $(MOCKERY_MODULE_PATH) instead of hardcoding github.com/vektra/mockery/v$(MOCKERY_MAJOR).
🏁 Script executed:
#!/bin/bash
# Description: Verify SEMVER and MOCKERY_VERSION definitions and check versioning
echo "=== Searching for SEMVER definition ==="
rg -n 'SEMVER\s*[:?]?=' --type make
echo -e "\n=== Searching for MOCKERY_VERSION definition ==="
rg -n 'MOCKERY_VERSION\s*[:?]?=' --type make
echo -e "\n=== Checking include order in Makefile ==="
# Find main Makefile and check if SEMVER is available before setup-cache.mk
rg -n 'include.*setup-cache\.mk' --type makeLength of output: 245
#!/bin/bash
# Search for SEMVER tool references, installation, or definition in the entire repo
echo "=== Looking for SEMVER tool references ==="
rg -i 'semver' --type make --type sh --type yaml -n
echo -e "\n=== Checking for tool installation scripts ==="
fd -e sh -e mk | head -20 | xargs grep -l 'tool\|install' 2>/dev/null | head -10
echo -e "\n=== Checking make/init.mk for tool setup ==="
head -100 make/init.mkActually, let me search the codebase correctly:
#!/bin/bash
# Search for SEMVER references in the repo
echo "=== Searching for SEMVER in make files ==="
rg -i 'semver' -n --type make
echo -e "\n=== Looking for SEMVER in shell scripts ==="
rg -i 'semver' -n --type sh
echo -e "\n=== Looking for any tool definitions ==="
rg -i 'semver|tool.*install|SEMVER' -n make/ | head -30
---
🏁 Script executed:
```shell
#!/bin/bash
# Search for SEMVER references across entire codebase
echo "=== Searching for SEMVER in all make files ==="
rg -i 'semver' --type make -C 2
echo -e "\n=== Searching for SEMVER in shell scripts ==="
rg -i 'semver' --type sh -C 2
echo -e "\n=== Searching for SEMVER in documentation/README ==="
rg -i 'semver' --type md -C 2
echo -e "\n=== Checking first 150 lines of main make/init.mk ==="
head -150 make/init.mk | tail -80
Length of output: 12448
Fix SEMVER availability in Make context; remove inapplicable v0/v1 concern.
SEMVER is defined in script/tools.sh but is not available in the Make context when make/setup-cache.mk executes. When $(SEMVER) expands to empty, the shell command fails silently and MOCKERY_MAJOR becomes empty, resulting in the malformed module path github.com/vektra/mockery/v/@v3.5.0.
The concern about v0/v1 Go module versioning does not apply here—MOCKERY_VERSION is 3.5.0, which correctly uses the /v3 path suffix.
Suggested fix: Define or import SEMVER into the Make context before using it. For example, add to make/init.mk:
SEMVER := $(AKASH_ROOT)/script/semver.shThen ensure it's included before make/setup-cache.mk (which already happens at line 98).
🤖 Prompt for AI Agents
In make/setup-cache.mk around lines 20 to 24, SEMVER is referenced but not
defined in the Make context so MOCKERY_MAJOR expands empty and yields a
malformed module path; to fix, define or import SEMVER into the Make context
before this file is evaluated (for example add a SEMVER assignment in
make/init.mk that points to the repo semver script and ensure make/init.mk is
included prior to make/setup-cache.mk), so $(SEMVER) will be available and
MOCKERY_MAJOR will be computed correctly; no change to the v0/v1 handling is
needed.
| import ( | ||
| "context" | ||
| "crypto/x509" | ||
| "encoding/pem" | ||
|
|
||
| "pkg.akt.dev/go/cli" | ||
| clitestutil "pkg.akt.dev/go/cli/testutil" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| types "pkg.akt.dev/go/node/cert/v1" | ||
|
|
||
| "pkg.akt.dev/node/testutil" | ||
| ) |
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.
Add exported suite runner so the test executes.
Currently no Test* entrypoint; add imports and runner.
import (
"context"
"crypto/x509"
"encoding/pem"
+ "testing"
"pkg.akt.dev/go/cli"
clitestutil "pkg.akt.dev/go/cli/testutil"
"github.com/stretchr/testify/require"
+ "github.com/stretchr/testify/suite"
types "pkg.akt.dev/go/node/cert/v1"
"pkg.akt.dev/node/testutil"
)
@@
s.certs = out.Certificates
}
+
+func TestCertsGRPCRestTestSuite(t *testing.T) {
+ suite.Run(t, new(certsGRPCRestTestSuite))
+}Also applies to: 73-73
🤖 Prompt for AI Agents
In tests/e2e/certs_grpc_test.go around lines 5 to 17 (and also at line 73),
there is no exported Test* entrypoint so the suite never runs; add the necessary
testing imports and an exported test runner. Import "testing" and
"github.com/stretchr/testify/suite" alongside existing imports, then add an
exported function like TestCertsGRPCSuite(t *testing.T) { suite.Run(t,
&CertsGRPCSuite{}) } (place near line 73) to invoke the suite; ensure the import
block is updated and compiled symbols are used so the test executes.
| sendTokens := DefaultDeposit.Add(DefaultDeposit) | ||
| _, err = clitestutil.ExecSend( | ||
| ctx, | ||
| val.ClientCtx, | ||
| cli.TestFlags(). | ||
| With( | ||
| val.Address.String(), | ||
| keyAddr.String(), | ||
| sdk.NewCoins(sendTokens).String()). | ||
| WithGasAutoFlags(). | ||
| WithSkipConfirm(). | ||
| WithBroadcastModeBlock()..., |
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.
Compile-time type error assembling send amount (Coin.Add returns Coins)
DefaultDeposit.Add(DefaultDeposit) yields sdk.Coins. Passing that into sdk.NewCoins(...) is invalid and will not compile. Also you can stringify sdk.Coins directly.
- // Send coins from validator to keyBar
- sendTokens := DefaultDeposit.Add(DefaultDeposit)
+ // Send coins from validator to keyBar
+ sendTokens := sdk.NewCoins(DefaultDeposit, DefaultDeposit)
_, err = clitestutil.ExecSend(
@@
- sdk.NewCoins(sendTokens).String()).
+ sendTokens.String()).🤖 Prompt for AI Agents
In tests/e2e/market_grpc_test.go around lines 110 to 121, the code calls
DefaultDeposit.Add(DefaultDeposit) which returns sdk.Coins but then wraps it in
sdk.NewCoins(...).String(), causing a compile-time type error; change the
argument to use the existing sdk.Coins directly by passing sendTokens.String()
(i.e., remove sdk.NewCoins(...) and call .String() on sendTokens), ensuring the
sendTokens variable remains of type sdk.Coins and is stringified directly for
the CLI call.
| if tc.expErr { | ||
| s.Require().NotNil(err) | ||
| s.Require().Empty(orders.Orders) | ||
| } else { | ||
| s.Require().NoError(err) | ||
| s.Require().Len(orders.Orders, tc.expLen) | ||
| s.Require().Equal(tc.expResp, orders.Orders[0]) | ||
| } |
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.
Don’t rely on JSON unmarshal errors to detect HTTP/gateway errors
Gateway error bodies often JSON‑decode into zero‑values without error, making these assertions flaky. Instead, assert empty result sets (lists) or decode into a generic error envelope and check code/message.
- if tc.expErr {
- s.Require().NotNil(err)
- s.Require().Empty(orders.Orders)
- } else {
+ if tc.expErr {
+ // Treat error cases as empty payloads for this endpoint
+ s.Require().Len(orders.Orders, 0)
+ } else {
s.Require().NoError(err)
s.Require().Len(orders.Orders, tc.expLen)
s.Require().Equal(tc.expResp, orders.Orders[0])
}Apply the same pattern to bids/leases and single-item endpoints (compare to zero-values without requiring an unmarshal error).
Also applies to: 334-340, 405-413, 479-485, 550-558, 624-630
<details>
<summary>🤖 Prompt for AI Agents</summary>
In tests/e2e/market_grpc_test.go around lines 266 to 273 (and likewise at
334-340, 405-413, 479-485, 550-558, 624-630), the test is relying on JSON
unmarshal errors to detect gateway/HTTP errors which is flaky because gateway
error bodies often decode to zero-values; change the assertions to (1) assert
the returned result slice is empty when an error is expected instead of
requiring a JSON unmarshal error, and (2) for endpoints that return single-item
responses, decode into a generic error envelope (or inspect the response map)
and assert on the error code/message when appropriate; update the bids/leases
and single-item endpoint checks to follow the same pattern so tests no longer
depend on unmarshal failures.
</details>
<!-- fingerprinting:phantom:medusa:chinchilla -->
<!-- This is an auto-generated comment by CodeRabbit -->
| resp, err := sdktestutil.GetRequest(tc.url) | ||
| s.Require().NoError(err) | ||
|
|
||
| var out types.QueryProviderResponse | ||
| err = cctx.Codec.UnmarshalJSON(resp, &out) | ||
|
|
||
| if tc.expErr { | ||
| s.Require().Error(err) | ||
| } else { | ||
| s.Require().NoError(err) | ||
| s.Require().Equal(tc.expResp, out.Provider) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix REST error handling in TestGetProvider.
Short-circuit on non-200 before unmarshalling.
s.Run(tc.name, func() {
resp, err := sdktestutil.GetRequest(tc.url)
- s.Require().NoError(err)
-
- var out types.QueryProviderResponse
- err = cctx.Codec.UnmarshalJSON(resp, &out)
-
- if tc.expErr {
- s.Require().Error(err)
- } else {
- s.Require().NoError(err)
- s.Require().Equal(tc.expResp, out.Provider)
- }
+ if tc.expErr {
+ s.Require().Error(err)
+ return
+ }
+ s.Require().NoError(err)
+ var out types.QueryProviderResponse
+ s.Require().NoError(cctx.Codec.UnmarshalJSON(resp, &out))
+ s.Require().Equal(tc.expResp, out.Provider)
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| resp, err := sdktestutil.GetRequest(tc.url) | |
| s.Require().NoError(err) | |
| var out types.QueryProviderResponse | |
| err = cctx.Codec.UnmarshalJSON(resp, &out) | |
| if tc.expErr { | |
| s.Require().Error(err) | |
| } else { | |
| s.Require().NoError(err) | |
| s.Require().Equal(tc.expResp, out.Provider) | |
| } | |
| resp, err := sdktestutil.GetRequest(tc.url) | |
| if tc.expErr { | |
| s.Require().Error(err) | |
| return | |
| } | |
| s.Require().NoError(err) | |
| var out types.QueryProviderResponse | |
| s.Require().NoError(cctx.Codec.UnmarshalJSON(resp, &out)) | |
| s.Require().Equal(tc.expResp, out.Provider) |
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