Skip to content

fix(cosmos): avoid "codec sealed" panic in injective proposal registration#445

Merged
gheorghestrimtu merged 1 commit intodevelopfrom
rane-4333/chainlink-common-cosmos-codec-sealed-fix
Feb 19, 2026
Merged

fix(cosmos): avoid "codec sealed" panic in injective proposal registration#445
gheorghestrimtu merged 1 commit intodevelopfrom
rane-4333/chainlink-common-cosmos-codec-sealed-fix

Conversation

@gheorghestrimtu
Copy link
Contributor

Summary

Fixes Injective plugin startup panic: panic: codec sealed.

Root Cause

cosmos-sdk upgrade (v0.50.x) changed codec expectations, and proposal Amino registration was moved to module-local amino in proposal.go.
That codec is sealed in codec.go, so later RegisterConcrete(...) calls panic.

Changes

  • Removed duplicate amino.RegisterConcrete(...) calls from proposal.go init.
  • Kept gov.RegisterProposalType(...).
  • Added regression tests for:
    • proposal type registration
    • proposal Amino type tagging
    • sealed-codec panic behavior

Why safe

Proposal concrete registration is still done in RegisterLegacyAminoCodec(...) (codec.go), so functionality is preserved while removing the unsafe registration path.

Validation

  • go test ./pkg/cosmos/adapters/injective/types passes
  • Plugin no longer panics with codec sealed on startup

…ation

- remove duplicate proposal `amino.RegisterConcrete` calls from `proposal.go` init
- keep proposal amino registration centralized in `RegisterLegacyAminoCodec`
- add regression tests for proposal registration and sealed-codec panic behavior
- document why proposal init must not register on sealed module amino
@github-actions
Copy link

No CODEOWNERS file detected - @gheorghestrimtu

This repository doesn't contain a CODEOWNERS file. Please add one at one of the following paths:

  1. CODEOWNERS (root of repository)
  2. .github/CODEOWNERS

If this repository is owned/used by a single team the default entry for a CODEOWNERS would be:

* @smartcontractkit/<your team>

For more information see: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

@cl-sonarqube-production
Copy link

@gheorghestrimtu gheorghestrimtu marked this pull request as ready for review February 19, 2026 08:44
@gheorghestrimtu gheorghestrimtu merged commit b46d473 into develop Feb 19, 2026
21 of 22 checks passed
@gheorghestrimtu gheorghestrimtu deleted the rane-4333/chainlink-common-cosmos-codec-sealed-fix branch February 19, 2026 13:32
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