Skip to content

Passage v3.1.0 — Cosmos SDK 0.47→0.50 upgrade (REVIEW CANDIDATE) - #208

Merged
ECHOAD merged 2 commits into
envadiv:release/v2.6.0-sdk-v047from
Ninjaxan:hop2-onto-300
Jun 30, 2026
Merged

Passage v3.1.0 — Cosmos SDK 0.47→0.50 upgrade (REVIEW CANDIDATE)#208
ECHOAD merged 2 commits into
envadiv:release/v2.6.0-sdk-v047from
Ninjaxan:hop2-onto-300

Conversation

@Ninjaxan

Copy link
Copy Markdown

Passage v3.1.0 — Cosmos SDK 0.47 → 0.50 upgrade (REVIEW CANDIDATE)

Prepared by CryptoDungeon (Ninjaxan). This branches from release/v2.6.0-sdk-v047 (v3.0.0) and applies the SDK 0.47→0.50 migration plus ports this repo's historical upgrade handlers forward to 0.50. Please read "Historical handlers" and "Status" before scheduling any on-chain proposal — this is a candidate for review and joint testing, not a finished release.

On-chain upgrade name: v050.

What it does

  • cosmos-sdk v0.47.13 → v0.50.13, cometbft 0.37 → v0.38.12, ibc-go v7 → v8.0.0, wasmd 0.40 → v0.50.0 (wasmvm stays 1.5.x — no contract 1→2 re-validation), iavl 0.20 → v1.2.2 + a required patch (below).
  • New modules/features: x/circuit (breaker; store added at the upgrade height), Sign Mode Textual, AutoCLI, expedited governance, proposal cancellation, x/consensus (already in).
  • Deliberately NOT enabled: Vote Extensions, Optimistic Execution, native x/nft. x/group: deferred.

⚠️ Consensus-critical: a forked iavl patch (./iavl-fork)

iavl v1 (SDK 0.50) cannot load a 0.47 (iavl-0.20) database when any store is empty (e.g. x/evidence/x/feegrant with no entries): db.Get/db.Has treat a zero-length value as absent, and an empty tree's root marker has an empty value, so iavl reports those versions missing and the node aborts at startup — every validator's v0.50 binary would fail to start at the upgrade height = chain halt. Fix: value-agnostic key-existence check for the legacy r<version> and native s<version> roots (iavl-fork/nodedb.go; see docs/v3.1.0-upgrade/iavl-empty-store-fix.patch). Please review this and we intend to upstream it to cosmos/iavl.

Parameters set by the v050 handler

  • staking min commission 5% (existing validators below the floor are lifted)
  • expedited voting 24h, expedited threshold 67%
  • quorum 50% + veto 50% — note: SDK 0.50 gov has no separate expedited quorum/veto; these are the shared params (apply to normal and expedited).
  • expedited min deposit 1,000,000 PASG (1e12 of the bond denom).

Historical handlers — NEEDS YOUR VALIDATION

v2.4.0 / v2.5.0 / v2.6.0 / v3.0.0 were ported to compile + run under 0.50, preserving logic (the v3.0.0 consensus-params migration is intact). 3 genesis-replay-only gaps in app/upgrades/v2.5.0/replace_multisig_addrs.go (marked TODO(passage v3.1.0)): for the replaced multisig addresses, the authz-grant, feegrant-allowance, and gov-vote sub-migrations are omitted (the 0.50 unified handler signature doesn't thread authz/feegrant keepers, and 0.50 x/gov dropped the in-place vote-rewrite API). Account/balance/delegation/vesting migration is intact. No impact on state-sync nodes; only a from-genesis replay is affected, and only if those addresses held authz/feegrant/votes at the v2.5.0 height — you can confirm that quickly. We left them flagged rather than guess.

Status (do NOT propose until green)

  • ✅ Synthetic 0.47→0.50 dry-run on this branch: upgrade applies, gov/ibc/slashing migrate, blocks continue, full REST query battery passes (incl. historical-height reads), and every parameter verified post-upgrade (min_commission, quorum/veto/threshold, expedited deposit, x/circuit reachable).
  • ❌ NOT done (recommend together): RunMigrations against full real mainnet state; CosmWasm contract execution parity; multi-validator app-hash agreement; independent review of the iavl patch + the 3 historical-handler TODOs.

Build: go 1.21, make build, passage version --longcosmos_sdk_version: v0.50.13. Full rationale + dry-run harness in docs/v3.1.0-upgrade/.

bradrako added 2 commits June 29, 2026 22:57
….0/v3.0.0) to SDK 0.50

- v3.0.0: keep upstream name=v3.0.0, port consensus-params migration to 0.50
  (collections.Item ParamStore, context.Context closure)
- v2.4.0/v2.6.0: bank/auth/distr handlers to 0.50 (math.NewInt, context ctx)
- v2.5.0: claim+min-commission+multisig migration to 0.50; authz/feegrant/gov-vote
  steps omitted (keepers no longer threaded / gov API changed) - TODO-marked
- restore app/ante min_commission + min_gas_prices to 0.50 (math.Legacy*)
- wire historical handlers into app.go Upgrades slice; drop v047
Comment thread x/claim/module.go
EndBlocker(ctx, am.keeper)
return []abci.ValidatorUpdate{}
func (am AppModule) EndBlock(ctx context.Context) error {
EndBlocker(sdk.UnwrapSDKContext(ctx), am.keeper)
Comment on lines +58 to +60
for k, v := range defaultGraphNodeAttrs {
graphNode.Attrs[k] = v
}
Comment thread iavl-fork/nodedb.go
Comment on lines +671 to +676
for v, r := range ndb.versionReaders {
if v >= first && v <= toVersion && r != 0 {
ndb.mtx.Unlock()
return fmt.Errorf("unable to delete version %d with %d active readers", v, r)
}
}
Comment thread iavl-fork/nodedb.go
Comment on lines +551 to +556
for v, r := range ndb.versionReaders {
if v >= fromVersion && r != 0 {
ndb.mtx.Unlock() // Unlock before exiting
return fmt.Errorf("unable to delete version %v with %v active readers", v, r)
}
}
case []byte:
return v
default:
panic(fmt.Errorf("keyFormat format() does not support formatting value of type %T: %v", a, a))
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
package common

import (
"unsafe"
Comment thread iavl-fork/version.go

import (
"fmt"
"runtime"
Comment thread iavl-fork/import.go
Comment on lines +95 to +98
go func(batch db.Batch) {
defer batch.Close()
result <- batch.Write()
}(i.batch)
Comment thread iavl-fork/export.go
}

tree.ndb.incrVersionReaders(tree.version)
go exporter.export(ctx)
@ECHOAD
ECHOAD merged commit 2c23379 into envadiv:release/v2.6.0-sdk-v047 Jun 30, 2026
2 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants