Skip to content

chore(deps): bump cosmos-sdk to v0.53.8, ship it as an empty v4.4 upgrade - #2024

Merged
RafilxTenfen merged 1 commit into
mainfrom
chore/bump-cosmos-sdk-v0.53.8
Aug 4, 2026
Merged

chore(deps): bump cosmos-sdk to v0.53.8, ship it as an empty v4.4 upgrade#2024
RafilxTenfen merged 1 commit into
mainfrom
chore/bump-cosmos-sdk-v0.53.8

Conversation

@RafilxTenfen

@RafilxTenfen RafilxTenfen commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Bumps cosmos-sdk v0.53.5 → v0.53.8 and cometbft v0.38.22 → v0.38.23, and restructures the pending upgrades so the bump can ship on its own schedule:

  • v4.4 becomes an empty upgrade whose only job is to coordinate the binary swap.
  • The costaking ActiveBaby recalculation that previously sat in v4.4 moves verbatim to v4.5, which is staged in the tree but deliberately not registered in Upgrades. Registering it is follow-up work, so this binary advertises only the v4.4 plan.

Because x/upgrade halts at a plan height with no registered handler, TestUpgradeV45 is skipped until that follow-up lands. The v4.5 unit test still exercises ResetCoStakerRwdsTrackerActiveBaby directly.

Why this needs a coordinated upgrade

v0.53.8 is state breaking, so it cannot be rolled out node by node. Several changes make an old and a new binary produce different results for the same block:

Change Divergence
#26408 x/staking getBeginInfo inverted error a redelegation that used to fail now succeeds; reachable in two ordinary user txs
#26527 / #26571 GetSigningTxData nil guards a tx that previously died as ErrPanic now executes and mutates state
#26406 x/distribution withdraw refactor gas accounting changed on the reward-withdraw path, and the FeePool write is now elided on zero remainder
#26518 strict historical-rewards reads a silent zero becomes a hard error; reachable via SDK hook paths and via CosmWasm contract queries during block execution
#26515 multisig index bounds multisig depth > 2 or > 32 signatures now rejected with ErrTooManySignatures
x/gov EndBlocker an undecodable proposal no longer abandons the rest of the queue

Babylon also runs the full ante handler inside ProcessProposal (x/checkpointing/prepare/proposal.go:491), so a mixed-version network would not merely diverge on results, validators would reject each other's proposals.

Two upstream changes that look consequential are not consensus relevant here: the secp256k1 SEC1 tag validation lives only in UnmarshalAmino/UnmarshalJSON, not the consensus proto path, and malformed-SignerInfos txs are rejected at CheckTx so they never reach a block.

Why no migration

No SDK module changed its ConsensusVersion between v0.53.4 (the version both bbn-1 and bbn-test-6 run today) and v0.53.8, so the v4.4 handler is RunMigrations and nothing else, with no store keys added or deleted. The SDK changes are unconditional binary behaviour; the handler exists purely to fix the switch height.

The bump requires no Babylon source changes.

Testing

  • go build and go vet under the mainnet, testnet and e2e build tags, and with cgo ledger test_ledger_mock (the ledger-cosmos-go v0.16.0 → v1.0.0 major bump does not reach Babylon)
  • make test-unit
  • make test-e2ev2: TestUpgradeV44, TestIBCTransfer, TestWasmIBCHandler (TestUpgradeV45 skipped, see above)

TestUpgradeV44 boots the released v4.2.5-testnet image, which runs cosmos-sdk v0.53.4 -- the same SDK both bbn-1 and bbn-test-6 run today, each on babylond v4.3.1. It passes a gov software-upgrade proposal, halts, and restarts on the locally built binary carrying v0.53.8, so the swap exercises the exact SDK delta production will cross.

It additionally asserts that pre-upgrade delegation and balance state is untouched across the swap, and that bank sends and epoched delegations still execute on the new binary.

Follow-ups not in this PR

  • Register v4.5 in Upgrades and drop the TestUpgradeV45 skip.
  • Nothing covers the redelegation-from-removed-validator flip, the distribution strict-read error path, or the multisig index bounds in e2ev2. Worth separate tickets.

Note also that this PR's diff is v0.53.5 → v0.53.8, but the release ships v0.53.4 → v0.53.8 against both live networks; the v0.53.4 → v0.53.5 hop landed on main earlier and was not re-audited here.

@RafilxTenfen
RafilxTenfen requested a review from a team as a code owner July 30, 2026 21:17
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

🔐 Commit Signature Verification

All 1 commit(s) passed verification

Commit Author Signature Key Type Key Check
d0a6cc17ead1 RafilxTenfen sk-ssh-ed25519

Summary

  • Commits verified: 1
  • Signature check: ✅ All passed
  • Key type enforcement: ✅ All sk-ssh-ed25519

Required key type: sk-ssh-ed25519 (FIDO2 hardware key)

Last verified: 2026-07-30 21:34 UTC

@RafilxTenfen RafilxTenfen self-assigned this Jul 30, 2026
Comment thread test/e2ev2/upgrades_v4_5_test.go Outdated
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Greptile Summary

This PR separates the coordinated SDK binary swap from the costaking repair.

  • Bumps Cosmos SDK to v0.53.8, CometBFT to v0.38.23, and the resulting ledger dependency.
  • Makes v4.4 an empty, migration-only upgrade coordinating the state-breaking binary change.
  • Moves the existing ActiveBaby costaking recalculation into v4.5 and registers both upgrades for mainnet and testnet.
  • Adds separate end-to-end coverage for the v4.4 binary swap and v4.5 state repair.
  • No SECURITY-GUARDRAILS.md file is present, so no repository-specific security guardrails apply; the reviewed dependency advisories do not expose a newly introduced reachable vulnerability in Babylon.

Confidence Score: 4/5

The PR appears safe to merge; the only issue is non-blocking stale v4.4 naming in the new v4.5 test documentation.

The production upgrade registration and handler split are internally consistent, while the remaining defect is confined to misleading comments in the moved end-to-end test.

Files Needing Attention: test/e2ev2/upgrades_v4_5_test.go

Important Files Changed

Filename Overview
go.mod Updates Cosmos SDK and CometBFT to security-fix releases and accepts the resulting ledger dependency update.
app/upgrades/v4_4/upgrade.go Reduces v4.4 to a migration-only handler used to coordinate the state-breaking binary swap.
app/upgrades/v4_5/upgrade.go Introduces v4.5 with the costaking recalculation moved unchanged from v4.4.
app/include_upgrade_mainnet.go Registers v4.5 alongside v4.4 for mainnet.
app/include_upgrade_testnet.go Registers v4.5 alongside v4.4 for testnet and e2e builds.
test/e2ev2/upgrades_v4_4_test.go Replaces the old costaking scenario with coverage of the empty SDK binary-swap upgrade.
test/e2ev2/upgrades_v4_5_test.go Preserves the costaking repair scenario for v4.5, but its introductory comments still call the upgrade v4.4.

Sequence Diagram

sequenceDiagram
    participant Gov as Governance
    participant Chain as Babylon chain
    participant V44 as v4.4 handler
    participant V45 as v4.5 handler
    Gov->>Chain: Schedule v4.4
    Chain->>V44: Run at coordinated swap height
    V44->>V44: RunMigrations only
    Note over Chain: All validators start Cosmos SDK v0.53.8 binary
    Gov->>Chain: Schedule v4.5 at second epoch block
    Chain->>V45: Run upgrade handler
    V45->>V45: RunMigrations
    V45->>V45: Recalculate costaker ActiveBaby and scores
Loading

Reviews (1): Last reviewed commit: "chore(deps): bump cosmos-sdk to v0.53.8,..." | Re-trigger Greptile

@RafilxTenfen
RafilxTenfen force-pushed the chore/bump-cosmos-sdk-v0.53.8 branch 2 times, most recently from 0aeb261 to 31e3748 Compare July 30, 2026 21:31
…rade

cosmos-sdk v0.53.8 is state breaking, so it must ship via a coordinated
upgrade rather than a rolling node-by-node restart. Several changes make
an old and a new binary produce different results for the same block,
among them the x/staking getBeginInfo inverted-error fix, the
GetSigningTxData nil guards, the x/distribution withdraw refactor and its
strict historical-rewards reads, and the new multisig index bounds.

To let the bump ship on its own, v4.4 becomes an empty upgrade whose only
job is to coordinate the binary swap. The costaking ActiveBaby
recalculation that previously sat in v4.4 moves to v4_5, which is staged
in the tree but deliberately NOT registered in Upgrades, so the v4.4
binary advertises only the v4.4 plan. Registering v4.5 is follow-up work.

Because x/upgrade halts at a plan height with no registered handler, the
v4.5 e2e test is skipped until that follow-up lands. Its unit test still
exercises ResetCoStakerRwdsTrackerActiveBaby directly.

No Babylon source changes are required by the bump itself. No SDK module
changed its ConsensusVersion between v0.53.4 (the version mainnet and
testnet both run) and v0.53.8, so the v4.4 handler has nothing to migrate
and adds or deletes no store keys.

Verified:
- go build / go vet under the mainnet, testnet and e2e build tags, and
  with `cgo ledger test_ledger_mock`
- make test-unit
- e2ev2: TestUpgradeV44, TestIBCTransfer, TestWasmIBCHandler

TestUpgradeV44 boots the released v4.2.5-testnet image, which runs
cosmos-sdk v0.53.4 -- the same SDK bbn-1 and bbn-test-6 run -- passes a
gov software-upgrade proposal, halts, and restarts on the locally built
binary carrying v0.53.8, exercising the exact SDK delta production will
cross. It also asserts that pre-upgrade delegation and balance state is
untouched and that bank sends and epoched delegations still execute on
the new binary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@RafilxTenfen
RafilxTenfen force-pushed the chore/bump-cosmos-sdk-v0.53.8 branch from 31e3748 to d0a6cc1 Compare July 30, 2026 21:34
@RafilxTenfen
RafilxTenfen merged commit 0de36af into main Aug 4, 2026
36 checks passed
@RafilxTenfen
RafilxTenfen deleted the chore/bump-cosmos-sdk-v0.53.8 branch August 4, 2026 13:19
RafilxTenfen added a commit that referenced this pull request Aug 5, 2026
…rade (backport #2024)

Backport of #2024 (0de36af) adapted to release/v4.4.x.

Bumps cosmos-sdk v0.53.5 -> v0.53.8 and cometbft v0.38.22 -> v0.38.23, and
adds the v4.4 upgrade handler, which carries no state migration and exists
only to coordinate the binary swap for the v0.53.8 security release.

Adapted from the original:

- v4.5 is not included. On main, #2024 moved the costaking ActiveBaby
  recalculation from v4_4 to a new v4_5. On this branch the reset in #2026
  removed that code entirely, so there is nothing to move and v4.4 is
  authored directly as the empty handler.
- TestUpgradeV44 is adapted to this branch's tmanager, which lacks the
  helpers the original relies on. StakingQuery, EpochingQuery,
  QueryDelegation, QueryCurrentEpoch, WrappedDelegate and WaitForEpochEnd
  are ported verbatim from main.
- createGovPropAndPreUpgradeFunc lives in the test file here, since on main
  it sits in upgrades_v4_5_test.go which is not backported.

(backport of commit 0de36af)
RafilxTenfen added a commit that referenced this pull request Aug 5, 2026
…rade (backport #2024)

Backport of #2024 (0de36af) adapted to release/v4.4.x.

Bumps cosmos-sdk v0.53.5 -> v0.53.8 and cometbft v0.38.22 -> v0.38.23, and
adds the v4.4 upgrade handler, which carries no state migration and exists
only to coordinate the binary swap for the v0.53.8 security release.

Adapted from the original:

- v4.5 is not included. On main, #2024 moved the costaking ActiveBaby
  recalculation from v4_4 to a new v4_5. On this branch the reset in #2026
  removed that code entirely, so there is nothing to move and v4.4 is
  authored directly as the empty handler.
- TestUpgradeV44 is adapted to this branch's tmanager, which lacks the
  helpers the original relies on. StakingQuery, EpochingQuery,
  QueryDelegation, QueryCurrentEpoch, WrappedDelegate and WaitForEpochEnd
  are ported verbatim from main.
- createGovPropAndPreUpgradeFunc lives in the test file here, since on main
  it sits in upgrades_v4_5_test.go which is not backported.

(backport of commit 0de36af)
RafilxTenfen added a commit that referenced this pull request Aug 5, 2026
…rade (backport #2024)

Backport of #2024 (0de36af) adapted to release/v4.4.x.

Bumps cosmos-sdk v0.53.5 -> v0.53.8 and cometbft v0.38.22 -> v0.38.23, and
adds the v4.4 upgrade handler, which carries no state migration and exists
only to coordinate the binary swap for the v0.53.8 security release.

Adapted from the original:

- v4.5 is not included. On main, #2024 moved the costaking ActiveBaby
  recalculation from v4_4 to a new v4_5. On this branch the reset in #2026
  removed that code entirely, so there is nothing to move and v4.4 is
  authored directly as the empty handler.
- TestUpgradeV44 is adapted to this branch's tmanager, which lacks the
  helpers the original relies on. StakingQuery, EpochingQuery,
  QueryDelegation, QueryCurrentEpoch, WrappedDelegate and WaitForEpochEnd
  are ported verbatim from main.
- createGovPropAndPreUpgradeFunc lives in the test file here, since on main
  it sits in upgrades_v4_5_test.go which is not backported.

(backport of commit 0de36af)
RafilxTenfen added a commit that referenced this pull request Aug 5, 2026
…rade (backport #2024)

Backport of #2024 (0de36af) adapted to release/v4.4.x.

Bumps cosmos-sdk v0.53.5 -> v0.53.8 and cometbft v0.38.22 -> v0.38.23, and
adds the v4.4 upgrade handler, which carries no state migration and exists
only to coordinate the binary swap for the v0.53.8 security release.

Adapted from the original:

- v4.5 is not included. On main, #2024 moved the costaking ActiveBaby
  recalculation from v4_4 to a new v4_5. On this branch the reset in #2026
  removed that code entirely, so there is nothing to move and v4.4 is
  authored directly as the empty handler.
- TestUpgradeV44 is adapted to this branch's tmanager, which lacks the
  helpers the original relies on. StakingQuery, EpochingQuery,
  QueryDelegation, QueryCurrentEpoch, WrappedDelegate and WaitForEpochEnd
  are ported verbatim from main.
- createGovPropAndPreUpgradeFunc lives in the test file here, since on main
  it sits in upgrades_v4_5_test.go which is not backported.

(backport of commit 0de36af)
RafilxTenfen added a commit that referenced this pull request Aug 5, 2026
…rade (backport #2024) (#2028)

## Summary

Backport of #2024 (`0de36afa`) to `release/v4.4.x`.

This is the **top of a three PR stack** and targets #2027's branch, not
`release/v4.4.x` directly. Merge order is #2026, then #2027, then this
one. GitHub retargets each PR automatically as the one below it merges.

```
release/v4.4.x
 └─ #2026  reset release/v4.4.x to release/v4.3.x
     └─ #2027  bump CosmWasm/wasmd v0.60.5 (backport #1965)
         └─ THIS PR  cosmos-sdk v0.53.8 + empty v4.4 upgrade
```

* Bumps `cosmos-sdk` v0.53.5 to v0.53.8 and `cometbft` v0.38.22 to
v0.38.23
* Adds the `v4.4` upgrade handler, which carries no state migration and
exists only to coordinate the binary swap for the v0.53.8 security
release
* Registers `v4.4` in `Upgrades` for both mainnet and testnet builds
* Adds `TestUpgradeV44`, which boots the pre-upgrade image, passes a gov
software upgrade proposal, and asserts state survives the swap

Refer to #2024 for the full analysis of why v0.53.8 is state breaking
and why no migration is required. That reasoning is unchanged here.

## Backport adaptations

1. **v4.5 is not included.** On `main`, #2024 moved the costaking
`ActiveBaby` recalculation out of `v4_4` and into a new, deliberately
unregistered `v4_5`. On this branch #2026 removed that code entirely, so
there is nothing to move: `v4_4` is authored directly as the empty
handler and no `v4_5` package is created. **This means the costaking
recalculation staged on `main` for v4.5 does not reach this release
line.** If it is meant to, it needs its own backport.
2. **`TestUpgradeV44` is adapted to this branch's `tmanager`,** which
does not have the helpers the original relies on. Ported verbatim from
`main`: `StakingQuery`, `EpochingQuery`, `QueryDelegation`,
`QueryCurrentEpoch` (`node_queries.go`), `WrappedDelegate`
(`node_txs.go`) and `WaitForEpochEnd` (`node.go`).
3. **`createGovPropAndPreUpgradeFunc` lives in the test file here.** On
`main` it sits in `upgrades_v4_5_test.go`, which is not backported.
4. **Two small API differences** on this branch: `WalletSender` has no
`Addr()` (uses `.Address.String()`), and `UpdateWalletAccSeqNumber` is
not variadic (the call is split in two).
5. **`cfg.EpochLength` is dropped from the test setup.** That field is
not wired into genesis on this branch, so setting it is a no-op. The
epoching default here is already 10 blocks, so the epoch assertions
behave as intended without it.

## Why the stack

`wasmd` v0.55.1, which #2026 restores, does not compile against
`cosmos-sdk` v0.53.5 or later, so #2027 is a hard prerequisite for this
PR. See that PR for the detail.

## Original PR

#2024

🤖 Generated with [Claude Code](https://claude.com/claude-code)
RafilxTenfen added a commit that referenced this pull request Aug 6, 2026
## Summary

Brings `release/v4.4.x`'s CI, devops and dependency surface up to
`main`, in two commits.

This is the **top of a four PR stack** and targets #2028's branch. Merge
order is #2026, #2027, #2028, then this one. GitHub retargets each PR
automatically as the one below it merges.

```
release/v4.4.x
 └─ #2026  reset release/v4.4.x to release/v4.3.x
     └─ #2027  bump CosmWasm/wasmd v0.60.5 (backport #1965)
         └─ #2028  cosmos-sdk v0.53.8 + empty v4.4 upgrade (backport #2024)
             └─ THIS PR  CI, devops and dependency bumps
```

### Commit 1, CI and devops

* **#1995, #2010**: reusable workflows to v0.19.1 across `ci.yml`,
`publish.yml`, `changelog-reminder.yml` and `sync_pr_main_to_base.yml`,
plus the tibdex backport action comment. The action SHA pins these PRs
also carry are already present from #2022, so only the reusable refs
move.
* **#1952**: Dockerfile hardening (Alpine 3.21 and Debian bookworm
bases, pinned runtime packages, hadolint fixes) and the devops
CODEOWNERS entry for `/.github/workflows/`.
* **#1931**: pin `GORELEASER_IMAGE` to `goreleaser-cross:v1.27.0` rather
than deriving the tag from `go.mod`.

### Commit 2, Go 1.25 and dependencies (#2008)

* `go` directive 1.23.8 to 1.25.8, with matching `go-version` in the
workflows, the golang base images, and golangci-lint v2.11.4
* **`grpc` v1.75.0 to v1.80.0, which closes `CVE-2026-33186`**, the
critical currently failing Trivy on #2026
* `x/crypto` v0.49.0, `x/net` v0.52.0, `x/text` v0.35.0, `x/sys`
v0.42.0, `otel` v1.43.0, `go-getter` v1.8.6, `go-ethereum` v1.17.0,
`go-jose` v4.1.4, `runc` v1.3.6, `xz` v0.5.15, `mapstructure` v2.4.0,
`msgpack` v2.4.1, `edwards25519` v1.1.1, `bitset` v1.24.3, `docker/cli`
v29.2.0
* the `.golangci.yml` `noctx` exemption for `test/e2ev2/`

## Things reviewers should weigh

1. **The Go bump and the dependency bumps are not separable.** #2008
bundles them upstream, and mechanically `go-getter` v1.8.6 requires `go
1.25.8` while the `x/*` and `otel` packages require `go 1.25.0`. There
is no version of this change that fixes the CVEs while the branch stays
on `go 1.23.8`. It was attempted first and does not resolve.

2. **The v4.4 binary swap now crosses two deltas, not one.** #2028 was
designed around a single clean delta, cosmos-sdk v0.53.4 to v0.53.8.
With this PR the swap also crosses go 1.23 to go 1.25. Go version
changes are a known source of subtle non-determinism in Cosmos chains,
`sort.Slice` is not stable and its algorithm has changed across
releases, and this repo has already been bitten by that class of bug
(#1956, #1802, #1805). Green unit tests and lint do not rule it out. The
check that would is a mainnet block replay comparing a go 1.23 build
against a go 1.25 build, worth doing before v4.4 ships.

3. **`goreleaser-cross:v1.27.0` ships Go 1.25.5, but `go.mod` now
requires 1.25.8.** Release builds would have to auto-download a
toolchain, or fail outright under `GOTOOLCHAIN=local`. `main` carries
the identical mismatch, so this is inherited rather than introduced, but
it affects release builds and someone should own it.

4. **`go.mod` and `go.sum` were regenerated against this branch's
dependency graph** rather than copied from `main`, which carries
indirect requirements from features not present here (the AWS SDK set,
ProjectZKM/Ziren). This is why the `go.sum` diff is large.

5. **`test/replay/stake_expansion_test.go` and `wrong_epoch_ve_test.go`
are reformatted only.** Go 1.25's `gofmt` aligns struct fields
differently. Neither file is otherwise modified.

## Verification

Run locally against this branch before pushing:

| Check | Result |
| --- | --- |
| `go build ./...` | clean |
| `go vet` under `mainnet`, `testnet`, `e2e` and `./test/e2ev2/...` |
clean |
| `golangci-lint v2.11.4`, the version CI uses | 0 issues |
| `gofmt -l` | clean |
| `make test-unit` | 34 packages ok, 0 failures |

## Not included

**#2008 is included but the following are deliberately not**: the
`e2e-docker-build-e2e-init-chain` job added to `ci.yml` by #1906, since
that PR's substance is not backported here. `cometbft` #1999 is already
present via #2001.

## Original PRs

#1931, #1952, #1995, #2008, #2010

🤖 Generated with [Claude Code](https://claude.com/claude-code)
RafilxTenfen added a commit that referenced this pull request Aug 6, 2026
Adds the `v4.4.0` changelog section for the release, moving the
state-breaking entries (wasmd v0.60.5 bump [#1965], cosmos-sdk v0.53.8
bump shipped as an empty v4.4 upgrade [#2024]) out of `Unreleased` and
under the tagged `v4.4.0` heading.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.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.

3 participants