Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibc: allow legacy proof specs without prehash_key_before_comparison #3036

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/core/component/chain/src/component/app_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn apphash_spec() -> ics23::ProofSpec {
}),
min_depth: 0,
max_depth: 1,
prehash_key_before_comparison: true,
prehash_key_before_comparison: false,
}
}

Expand Down
7 changes: 6 additions & 1 deletion crates/core/component/ibc/src/component/client_counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@ pub fn validate_penumbra_client_state(

// check client proof specs match penumbra proof specs
if PENUMBRA_PROOF_SPECS.clone() != tm_client_state.proof_specs {
anyhow::bail!("invalid client state: proof specs do not match");
// allow legacy proof specs without prehash_key_before_comparison
let mut spec_with_prehash_key = tm_client_state.proof_specs.clone();
spec_with_prehash_key[0].prehash_key_before_comparison = true;
if PENUMBRA_PROOF_SPECS.clone() != spec_with_prehash_key {
anyhow::bail!("invalid client state: proof specs do not match");
}
}

// check that the trust level is correct
Expand Down
Loading