fix(ante): pass appCodec to HandlerOptions (v4.0.1 panics on every tx without this) - #211
Merged
Merged
Conversation
…ccountDecorator on every tx) The 0.47->0.50 ante rewrite left HandlerOptions.Codec unset, so NewBlockAccountDecorator got a nil codec and cdc.GetMsgV1Signers nil-derefed on every non-simulate tx. Masked on v4.0.0 because signer resolution failed earlier (no address codec); once the InterfaceRegistry codec is fixed, execution reaches the custom ante and panics. Verified on a fork of real mainnet state: v4.0.0 bank send = code 1, v4.0.1 (with this + the codec fix) = code 0, included in a block. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #210 — v4.0.1 still bricks the tx layer without this one line
#210 fixed the InterfaceRegistry address codec (and ibctm + cosmwasm_1_3). But there's a fourth defect that only becomes reachable once #210 is applied, and without it v4.0.1 replaces "every tx rejected" with "every tx panics" — the chain stays dead after the swap.
The bug
app/app.gobuildsHandlerOptions{}for the ante handler without settingCodec, sopassageante.NewBlockAccountDecorator(options.Codec)receives a nil codec.BlockAccountDecorator.AnteHandle→handleMessages→cdc.GetMsgV1Signers(msg)then nil-pointer panics on every non-simulate tx.On v4.0.0 this was masked because signer resolution failed earlier (missing InterfaceRegistry codec →
code 1). After #210 fixes that codec, execution reaches the custom ante and crashes withcode 111222nil pointer dereferenceinx/auth/ante.SetUpContextDecorator(recovery of the panic thrown inapp/ante.handleMessages).The fix
One line — set the codec that
NewAnteHandleralready expects:Verification (real mainnet state, by broadcast — not generate-only)
Forked current mainnet state, ran the released v4.0.0 binary → a bank send is rejected
code 1. Swapped to a v4.0.1 build carrying #210 plus this commit → the same bank send returnscode 0and is included in a block. We confirmed this with the reproducible static release binary (commit including this fix), not just a dev build.Please merge and re-cut the
v4.0.1tag (the current tagfd7bcadis missing this). Reproducible binaries built from the fixed tree, if useful:sha256 900a35b8742e8c0dfe23fdd10918594c0be27cf814cc262596dba0ac56fa6dffsha256 fcb5fe0b66d548e4a197fb2b7127ec35a791c705b91ba02367136bf146cf3b32