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

Mend the counterparty state check of ChanOpenConfirm handler #397

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

Farhad-Shabani
Copy link
Member

@Farhad-Shabani Farhad-Shabani commented Feb 5, 2023

Closes: #396


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

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

@codecov
Copy link

codecov bot commented Feb 5, 2023

Codecov Report

Base: 58.45% // Head: 58.45% // No change to project coverage 👍

Coverage data is based on head (75d8e07) compared to base (1fb3547).
Patch coverage: 50.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #397   +/-   ##
=======================================
  Coverage   58.45%   58.45%           
=======================================
  Files         124      124           
  Lines       16259    16259           
=======================================
  Hits         9505     9505           
  Misses       6754     6754           
Impacted Files Coverage Δ
...rc/core/ics04_channel/handler/chan_open_confirm.rs 44.17% <50.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Farhad-Shabani Farhad-Shabani marked this pull request as ready for review February 6, 2023 06:08
Copy link
Contributor

@hu55a1n1 hu55a1n1 left a comment

Choose a reason for hiding this comment

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

Nice catch! 🙌
We're currently unable to test such proof verification in unit tests because that would require us to be able to add Tm clients to the mock chain which I believe is currently not supported but would be nice to add a test for this in the future. Also phantom unit types/tags can help avoid such bugs (future improvement - #201).

(PS: Trying to figure out why this worked on basecoin-rs before and it seems both this bug and #353 are regressions introduced in #217.)

@Farhad-Shabani
Copy link
Member Author

🙏

We're currently unable to test such proof verification in unit tests because that would require us to be able to add Tm clients to the mock chain which I believe is currently not supported but would be nice to add a test for this in the future. Also phantom unit types/tags can help avoid such bugs (future improvement - #201).

Similarly, I thought about adding unit tests for such cases, but, yea, it's not possible without Tm clients, so maybe we also can have it checked through integrating basecoin-rs into our CI. By the way, I've opened an issue #398 for this.

(PS: Trying to figure out why this worked on basecoin-rs before and it seems both this bug and #353 are regressions introduced in #217.)

Yes, exactly.

@Farhad-Shabani Farhad-Shabani merged commit 059fc1a into main Feb 6, 2023
@Farhad-Shabani Farhad-Shabani deleted the farhad/396-chan-open-confirm-fix branch February 6, 2023 15:48
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.

ChanOpenConfirm handler set the expected counterparty channel id incorrectly to None
2 participants