Skip to content

chore: upgrade Cosmos SDK v0.50.10 → v0.53.7 - #284

Merged
0xNilesh merged 2 commits into
developfrom
sdk-upgrade-0.53
Jul 24, 2026
Merged

chore: upgrade Cosmos SDK v0.50.10 → v0.53.7#284
0xNilesh merged 2 commits into
developfrom
sdk-upgrade-0.53

Conversation

@AryaLanjewar3005

Copy link
Copy Markdown
Collaborator

Summary

This PR upgrades the chain from Cosmos SDK v0.50.10 to the latest stable
Cosmos SDK v0.53.x (v0.53.7). It is a dependency version upgrade only
no chain logic, module behaviour, state layout, or APIs were intentionally changed.
The only production code change is one interface that the SDK itself now requires
us to satisfy.

  • make build produces both pchaind and puniversald
  • pchaind version --long reports cosmos_sdk_version: v0.53.7
  • ✅ Full unit suite green: go test -tags="ledger test_ledger_mock test" ./...
    66 test-bearing packages pass, 0 failures (incl. the cgo/Rust TSS packages)

Cosmos SDK v0.53 ("Eden") is a deliberately backward-compatible, largely additive
release on top of the v0.50 line (same core v0.11.x, store v1.x, CometBFT
v0.38.x), which is why the required code changes are so small.


Motivation

Cosmos SDK v0.53 is the current supported minor line for the v0.50 family. It brings
(all opt-in / additive):

  • Unordered transactions (timeout-based nonces)
  • x/protocolpool and x/epochs API surface
  • SIGN_MODE_TEXTUAL and other signing improvements
  • Various performance and dependency fixes

The push-chain EVM fork (github.com/pushchain/evm) and ibc-go/v10 that this repo
already depends on are built against SDK v0.53 (they pin cosmos-sdk v0.53.x,
core v0.11.3, api v0.9.2, x/tx v0.14.0). Staying on v0.50 meant the repo was
running those dependencies below the SDK version they were compiled and tested for.
This upgrade realigns the whole stack onto v0.53.


Background: how versions were pinned before

The repo does not simply require the SDK version — it drives the effective
version through a block of replace directives at the top of go.mod. The require
block historically listed higher, v0.54-alpha-line versions, and the replace
block forced everything down to the v0.50.10-compatible set. The effective build
version is whatever the replace block says.

require:  cosmossdk.io/api v1.0.0-alpha.1   (0.54-alpha line, aspirational)
replace:  cosmossdk.io/api => v0.7.5         (0.50.10 line, what actually builds)
=> effective: v0.7.5

So the upgrade is primarily about retargeting the replace block to the stable
v0.53.7 module matrix. This same pattern is preserved after the upgrade.


What changed

1. go.mod — SDK module matrix retargeted to v0.53.7

The override (replace) block now pins the full, mutually-consistent v0.53.7 set.
Target versions were taken directly from cosmos-sdk@v0.53.7's own go.mod and
from the x/* submodule tags released alongside v0.53.

Module Before (v0.50.10) After (v0.53.7)
github.com/cosmos/cosmos-sdk v0.50.10 v0.53.7
cosmossdk.io/api v0.7.5 v0.9.2
cosmossdk.io/core v0.11.1 v0.11.3
cosmossdk.io/store v1.1.1 v1.1.2
cosmossdk.io/x/tx v0.13.3 v0.14.0
cosmossdk.io/collections v0.4.0 v1.3.1
cosmossdk.io/x/evidence v0.1.1 v0.2.0
cosmossdk.io/x/feegrant v0.1.1 v0.2.0
cosmossdk.io/x/upgrade v0.1.4 v0.2.0
cosmossdk.io/client/v2 v2.0.0-beta.4 v2.0.0-beta.11

Modules that were already at v0.53-compatible versions were left as-is:
depinject v1.2.1, errors v1.0.2, log v1.6.1, math v1.5.3,
cometbft v0.38.21, cosmos-db v1.1.3, gogoproto v1.7.2,
x/circuit v0.2.0, ibc-go/v10 v10.4.0.

Deliberately kept (see "What was intentionally not changed"):
wasmd v0.55.0, pushchain/evm fork, go-ethereum (cosmos fork), tokenfactory.

2. New ORM compatibility shim — compat/orm-api/ (nested local module)

The one genuinely tricky part of the upgrade.

Problem. SDK v0.53 requires cosmossdk.io/api ≥ v0.9.2 (it imports the
cosmos/crisis, cosmos/epochs, and cosmos/protocolpool API packages that only
exist in the v0.9.x line). But cosmossdk.io/api v0.9.0 removed the
cosmos/orm/* generated packages. Meanwhile:

  • cosmossdk.io/orm (latest, v1.0.0-beta.3) still imports
    cosmossdk.io/api/cosmos/orm/{v1, v1alpha1, module/v1alpha1}.
  • Our ORM-backed modules depend on it:
    • x/uvalidator/types/keys.go uses ormv1alpha1.ModuleSchemaDescriptor
    • x/uregistry/types/state.pb.go and x/uvalidator/types/state.pb.go carry the
      _ "cosmossdk.io/orm" proto-option registration import
    • app/tools.go blank-imports cosmossdk.io/orm

So api v0.9.2 (needed by the SDK) and the orm module (needed by us) are in direct
conflict — there is no single cosmossdk.io/api version that satisfies both.

Fix. Re-provide the removed (and unchanged) generated ORM API packages as a small
nested local module and wire it in via a replace:

compat/orm-api/
├── go.mod                          // module cosmossdk.io/api/cosmos/orm
├── v1/orm.pulsar.go                // copied verbatim from cosmossdk.io/api v0.8.2
├── v1alpha1/schema.pulsar.go       //   (last release that shipped these packages)
└── module/v1alpha1/module.pulsar.go

go.mod (root):

replace cosmossdk.io/api/cosmos/orm => ./compat/orm-api

Because Go resolves a package to the module with the longest matching path prefix,
imports of cosmossdk.io/api/cosmos/orm/v1 now resolve to this local module instead
of the (orm-less) cosmossdk.io/api v0.9.2. The three packages are pure generated
proto code whose only external dependencies (cosmos/app/v1alpha1,
cosmos/base/query/v1beta1) still exist in api v0.9.2, so nothing else shifts.

This is fully self-contained in the repo (no external fork), documented inline in
both compat/orm-api/go.mod and the root go.mod.

3. app/ante/handler_options.go — the only production code change

SDK v0.53's x/auth/ante.AccountKeeper interface gained three methods for the new
unordered-transaction feature. Our local AccountKeeper interface (embedded into the
ante decorators) must expose them. They were already present in the file as
commented-out stubs — this PR simply enables them:

type AccountKeeper interface {
    ...
    AddressCodec() addresscodec.Codec
    // Unordered transaction support (added in cosmos-sdk v0.53).
    UnorderedTransactionsEnabled() bool
    RemoveExpiredUnorderedNonces(ctx sdk.Context) error
    TryAddUnorderedNonce(ctx sdk.Context, sender []byte, timestamp time.Time) error
}

(plus a "time" import). The concrete authkeeper.AccountKeeper from SDK v0.53
already implements all three, so no wiring changes are needed.

4. app/ante/fee_test.go — matching test mock

The unit test's mockAccountKeeperAnte gets the same three methods (no-op /
false stubs) plus a "time" import, so the ante tests continue to compile and pass.


What was intentionally NOT changed

  • wasmd v0.55.0 — kept (as the existing // Keep v0.55.0 comment mandates).
    It is a v0.50-line release but compiles cleanly against v0.53 (v0.53 is
    API-compatible with v0.50). Bumping it was unnecessary and would widen the blast
    radius.
  • pushchain/evm fork, ibc-go/v10 v10.4.0, tokenfactory, go-ethereum
    already target SDK v0.53; left untouched.
  • interchaintest/ module — a separate, self-contained Go module
    (github.com/pushchain/push-chain-node/interchaintest). It is an E2E harness built
    on the strangelove-ventures interchaintest framework with its own pinned SDK
    fork (strangelove-ventures/cosmos-sdk v0.50.13, ibc-go/v8). It does not
    import the main module (the parent-app replace is commented out) and is not part
    of make build or make test-unit, so it is unaffected by this upgrade and was
    deliberately left as-is. Retargeting it would be out of scope and risky.
  • Any chain / module business logic, genesis, params, or migrations. None.

Effect on the repo

  • Runtime behaviour: unchanged. This is a version bump; no module semantics,
    store keys, message handlers, or state were modified. The new v0.53 features
    (unordered txs, epochs, protocolpool) are not enabled/wired — they are simply
    available in the SDK now.
  • AccountKeeper interface: widened by three methods, all already satisfied by
    the real keeper. No call sites change.
  • Build/tooling: requires the v0.53 module set (pulled automatically via
    go.mod/go.sum). The compat/orm-api nested module must exist for the build to
    resolve — it is checked in.
  • Dependencies: go.sum reconciled to the v0.53 graph (+35 / −29 lines).

Verification

# Build (also builds the dkls23-rs Rust dependency and runs go mod tidy/verify)
$ make build
  ✓ dkls23-rs library built
  go build ... -o build/pchaind    ./cmd/pchaind
  go build ... -o build/puniversald ./cmd/puniversald

# Version embedded in the binary
$ ./build/pchaind version --long | grep cosmos_sdk_version
cosmos_sdk_version: v0.53.7

# Full unit suite (repo test tags + dkls23 lib on LD_LIBRARY_PATH)
$ make test-unit
  ok  .../app                              2.4s
  ok  .../app/ante                         3.1s
  ok  .../universalClient/tss/dkls         6.7s
  ... 66 packages ok, 0 FAIL

go build ./... (all non-test packages, including the cgo universalClient) also
compiles with zero errors.


Files changed

 app/ante/fee_test.go              | 13 +++++   # test mock: 3 unordered-nonce methods + time import
 app/ante/handler_options.go       |  8 +-      # AccountKeeper: enable 3 unordered-nonce methods + time import
 go.mod                            | 30 +++--   # replace block retargeted to v0.53.7 matrix + orm-api replace
 go.sum                            | 62 +++--   # dependency graph reconciled

 compat/orm-api/go.mod                         (new)  # nested module: cosmossdk.io/api/cosmos/orm
 compat/orm-api/v1/orm.pulsar.go               (new)  # verbatim from cosmossdk.io/api v0.8.2
 compat/orm-api/v1alpha1/schema.pulsar.go      (new)  #   "
 compat/orm-api/module/v1alpha1/module.pulsar.go (new)  #   "

How to review

  1. Skim go.mod — confirm the replace block matches the table above and that
    cosmos-sdk => v0.53.7.
  2. Review compat/orm-api/ — three generated .pulsar.go files (unchanged upstream
    code) + a 15-line go.mod. The interesting bit is why it exists (see §2).
  3. Review the ante interface/mock changes — mechanical, mandated by the SDK.
  4. Run make build && ./build/pchaind version --long and make test-unit.

Rollback

Revert this PR. The change is confined to go.mod/go.sum, the compat/orm-api/
directory, and the two app/ante files; there is no state or genesis impact.

Notes / follow-ups

  • The compat/orm-api shim exists purely because upstream cosmossdk.io/orm has not
    been re-released against api v0.9.x. If/when the ORM module is updated (or these
    modules migrate off cosmossdk.io/orm), the shim can be deleted.
  • Enabling any of the new v0.53 features (e.g. unordered transactions) would be a
    separate, opt-in change.

References

  • Fixes #
  • Related issue/PR:

Changes

Testing

  • go test ./...

Checklist

  • Ready for review
  • Docs updated (if applicable)
  • Env vars updated (if applicable)

@0xNilesh
0xNilesh merged commit 02f2f96 into develop Jul 24, 2026
10 of 11 checks passed
0xNilesh added a commit that referenced this pull request Jul 24, 2026
* bump: cosmos-sdk version upgrade to 0.53.7

* fix(docker): copy compat/orm-api local-replace dir before go mod download

---------

Co-authored-by: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com>
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.

2 participants