Skip to content

fix(core/02-client): reject a substitute of a different client type in RecoverClient - #9080

Open
kriss39 wants to merge 2 commits into
cosmos:mainfrom
kriss39:fix/recover-client-type-mismatch
Open

kriss39 wants to merge 2 commits into
cosmos:mainfrom
kriss39:fix/recover-client-type-mismatch

Conversation

@kriss39

@kriss39 kriss39 commented Sep 13, 2026

Copy link
Copy Markdown

Description

Keeper.RecoverClient routes to the subject's light client module and then calls Status and LatestHeight on that module with the substitute client identifier. If the substitute is of a different client type (for example a 07-tendermint subject with a 06-solomachine or 08-wasm substitute), the module unmarshals the substitute client state and panics on the concrete type assertion instead of returning an error.

This PR compares the client types parsed from both identifiers before touching the substitute store and returns ErrInvalidClientType. TestRecoverClient gains cases for a substitute of a different client type (panics on main) and for an unparsable substitute identifier; the existing "substitute client does not exist" case now uses a well-formed but unknown tendermint client ID.

closes: #9075


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Include changelog entry when appropriate (e.g. chores should be omitted from changelog).
  • Wrote unit and integration tests if relevant.
  • Updated documentation (docs/) if anything is changed. (n/a — no documented behaviour changes)
  • Added godoc comments if relevant.
  • Self-reviewed Files changed in the GitHub PR explorer.
  • Provide a conventional commit message to follow the repository standards.

@kriss39
kriss39 requested a review from a team as a code owner September 13, 2026 20:48
@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

PR author is not in the allowed authors list.

…RecoverClient

Keeper.RecoverClient routes to the subject's light client module and then
calls Status and LatestHeight on that module with the substitute client
identifier. If the substitute is of a different client type (for example a
07-tendermint subject with a 06-solomachine or 08-wasm substitute), the
module unmarshals the substitute client state and panics on the concrete
type assertion instead of returning an error.

Compare the client types parsed from both identifiers before touching the
substitute store and return ErrInvalidClientType, and cover the case in
TestRecoverClient.

Signed-off-by: Kanan <93033289+kriss39@users.noreply.github.com>
@kriss39
kriss39 force-pushed the fix/recover-client-type-mismatch branch from 7fa0e82 to 79e4ecf Compare September 13, 2026 20:51
@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.82%. Comparing base (8a7d813) to head (79e4ecf).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9080      +/-   ##
==========================================
+ Coverage   66.81%   66.82%   +0.01%     
==========================================
  Files         329      329              
  Lines       17485    17491       +6     
==========================================
+ Hits        11682    11688       +6     
  Misses       5069     5069              
  Partials      734      734              
Flag Coverage Δ
08-wasm 65.04% <ø> (ø)
ibc-go 66.88% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

core/02-client: RecoverClient panics when the substitute is a different client type

1 participant