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

ConnectionOpenTry: double-check check_client_consensus_height impl #167

Open
plafer opened this issue Oct 11, 2022 · 6 comments
Open

ConnectionOpenTry: double-check check_client_consensus_height impl #167

plafer opened this issue Oct 11, 2022 · 6 comments
Labels
A: bug Admin: something isn't working A: low-priority Admin: low priority / non urgent issue, expect longer wait time for PR reviews

Comments

@plafer
Copy link
Contributor

plafer commented Oct 11, 2022

Specifically this line. Our check is:

if claimed_height > ctx.host_current_height() { fail }

whereas ibc-go does

if consensusHeight.GTE(selfHeight) { fail }

That is, > vs >=. However, we shouldn't necessarily blindly change it to >=. See this discussion for the subtleties involved in this decision.

@plafer plafer added the A: bug Admin: something isn't working label Oct 11, 2022
@plafer
Copy link
Contributor Author

plafer commented Oct 11, 2022

Additionally, note that we also check the lower bound in check_client_consensus_height(), as mandated by ics-24. ibc-go doesn't, and neither does the spec.

Maybe this check is redundant with the consensus state proof verification? i.e. if the host doesn't have the consensus state stored at that height, then the consensus state proof verification will fail.

@hu55a1n1
Copy link
Contributor

Copying the TLDR; from Anca's comment on cosmos/ibc-go#1732 ->

The only thing i can think of is to have a different check for simulation (>) vs deliverTx (>=). But not sure it is possible. We can fix it at relayer side by waiting for the chain to advance to next height.

I wonder if the new ADR05 validation/execution separation can help solve this problem.

@hu55a1n1
Copy link
Contributor

Maybe this check is redundant with the consensus state proof verification? i.e. if the host doesn't have the consensus state stored at that height, then the consensus state proof verification will fail.

I think this is correct and we could remove the redundant check for > oldest_height.

@github-project-automation github-project-automation bot moved this to 📥 To Do in ibc-rs Feb 2, 2023
@Farhad-Shabani Farhad-Shabani modified the milestone: Fix known bugs and issues Feb 3, 2023
@Farhad-Shabani
Copy link
Member

It is closed, as it is obsolete following the implementation of ADR05 and PR #257

@github-project-automation github-project-automation bot moved this from 📥 To Do to ✅ Done in ibc-rs Mar 16, 2023
@plafer
Copy link
Contributor Author

plafer commented Mar 16, 2023

We changed where the height check is (now here for conn_open_try), but we still need to understand the discrepancy (we do >, ibc-go does >=). This might have something to do with ibc-go's simulation; there was a bug in the past related to that check. It's low-priority since it is an edge case and the relayer can always just send the datagram a second time if the check fails; but we should still investigate and document our findings.

@plafer plafer reopened this Mar 16, 2023
@Farhad-Shabani
Copy link
Member

oh, Thanks for the update 👍🏻

@plafer plafer added the A: low-priority Admin: low priority / non urgent issue, expect longer wait time for PR reviews label Mar 16, 2023
@Farhad-Shabani Farhad-Shabani moved this from ✅ Done to 📥 To Do in ibc-rs Mar 28, 2023
shuoer86 pushed a commit to shuoer86/ibc-rs that referenced this issue Nov 4, 2023
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.2.0 to 0.12.0.
- [Commits](golang/crypto@v0.2.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carlos Rodriguez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working A: low-priority Admin: low priority / non urgent issue, expect longer wait time for PR reviews
Projects
Status: 📥 To Do
Development

No branches or pull requests

3 participants