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

Refactor verify_delay_passed and move it under ics03_connection section #498

Merged
merged 10 commits into from
Mar 7, 2023

Conversation

Farhad-Shabani
Copy link
Member

@Farhad-Shabani Farhad-Shabani commented Mar 4, 2023

Closes: #404

Description

This incorrectly placed verify_delay_passed caused entanglements for some packet validation methods and forced them to accept ctx as an argument, which was unnecessary.
This PR got pushed to the top since the side effect is that we got limited and can't well explore new changes regarding *Context and Router traits. This should make it easier to work on issues like #490

Remark

Upon this change, previous verify_delay_passed tests no longer apply, and appropriate tests for two conditions of having connections with and without delay should be added for appropriate message types like recv_packet. (as a later PR?!)


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).

@Farhad-Shabani Farhad-Shabani changed the title Refactorverify_delay_passed and move it under ics03_connection section Refactor verify_delay_passed and move it under ics03_connection section Mar 4, 2023
@Farhad-Shabani Farhad-Shabani added the A: breaking Admin: breaking change that may impact operators label Mar 4, 2023
@codecov
Copy link

codecov bot commented Mar 4, 2023

Codecov Report

Patch coverage: 85.91% and project coverage change: +0.57 🎉

Comparison is base (3a8fb38) 71.36% compared to head (043b902) 71.94%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
+ Coverage   71.36%   71.94%   +0.57%     
==========================================
  Files         125      126       +1     
  Lines       15752    15771      +19     
==========================================
+ Hits        11242    11347     +105     
+ Misses       4510     4424      -86     
Impacted Files Coverage Δ
...s/ibc/src/clients/ics07_tendermint/client_state.rs 53.30% <0.00%> (+1.48%) ⬆️
crates/ibc/src/clients/ics07_tendermint/error.rs 19.04% <ø> (+0.86%) ⬆️
crates/ibc/src/core/ics02_client/client_state.rs 75.00% <ø> (ø)
crates/ibc/src/core/ics03_connection/error.rs 7.14% <0.00%> (-0.55%) ⬇️
crates/ibc/src/core/ics03_connection/delay.rs 72.97% <72.97%> (ø)
...src/core/ics04_channel/handler/timeout_on_close.rs 85.88% <94.73%> (+1.27%) ⬆️
.../src/core/ics04_channel/handler/acknowledgement.rs 85.23% <100.00%> (+0.89%) ⬆️
.../ibc/src/core/ics04_channel/handler/recv_packet.rs 85.97% <100.00%> (+0.74%) ⬆️
...ates/ibc/src/core/ics04_channel/handler/timeout.rs 89.27% <100.00%> (+1.02%) ⬆️
crates/ibc/src/mock/client_state.rs 91.26% <100.00%> (-0.14%) ⬇️
... and 6 more

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 March 4, 2023 20:26
Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

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

This is a great change! The fact that we were taking in a ConnectionEnd in client verification functions was a big red flag. In the timeout case, we were performing that verification twice, as a result of the poor separation of concerns.

Thank you for this!

crates/ibc/src/core/ics03_connection/delay.rs Outdated Show resolved Hide resolved
crates/ibc/src/core/ics03_connection/delay.rs Outdated Show resolved Hide resolved
@plafer
Copy link
Contributor

plafer commented Mar 6, 2023

as for the removed tests, could you also create an issue to remind us to add them back?

@Farhad-Shabani
Copy link
Member Author

Glad you liked this change 🤗

as for the removed tests, could you also create an issue to remind us to add them back?

I tried to cover needed tests in this PR, but the changing scope was beyond PR's concern, and I didn't want to wrestle with merge conflicts :)

Here is the opened issue: #505

@plafer plafer merged commit d0d0683 into main Mar 7, 2023
@plafer plafer deleted the farhad/verify-delay-passed branch March 7, 2023 19:57
Farhad-Shabani added a commit that referenced this pull request Sep 9, 2024
…ection (#498)

* Export standalone commitment creators for Ack & Packet

* Remove compute mod + make compute functions private

* Fix clippy catch

* Move verify_delay_passed under the ICS03

* Change connection_end args to prefix

* Fix tests

* Use core::cmp::Ord for Timestamp comparison

* Remove after method of Timestamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: breaking Admin: breaking change that may impact operators
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Investigate moving verify_delay_passed to a more appropriate section
2 participants