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

Fix bug in chanOpenAck handler verification #1650

Merged
merged 2 commits into from
Dec 7, 2021

Conversation

hu55a1n1
Copy link
Member

@hu55a1n1 hu55a1n1 commented Dec 6, 2021

Closes: cosmos/ibc-rs#64

Description

Note that in the spec, chanOpenAck calls the verifyChannelState with the counterpartyChannelIdentifier that it receives from the ChanOpenAck datagram.

function chanOpenAck(
  portIdentifier: Identifier,
  channelIdentifier: Identifier,
  counterpartyVersion: string,
  counterpartyChannelIdentifier: string,
  proofTry: CommitmentProof,
  proofHeight: Height) {
    // ...
    abortTransactionUnless(connection.verifyChannelState(
      proofHeight,
      proofTry,
      channel.counterpartyPortIdentifier,
      counterpartyChannelIdentifier,            // <------------------------- here
      expected
    ))
    channel.state = OPEN
    channel.version = counterpartyVersion
    channel.counterpartyChannelIdentifier = counterpartyChannelIdentifier
    provableStore.set(channelPath(portIdentifier, channelIdentifier), channel)
}

PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@hu55a1n1 hu55a1n1 marked this pull request as ready for review December 6, 2021 17:41
Copy link
Member

@adizere adizere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Shoaib 💯 LGTM!

@adizere adizere merged commit d660a9c into master Dec 7, 2021
@adizere adizere deleted the hu55a1n1/1649-fix-chan-open-ack-verify branch December 7, 2021 16:08
hu55a1n1 added a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Fix bug in chanOpenAck handler verification

* Add .changelog entry
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.

Crash during chanOpenAck verification
2 participants