Repository navigation
fix: avoid panic in IsReverseCharge when reverse-charge flag is absent - #667
Conversation
The tax keeper's IsReverseCharge performed an unchecked type assertion on ctx.Value(types.ContextKeyTaxReverseCharge). Contexts that did not flow through the ante handler (queries, genesis import/export, external keepers) do not carry the flag, so the assertion panicked on nil. Use the comma-ok idiom and default to "no reverse charge" when the flag is absent, which is also the correct fund-flow default. Add a regression test covering absent, false, true and wrong-typed flags, plus event emission behavior. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
The strangelove-ventures GitHub org was renamed/moved to amygdala-labs, which killed the ghcr.io/strangelove-ventures/heighliner/osmosis image path baked into interchaintest's built-in chain config. Both PFM tests (TestTerraGaiaOsmoPFM, TestTerraPFM) now fail during chain setup with "denied" when pulling the image, independent of the code under test. Override the osmosis image repository per ChainSpec (the spec-level Images list replaces the built-in one; ChainSpec.Version still applies to Images[0]) to the same tags under the new amygdala-labs org. Verified the replacement manifests are pullable. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Root cause of the red The failing job died pulling a third-party image during chain setup, before any code from this branch compiled or ran: The Fix: e718e86 overrides the osmosis image repository per ChainSpec (spec-level |
|
Friendly bump — this is now fully green (31/31 checks, including the real |
Complete writeup of the audit shipped across classic-terra#667/classic-terra#668/classic-terra#669/classic-terra#670 plus the part-2 pass over oracle price-staleness windows and treasury distribution params, and the posted MM2 (classic-terra#664) review. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
fragwuerdig
left a comment
There was a problem hiding this comment.
Thank you. Apart from overly verbosity LGTM,
Removes the comments flagged in review as unnecessary verbosity; no code changes.
|
All four comments removed in 54ba2f0 — no code changes. |
|
DO NOT MERGE YET Thank you @GeoffreySHD - this will be merged after the Cosmos Labs security disclosure on 28th of September. There will be a rebuild of v4.0.1-patch.3 with official sources published by upstream. This change can be based on that afterwards. Possibly consensus breaking touching the return behavior of a query into the context values that were setup by the first Ante Handler decorators. Gonna ship this with a |
Resolve the conflict in tests/interchaintest/ibc_pfm_test.go by taking main's version: the osmosis heighliner image fix has landed on main, so this branch no longer needs to carry it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Description
Keeper.IsReverseChargeinx/tax/keeper/keeper.goperformed an unchecked type assertion:The flag is only stored in the context by the ante handler (
custom/auth/ante/fee.go). On anysdk.Contextthat did not flow through the ante handler — queries, genesis import/export, or calls from other keepers/tools —ctx.Value(...)returnsnil, and this assertion panics, taking down the calling process.Fix
Use the standard comma-ok idiom and default to "no reverse charge" when the flag is absent — which is also the correct fund-flow default (no flag ⇒ tax behaves normally):
Testing
New regression test
x/tax/keeper/keeper_test.go(TestIsReverseCharge, 6 subtests):true/false→ correct resultVerified in a Linux container (golang:1.24, CI parity):
go build ./...,go vet ./x/tax/..., fullx/tax+x/markettest suites, andgolangci-lint run(v2.1.6, the pinned version) all pass.Notes
The same unchecked assertion exists in the Market Module 2.0 branch (#664) — after this lands, that branch can rebase cleanly onto it.