fix(app): wire address codec into InterfaceRegistry (fixes broken staking/distribution txs on v4.0.0) - #210
Conversation
MakeTestEncodingConfig built the InterfaceRegistry with the codec-less types.NewInterfaceRegistry(). Under Cosmos SDK v0.50 the registry must carry an address codec via SigningOptions, otherwise every message that references a validator (valoper) address — MsgDelegate, MsgUndelegate, MsgBeginRedelegate, MsgWithdrawDelegatorReward — fails with: InterfaceRegistry requires a proper address codec implementation to do address conversion This encoding config feeds both the CLI (app.MakeEncodingConfig) and the node (NewPassageApp -> SetInterfaceRegistry), so the missing codec silently breaks all staking and distribution transactions network-wide while plain bank sends keep working. Construct the registry with NewInterfaceRegistryWithOptions and the pasg / pasgvaloper bech32 codecs. Verified: go build passes and the CLI now generates MsgWithdrawDelegatorReward and MsgDelegate txs that previously errored.
|
The three failing checks (Build / Tests / golangci-lint) are pre-existing CI breakage unrelated to this change — they fail on the base branch for any PR. The workflows install an older Go than the code requires:
Hence the build errors like This one-file change builds and runs cleanly on Go 1.21: Bumping the CI |
ibc-go v8 no longer bundles the light-client modules inside ibc.AppModuleBasic. Without ibctm registered, any decode of an /ibc.lightclients.tendermint.v1.ClientState Any fails with "no concrete type registered for type URL ... against interface *exported.ClientState" - breaking IBC client-state queries and transfer timeout resolution on both client and node. Verified: full message-surface battery (one generate-only tx per wired module incl. ibc-transfer with absolute timeouts) passes 18/18 on the patched binary; the staking/distribution messages and IBC client-state decode all fail on unpatched v4.0.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Pushed a second commit — this PR now fixes TWO v4.0.0 registry bugs, not one. While gate-testing the first fix with a full message-surface battery (one This breaks IBC client-state queries and Fix is 4 lines in Verification (patched binary): 18/18 battery pass — bank send, staking delegate/unbond/redelegate, distribution withdraw/set-withdraw-addr, gov vote, authz grant, feegrant grant, ibc-transfer (absolute timeouts), wasm execute, plus the LCD query battery. On unpatched v4.0.0 the same battery fails exactly the 5 staking/distribution messages (address-codec bug) and the IBC client-state decode (this bug). Given both staking/distribution AND IBC are affected network-wide, we'd suggest treating this as release-blocking for a coordinated v4.0.1. Happy to help coordinate — we have reproducible-build infrastructure ready from the v4.0.0 release. |
The 0.47->0.50 port dropped cosmwasm_1_3 from availableCapabilities (v3.0.0 had "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2, cosmwasm_1_3"; v4.0.0 shipped without cosmwasm_1_3). Contracts requiring 1_3 features that v3.0.0 accepted at store-code would be rejected on v4.0.0. wasmvm 1.5.x fully supports cosmwasm_1_3. Restores exact v3.0.0 parity; no new capabilities introduced. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
438bb68 to
bd51aff
Compare
|
Third fix pushed: the 0.47->0.50 port also dropped \cosmwasm_1_3\ from the wasm \�vailableCapabilities\ (v3.0.0 had it; v4.0.0 shipped without). Contracts requiring 1_3 features that v3.0.0 accepted would be rejected at store-code on v4.0.0. Restored to exact v3.0.0 parity - no new capabilities introduced. Also audited every module in the module manager against ModuleBasics registrations: no further gaps of the ibctm class. Extended verification battery (tx construction x11 modules, direct + amino-json signing, stored-Any decode of all historical gov proposals and vesting accounts, LCD query battery) passes 22/22 on the branch head. |
Problem
On
v4.0.x(Cosmos SDK v0.50), every staking and distribution transaction fails network-wide with:Affected messages are all those that carry a validator (
…valoper) address:MsgDelegate,MsgUndelegate,MsgBeginRedelegate,MsgWithdrawDelegatorReward.Plain
MsgSend(bank) is unaffected, which is what makes this easy to miss.Root cause
app/params/proto.gobuilds theInterfaceRegistrywith the codec-lesstypes.NewInterfaceRegistry(). Under SDK v0.50 the registry must be createdwith an address codec via
SigningOptions, or any address conversion duringtx build/decode/sign fails.
This encoding config is not test-only despite the name — it flows into both:
cmd/passage/cmd/root.go→app.MakeEncodingConfig()→params.MakeTestEncodingConfig()NewPassageApp(...)→bApp.SetInterfaceRegistry(encodingConfig.InterfaceRegistry)so the missing codec breaks both client-side tx building and server-side tx
processing. The correctly-wired codecs already exist for
autocliinapp.go, but the app/CLI codec path never receives them.Fix
Construct the registry with
NewInterfaceRegistryWithOptionsand thepasg/pasgvaloperbech32 codecs.Verification
go build ./cmd/passagepasses, and the CLI now generates the previouslyfailing transactions:
Note:
maincarries the same defect and needs the same change.