Skip to content

fix(cosmos): Migrate bundle chunking params on upgrade#12621

Merged
mergify[bot] merged 2 commits intomasterfrom
kriskowal-bundle-chunking-upgrade
Apr 21, 2026
Merged

fix(cosmos): Migrate bundle chunking params on upgrade#12621
mergify[bot] merged 2 commits intomasterfrom
kriskowal-bundle-chunking-upgrade

Conversation

@kriskowal
Copy link
Copy Markdown
Member

@kriskowal kriskowal commented Apr 16, 2026

Description

Chunked artifact bundle uploads fail on chains that upgraded to bundle-chunking
without a migration: the InstallationDeadlineSeconds and
InstallationDeadlineBlocks params were defined in the protobuf but never
registered in ParamSetPairs, so they persisted as 0 (Go zero value). A
deadline of 0 means "expire immediately", causing PruneExpiredBundleInstalls
to remove every pending upload before the first chunk can land.

  • Register deadline params in ParamSetPairs so the legacy param store
    round-trips them correctly and they become governable.
  • Add Migrate2to3 (consensus version 2 → 3) that calls MigrateParams,
    which treats 0 as "unset" and replaces it with the default (24 h / unlimited
    blocks). This fixes existing chains (e.g. devnet) that already have 0 stored.
  • Validate deadline params in ValidateBasic — values below -1 are
    rejected.
  • Improve observability in ChunkedArtifactStatus gRPC query — error
    messages now include the artifact ID and distinguish "expired/finalized" from
    "state inconsistency".

Security Considerations

No new authorities or trust boundaries are introduced. The migration only
replaces a zero (immediate-expiry) deadline with the intended default (24 h),
restoring the designed behavior.

Scaling Considerations

No change to resource consumption. The migration touches only the param store
(a single key-value write per param).

Documentation Considerations

Operators upgrading from consensus version 2 to 3 will automatically get the
deadline params populated. No manual steps required. Existing deployments that
already have non-zero values are unaffected.

Testing Considerations

  • TestValidateInstallationDeadlineBounds covers boundary validation.
  • All 34 pre-existing x/swingset Go tests continue to pass.

Upgrade Considerations

The module's ConsensusVersion is bumped from 2 to 3. The Migrate2to3
migration is registered and will run automatically during the upgrade handler.
To verify on a target chain: query swingset params and confirm
installation_deadline_seconds is 86400 and installation_deadline_blocks is
-1 (unless governance has set different values).

@michaelfig michaelfig force-pushed the kriskowal-bundle-chunking-upgrade branch from 5d1ecd4 to 70fa4bc Compare April 20, 2026 12:34
@kriskowal kriskowal marked this pull request as ready for review April 21, 2026 00:26
@kriskowal kriskowal force-pushed the kriskowal-bundle-chunking-upgrade branch from 70fa4bc to 76254e2 Compare April 21, 2026 00:28
@kriskowal kriskowal requested a review from michaelfig April 21, 2026 00:39
@kriskowal kriskowal added the force:integration Force integration tests to run on PR label Apr 21, 2026
Copy link
Copy Markdown
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! You and the agents did a good job. :)

@kriskowal kriskowal added the automerge:rebase Automatically rebase updates, then merge label Apr 21, 2026
@mergify mergify Bot merged commit 91a9ad7 into master Apr 21, 2026
128 checks passed
@mergify mergify Bot deleted the kriskowal-bundle-chunking-upgrade branch April 21, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge:rebase Automatically rebase updates, then merge force:integration Force integration tests to run on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants