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 packet handler proofs #323

Merged
merged 9 commits into from
Jan 6, 2023
Merged

Conversation

Farhad-Shabani
Copy link
Member

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

Closes: #230

Purpose

Streamline the process of verifying proofs of packet handlers as a predecessor activity for ADR05 implementation

Description

  • Refactor proof handlers to conduct proof verifications inline with the process function
  • Remove ics04_channel/handler/verify.rs
  • Remove proofs.rs module
  • Apply variable naming conventions for packet handlers and msgs

Remarks


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 requested a review from plafer January 5, 2023 05:04
@Farhad-Shabani Farhad-Shabani self-assigned this Jan 5, 2023
@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Base: 66.31% // Head: 62.96% // Decreases project coverage by -3.34% ⚠️

Coverage data is based on head (3c6e438) compared to base (968e553).
Patch coverage: 77.63% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #323      +/-   ##
==========================================
- Coverage   66.31%   62.96%   -3.35%     
==========================================
  Files         125      124       -1     
  Lines       12922    13931    +1009     
==========================================
+ Hits         8569     8772     +203     
- Misses       4353     5159     +806     
Impacted Files Coverage Δ
crates/ibc/src/applications/transfer/relay.rs 0.00% <0.00%> (ø)
.../src/applications/transfer/relay/on_recv_packet.rs 0.00% <0.00%> (ø)
crates/ibc/src/core/ics03_connection/error.rs 7.69% <ø> (+0.54%) ⬆️
crates/ibc/src/core/ics04_channel/error.rs 4.76% <ø> (+0.41%) ⬆️
crates/ibc/src/core/ics04_channel/handler.rs 86.17% <ø> (ø)
crates/ibc/src/lib.rs 100.00% <ø> (ø)
...tes/ibc/src/applications/transfer/msgs/transfer.rs 46.53% <37.03%> (+0.45%) ⬆️
crates/ibc/src/core/ics04_channel/packet.rs 49.39% <38.23%> (ø)
...ibc/src/core/ics04_channel/msgs/acknowledgement.rs 53.01% <57.14%> (-2.05%) ⬇️
crates/ibc/src/core/ics04_channel/msgs/timeout.rs 71.87% <66.66%> (-3.89%) ⬇️
... and 44 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 added A: breaking Admin: breaking change that may impact operators O: usability Objective: aims to enhance user experience (UX) and streamline product usability labels Jan 5, 2023
@Farhad-Shabani Farhad-Shabani marked this pull request as ready for review January 5, 2023 05:17
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.

Great work! There's just the Proofs refactor to be done and we'll be ready to merge!

crates/ibc/src/core/ics04_channel/handler/recv_packet.rs Outdated Show resolved Hide resolved
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.

Good job! Most of the comments are requests to change variable names

crates/ibc/src/core/ics04_channel/handler/recv_packet.rs Outdated Show resolved Hide resolved
crates/ibc/src/core/ics04_channel/handler/timeout.rs Outdated Show resolved Hide resolved
crates/ibc/src/core/ics04_channel/handler/timeout.rs Outdated Show resolved Hide resolved
@Farhad-Shabani
Copy link
Member Author

Thank you @plafer
There's just a thing... the raw messages from proto doesn't match the naming convention

@plafer
Copy link
Contributor

plafer commented Jan 6, 2023

That's fine; we want to avoid changing the proto as it's a breaking change at the protocol level. This is also the advantage of using domain types: we can rename and reorganize the proto types as we wish for internal use.

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.

🎉

@plafer plafer merged commit 475ffa0 into main Jan 6, 2023
@plafer plafer deleted the farhad/refactor-packet-proofs branch January 6, 2023 17:23
Farhad-Shabani added a commit that referenced this pull request Sep 9, 2024
* Refactor packet handler proofs

* Refactor proofs of packet message types

* modify docs about our naming convention

* Mend missed naming conventions and apply nits

* Apply naming convention on Packet struct

* Apply naming convention on MsgTransfer

* Add docstring before processes to emphasize naming convention

* Move clone to error paths

* Fix clippy warnings

Co-authored-by: Philippe Laferriere <plafer@protonmail.com>
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 O: usability Objective: aims to enhance user experience (UX) and streamline product usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor packet handler proofs
2 participants